:root {
    --blue: #2f7bff;
    --blue-dark: #1d5fe0;
    --blue-soft: #e8f1ff;
    --green: #16a34a;
    --green-soft: #e8f8ee;
    --red: #ef4444;
    --red-soft: #fdecec;
    --amber: #d97706;
    --amber-soft: #fff4e0;
    --violet: #7c3aed;
    --violet-soft: #f1e9ff;
    --night-off: #3b2178;
    --night-off-soft: #ece7f8;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e6eaf2;
    --bg: #f3f6fb;
    --card: #ffffff;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 16px;
    --sidebar: 248px;
    --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar);
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
}

.brand-text strong {
    display: block;
    font-size: 18px;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
}

.icon-btn.sidebar-close {
    display: none;
    margin-left: auto;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #475569;
    font-weight: 500;
    border: 0;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.nav-link:hover {
    background: #f8fafc;
}

.nav-link.is-active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 16px rgba(47, 123, 255, 0.28);
}

.nav-icon {
    display: grid;
    place-items: center;
}

.sidebar-footer {
    padding: 16px 14px 20px;
}

.logout-link {
    color: var(--muted);
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px 8px;
}

.topbar-company {
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo,
.brand-logo {
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: 8px;
}

.logo-preview {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    margin: 0 0 8px;
    padding: 6px;
}

.inline-form {
    display: inline;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-chip,
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
}

.date-chip {
    color: var(--muted);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-meta small {
    color: var(--muted);
}

.icon-btn.menu-toggle {
    display: none;
}

.content {
    padding: 8px 28px 28px;
    flex: 1;
}

.page-heading h1 {
    margin: 0;
    font-size: 28px;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.stat-grid.stats-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
}

.stat-card.blue { background: #eef5ff; }
.stat-card.teal { background: #e7f7f5; }
.stat-card.green { background: var(--green-soft); }
.stat-card.red { background: var(--red-soft); }
.stat-card.amber { background: var(--amber-soft); }

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
}

.stat-card.blue .stat-icon { background: var(--blue); }
.stat-card.teal .stat-icon { background: #0d9488; }
.stat-card.green .stat-icon { background: var(--green); }
.stat-card.red .stat-icon { background: var(--red); }
.stat-card.amber .stat-icon { background: var(--amber); }

.stat-card strong {
    display: block;
    font-size: 28px;
    line-height: 1;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 16px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 18px 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-head h2 {
    margin: 0;
    font-size: 18px;
}

.link-btn {
    color: var(--blue);
    font-weight: 600;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 11px 8px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-present { background: #e9f9ef; color: var(--green); }
.badge-absent { background: #fdecec; color: var(--red); }
.badge-night_off { background: #fff4e0; color: var(--amber); }
.badge-not_scheduled { background: #f1f5f9; color: var(--muted); }

.duty-list {
    display: flex;
    flex-direction: column;
}

.duty-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.duty-row:last-child {
    border-bottom: 0;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.quick-grid.quick-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hr-duty-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.hr-shift-group {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
}

.hr-shift-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hr-shift-head div {
    flex: 1;
}

.hr-shift-head strong {
    display: block;
}

.hr-shift-head small {
    color: var(--muted);
    font-size: 12px;
}

.hr-name-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hr-name-list li {
    padding: 6px 0;
    border-bottom: 1px solid #eef2f7;
    font-weight: 600;
}

.hr-name-list li:last-child {
    border-bottom: 0;
}

.hr-name-list small {
    display: block;
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
}

.hr-exception-grid {
    margin-top: 16px;
}

.quick-action {
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    font-weight: 600;
    color: #334155;
}

.quick-action span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0 auto 8px;
    border-radius: 12px;
    color: #fff;
}

.quick-action.blue { background: var(--blue-soft); }
.quick-action.green { background: var(--green-soft); }
.quick-action.red { background: var(--red-soft); }
.quick-action.violet { background: var(--violet-soft); }
.quick-action.blue span { background: var(--blue); }
.quick-action.green span { background: var(--green); }
.quick-action.red span { background: var(--red); }
.quick-action.violet span { background: var(--violet); }

.card-actions {
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

.btn-ghost {
    background: #f8fafc;
    color: var(--ink);
}

.icon-btn {
    border: 0;
    background: #f8fafc;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.flash {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.flash-error { background: var(--red-soft); color: #b91c1c; }
.flash-success { background: var(--green-soft); color: #166534; }

.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 28px 20px;
    color: var(--muted);
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #eef5ff 0%, #f3f6fb 100%);
}

.login-card {
    width: min(420px, calc(100% - 32px));
    background: var(--card);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 16px 0 4px;
}

.login-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field span {
    font-size: 13px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    background: #fff;
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.12);
}

.field-hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.login-card .btn {
    width: 100%;
    margin-top: 8px;
}

.hint {
    margin-top: 18px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    color: var(--muted);
    font-size: 12px;
}

.setup-banner {
    background: #fff7ed;
    color: #9a3412;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.modal-root[hidden] {
    display: none;
}

.modal-root {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100% - 32px));
    margin: 12vh auto 0;
    background: var(--card);
    border-radius: 16px;
    padding: 18px;
}

.modal-header,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-actions {
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.sidebar-backdrop[hidden] {
    display: none;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stack-form .field {
    margin-bottom: 12px;
}

.stack-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    margin-top: 8px;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
    font-weight: 600;
}

.users-layout {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.2fr);
}

.btn-danger {
    background: var(--red-soft);
    color: #b91c1c;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.toolbar .field {
    margin: 0;
    min-width: 160px;
}

.toolbar-search {
    flex: 1;
    min-width: 220px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

button.link-btn {
    background: none;
    padding: 0;
    border-radius: 0;
    width: auto;
    height: auto;
    color: var(--blue);
    font-weight: 600;
    font-size: 13px;
}

button.link-btn.danger {
    color: var(--red);
}

.shift-note {
    margin: 0 0 16px;
    font-size: 13px;
}

.shift-code {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 8px;
    background: #eef2ff;
    color: var(--blue);
    font-weight: 700;
}

.stack-form input[readonly] {
    background: #f8fafc;
    color: var(--muted);
}

.drawer-root[hidden] {
    display: none;
}

.drawer-root {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
}

.drawer-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: min(460px, 100%);
    background: var(--card);
    box-shadow: -16px 0 40px rgba(15, 23, 42, 0.12);
    padding: 22px;
    overflow: auto;
}

.drawer-panel .form-grid {
    grid-template-columns: 1fr;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.drawer-header h2 {
    margin: 0;
}

.drawer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

#shift-form .drawer-actions {
    flex-direction: column-reverse;
}

#shift-form .drawer-actions .btn {
    width: 100%;
}

body.drawer-open {
    overflow: hidden;
}

.duty-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
}

.duty-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
}

.duty-tab.is-active {
    background: var(--blue);
    color: #fff;
}

.duty-shift-block {
    margin-top: 16px;
}

.duty-shift-block h2 {
    letter-spacing: 0.04em;
}

.duty-shift-block .muted {
    margin: 4px 0 0;
}

.daily-inline-shift {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    min-width: 140px;
}

#duty-daily-bulk,
#duty-daily-add {
    align-items: flex-end;
}

#duty-daily-bulk .field,
#duty-daily-add .field {
    margin: 0;
    min-width: 180px;
}

.duty-apply-card .card-head {
    flex-wrap: wrap;
    gap: 12px;
}

.month-nav {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.month-field {
    margin: 0;
    min-width: 160px;
}

.duty-apply-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 12px;
}

.duty-apply-grid .field {
    margin: 0;
}

.duty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}

.duty-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.duty-grid-wrap {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.duty-grid {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
}

.duty-grid th,
.duty-grid td {
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    padding: 0;
    background: #fff;
}

.duty-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    padding: 8px 4px;
    font-size: 11px;
    color: var(--muted);
}

.duty-grid thead th span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.duty-grid .col-check,
.duty-grid .staff-col {
    position: sticky;
    background: #fff;
}

.duty-grid thead .col-check,
.duty-grid thead .staff-col {
    background: #f8fafc;
    z-index: 4;
}

.duty-grid .col-check {
    left: 0;
    width: 36px;
    z-index: 2;
}

.duty-grid .staff-col {
    left: 36px;
    min-width: 140px;
    text-align: left;
    padding: 8px 10px;
    z-index: 2;
    font-weight: 600;
}

.duty-grid .staff-col small {
    display: block;
    color: var(--muted);
    font-weight: 600;
    font-size: 11px;
}

.duty-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
}

button.duty-cell {
    border: 0;
    width: 36px;
    height: 36px;
    margin: 2px;
    background: transparent;
    cursor: pointer;
    color: inherit;
}

.duty-cell.code-M { background: #e8f1ff; color: #1d5fe0; }
.duty-cell.code-E { background: #e8f8ee; color: #15803d; }
.duty-cell.code-N { background: #f1e9ff; color: #6d28d9; }
.duty-cell.is-override { box-shadow: inset 0 -3px 0 #d97706; }
.duty-grid .is-weekend { background: #fbfcfe; }

.duty-popover {
    position: fixed;
    z-index: 80;
    width: min(300px, calc(100% - 24px));
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    padding: 16px;
}

.duty-popover[hidden] {
    display: none;
}

.att-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
}

.att-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.att-chip strong {
    color: var(--ink);
}

.att-chip-present { background: var(--green-soft); color: #166534; }
.att-chip-absent { background: var(--red-soft); color: #b91c1c; }
.att-chip-night-off { background: var(--night-off-soft); color: var(--night-off); }

.att-list {
    display: flex;
    flex-direction: column;
}

.att-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    align-items: center;
    gap: 12px 20px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.att-row:last-child {
    border-bottom: 0;
}

.att-name {
    font-size: 15px;
}

.att-status-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.att-btn {
    min-width: 108px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    background: #f8fafc;
    color: var(--muted);
}

.att-btn.att-present {
    background: var(--green-soft);
    color: #166534;
}

.att-btn.att-absent {
    background: var(--red-soft);
    color: #b91c1c;
}

.att-btn.att-night-off {
    background: var(--night-off-soft);
    color: var(--night-off);
}

.att-btn.att-present.is-active {
    background: var(--green);
    color: #fff;
}

.att-btn.att-absent.is-active {
    background: var(--red);
    color: #fff;
}

.att-btn.att-night-off.is-active {
    background: var(--night-off);
    color: #fff;
}

.att-row.is-saving {
    opacity: 0.65;
    pointer-events: none;
}

.att-empty {
    margin: 4px 0 0;
}

.att-shift-block h2 {
    font-size: 16px;
}

.att-register-filters {
    margin-top: 12px;
}

.att-register-grid .staff-col {
    left: 0;
}

.att-register-grid thead .staff-col {
    z-index: 5;
}

.att-register-grid .att-sum {
    position: sticky;
    min-width: 72px;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    background: #f8fafc;
    z-index: 2;
}

.att-register-grid thead .att-sum {
    top: 0;
    z-index: 5;
}

.att-register-grid .att-sum-night-off { right: 0; }
.att-register-grid .att-sum-absent { right: 72px; }
.att-register-grid .att-sum-present { right: 144px; }
.att-register-grid .att-sum-duty { right: 216px; }

.att-code-P { background: var(--green-soft); color: #166534; }
.att-code-A { background: var(--red-soft); color: #b91c1c; }
.att-code-NO { background: var(--night-off-soft); color: var(--night-off); }
.att-code-off { background: #f8fafc; color: var(--muted); }

.att-register-grid button.duty-cell {
    min-width: 36px;
    width: auto;
    padding: 0 4px;
}

.att-cell-pop .att-status-btns {
    justify-content: stretch;
}

.att-cell-pop .att-btn {
    flex: 1;
}

.att-history-from {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.att-history-change {
    padding: 8px 12px;
}

.att-history-table td {
    vertical-align: top;
}

.duty-popover-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.duty-popover-head p {
    margin: 4px 0 0;
}

.payroll-rule-note {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--violet-soft);
    color: #4c1d95;
    font-size: 14px;
}

.payroll-stats {
    margin: 8px 0 16px;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}

.payroll-wrap {
    overflow-x: auto;
}

.payroll-table {
    min-width: 1480px;
}

.payroll-table .staff-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    min-width: 140px;
}

.payroll-table thead .staff-col {
    z-index: 3;
}

.payroll-money {
    width: 92px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: right;
}

.payroll-row.is-locked .payroll-money {
    background: #f8fafc;
    color: var(--muted);
}

.payroll-payable {
    font-weight: 700;
    white-space: nowrap;
}

.payroll-status-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 128px;
}

.pay-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pay-status-draft {
    background: #f1f5f9;
    color: #475569;
}

.pay-status-reviewed {
    background: var(--amber-soft);
    color: #92400e;
}

.pay-status-approved {
    background: var(--blue-soft);
    color: #1d4ed8;
}

.pay-status-paid {
    background: var(--green-soft);
    color: #166534;
}

.btn-small {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.salary-rules-form {
    max-width: 560px;
}

.salary-rules-form .field small {
    display: block;
    margin-top: 6px;
}

.payroll-adj-cell {
    background: none;
    border: 0;
    padding: 0;
    color: var(--blue);
    font-weight: 700;
    cursor: pointer;
}

.pay-adj-modal .pay-adj-panel {
    right: auto;
    left: 50%;
    top: 8vh;
    transform: translateX(-50%);
    height: auto;
    max-height: 84vh;
    width: min(420px, calc(100% - 32px));
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.pay-preview {
    background: var(--blue-soft);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 8px 0 12px;
    display: grid;
    gap: 8px;
}

.pay-preview div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.pay-preview-total {
    border-top: 1px solid #c9dcff;
    padding-top: 8px;
    font-weight: 700;
}

.report-print-head {
    display: none;
}

.report-duty-grid .staff-col {
    left: 0;
}

.report-totals td {
    font-weight: 700;
    background: #f8fafc;
}

.report-summary {
    margin-top: 8px;
}

.report-grid-wrap {
    margin-top: 12px;
}

@media print {
    .sidebar,
    .sidebar-backdrop,
    .topbar,
    .app-footer,
    .duty-tabs,
    .report-toolbar,
    .report-export,
    .no-print,
    .flash,
    .icon-btn.menu-toggle,
    #app-modal-root,
    .modal-backdrop {
        display: none !important;
    }

    body,
    .app-shell,
    .app-main,
    .content {
        background: #fff;
        min-height: 0;
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
        box-shadow: none;
    }

    .page-heading {
        display: none;
    }

    .report-print-head {
        display: block;
        margin: 0 0 16px;
    }

    .report-print-head h2 {
        margin: 4px 0;
        font-size: 20px;
    }

    .report-print-head p {
        margin: 0;
        color: #334155;
    }

    .card {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .duty-grid-wrap,
    .table-wrap,
    .payroll-wrap {
        overflow: visible;
        max-height: none;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
        font-size: 11px;
        padding: 6px 5px;
        border-bottom: 1px solid #cbd5e1;
    }

    .duty-grid .staff-col,
    .payroll-table .staff-col {
        position: static;
    }

    body.report-wide {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

@page {
    margin: 12mm;
}
