:root {
    --tblr-font-sans-serif: "Segoe UI", Tahoma, Arial, sans-serif;
    --tblr-body-font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    --brand: #1c2a78;
    --brand-dark: #111a55;
    --brand-soft: #eef0fb;
    --accent: #f2cf00;
    --ink: #17221b;
    --muted: #647069;
    --line: #dfe5e1;
    --surface: #ffffff;
    --background: #f4f7f5;
    --danger: #c43535;
    --danger-soft: #fff0f0;
    --shadow: 0 1px 2px rgba(16, 24, 19, .03), 0 12px 32px rgba(17, 49, 31, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--background);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 92px; display: flex; align-items: center; gap: 17px; }
.header-inner > div:last-child { min-width: 0; }
.logo-slot { width: 48px; height: 48px; flex: 0 0 48px; border: 1.5px dashed #b8c3bc; border-radius: 11px; background: #fafcfb; }
.logo-slot img { width: 100%; height: 100%; padding: 4px; display: block; object-fit: contain; border-radius: 9px; }
.logo-slot.has-logo { width: 152px; height: 50px; flex-basis: 152px; border: 0; border-radius: 0; background: transparent; }
.logo-slot.has-logo img { padding: 0; border-radius: 0; }
.site-header h1 { margin: 2px 0 1px; font-size: clamp(18px, 2vw, 23px); line-height: 1.25; letter-spacing: -.025em; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0; color: var(--brand); font-size: 12px; line-height: 1.3; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.page-content { padding-top: 32px; padding-bottom: 58px; }

.intro { padding: 12px 4px 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.intro h2 { margin: 14px 0 5px; font-size: clamp(24px, 3.2vw, 36px); letter-spacing: -.045em; line-height: 1.16; }
.intro p { margin: 0; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #c9e9d4; border-radius: 99px; color: var(--brand-dark); background: #f0faf4; font-size: 12px; font-weight: 750; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(34, 197, 94, .13); }
.sequence { color: var(--muted); display: flex; align-items: center; gap: 9px; font-size: 12px; white-space: nowrap; }
.sequence b { color: #a3afa8; }
.ui-arrow-icon { display: block; flex: 0 0 auto; width: 19px; height: 19px; overflow: visible; }
.button-with-arrow { display: inline-flex; align-items: center; gap: 6px; }
.arrow-button { display: inline-flex; width: 40px; min-width: 40px; height: 38px; padding: 0; align-items: center; justify-content: center; border-radius: 8px; }
.arrow-button .ui-arrow-icon { width: 21px; height: 21px; }
.sequence .ui-arrow-icon { width: 18px; height: 18px; }

.alert { margin-bottom: 20px; border-radius: 14px; padding: 15px 17px; display: flex; align-items: flex-start; gap: 12px; }
.alert h2 { margin: 0 0 5px; font-size: 14px; }
.alert ul { margin: 3px 0 0; padding-left: 20px; font-size: 13px; }
.alert-error { border: 1px solid #f1c6c6; background: var(--danger-soft); color: #7a2525; }
.alert-icon { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--danger); font-weight: 800; }
.alert-success { align-items: center; border: 1px solid #bfe4cc; background: #effaf3; color: #185c33; font-size: 13px; }
.success-mark { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-size: 13px; font-weight: 900; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr); align-items: stretch; gap: 20px; }
.import-panel { margin-bottom: 20px; padding: 21px 23px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 410px); align-items: center; gap: 20px; border: 1px solid #cddfd4; border-radius: 17px; background: #f9fcfa; box-shadow: var(--shadow); }
.import-copy { display: flex; align-items: flex-start; gap: 13px; }
.import-copy h2 { margin: 4px 0 4px; font-size: 18px; letter-spacing: -.02em; }
.import-copy p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.import-actions { display: flex; align-items: stretch; gap: 8px; }
.template-button { padding: 0 12px; display: flex; align-items: center; justify-content: center; border: 1px solid #b9cfc1; border-radius: 10px; color: var(--brand-dark); background: #fff; font-size: 12px; font-weight: 800; text-align: center; text-decoration: none; }
.template-button:hover { border-color: var(--brand); }
.file-drop { min-width: 200px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px dashed #92b49f; border-radius: 10px; background: #fff; cursor: pointer; }
.file-drop:hover { border-color: var(--brand); background: #f5fbf7; }
.file-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.file-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 900; }
.file-drop strong, .file-drop small { display: block; max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop strong { color: #34413a; font-size: 12px; }
.file-drop small { margin-top: 2px; color: #8c9690; font-size: 12px; }
.import-rule { grid-column: 1 / -1; margin: -5px 0 0 45px; color: #738078; font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 24px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid #edf0ee; }
.panel-heading.small { margin-bottom: 12px; }
.panel-heading h2 { margin: 0 0 3px; font-size: 17px; line-height: 1.35; letter-spacing: -.015em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.step-number { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 12px; font-weight: 850; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 15px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.two-columns { grid-template-columns: 1fr 1fr; }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-two { grid-column: span 2; }
.field { display: block; min-width: 0; }
.field > span { display: block; margin-bottom: 7px; color: #34413a; font-size: 12px; font-weight: 700; }
.field-note { margin-left: 4px; color: var(--brand); font-size: 12px; font-weight: 750; }
.field em { color: #d64141; font-style: normal; }
.input-help { display: block; margin-top: 6px; color: #89948d; font-size: 12px; }
.field input {
    width: 100%; height: 45px; outline: none; border: 1px solid #d8dfdb; border-radius: 10px; padding: 0 12px; color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s;
}
.field input::placeholder { color: #a7b0aa; }
.field input:hover { border-color: #b9c5bd; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28, 42, 120, .1); }
.money-input, .suffix-input { display: flex; align-items: center; border: 1px solid #d8dfdb; border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.money-input:focus-within, .suffix-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28, 42, 120, .1); }
.money-input b { padding-left: 13px; color: var(--brand); font-size: 13px; }
.money-input input, .suffix-input input { border: 0; box-shadow: none !important; border-radius: 0; }
.money-input input { padding-left: 7px; font-weight: 750; letter-spacing: .02em; }
.suffix-input b { padding-right: 13px; color: #8a968f; font-size: 12px; }
.suffix-input.readonly { background: #f6f8f7; }
.suffix-input.readonly input { color: #66726b; background: transparent; }
.settings-block + .settings-block { padding-top: 18px; margin-top: 20px; border-top: 1px solid #edf0ee; }
.settings-block h3 { margin: 0 0 11px; color: #34413a; font-size: 12px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 16px; }
.preset-button { min-height: 38px; border: 1px solid #dae1dc; border-radius: 9px; color: #59655e; background: #fff; font-size: 12px; font-weight: 750; transition: .18s ease; }
.preset-button:hover { border-color: #8bc5a2; color: var(--brand); }
.preset-button.active { border-color: var(--brand); color: #fff; background: var(--brand); }
.percentage-total { margin-top: 12px; padding: 9px 12px; display: flex; justify-content: space-between; border-radius: 9px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; }
.percentage-total strong { font-size: 12px; }
.calculate-button { width: min(330px, 100%); min-height: 50px; margin: 20px auto 0; display: flex; align-items: center; justify-content: center; gap: 30px; border-radius: 11px; }
.calculate-button .ui-arrow-icon { width: 23px; height: 23px; }
.primary-button { border: 1px solid var(--brand); color: #fff; background: var(--brand); font-weight: 750; transition: background .18s, transform .18s; }
.primary-button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.primary-button:active { transform: translateY(1px); }

.result-section { padding-top: 55px; scroll-margin-top: 16px; }
.import-result { margin-top: 45px; box-shadow: none; }
.import-result + .result-section { padding-top: 31px; }
.import-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.import-result-heading h2 { margin: 4px 0 1px; font-size: 19px; }
.import-result-heading span { color: var(--muted); font-size: 12px; }
.import-result-heading > strong { padding: 6px 10px; border-radius: 99px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; }
.import-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid #e1e6e3; border-radius: 10px; background: #e1e6e3; }
.import-metrics div { padding: 12px 13px; background: #fafcfb; }
.import-metrics span { display: block; min-height: 28px; color: var(--muted); font-size: 12px; }
.import-metrics strong { display: block; font-size: 14px; }
.customer-preview { margin-top: 14px; border-top: 1px solid #e7ebe8; }
.customer-preview summary { padding: 12px 2px 0; color: var(--brand-dark); font-size: 12px; font-weight: 750; cursor: pointer; }
.customer-preview summary span { margin-left: 5px; color: #8d9791; font-size: 12px; font-weight: 500; }
.customer-preview .table-scroll { margin-top: 12px; }
.customer-preview table { min-width: 1180px; font-size: 12px; }
.customer-preview td { padding: 9px 10px; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 0 2px 17px; }
.section-title-row h2 { margin: 5px 0 0; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
.period-badge, .customer-count { padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: white; font-size: 12px; font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 13px; }
.summary-card { grid-column: span 2; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.summary-card:nth-child(1), .summary-card:nth-child(2) { grid-column: span 3; }
.summary-card p { margin: 0 0 9px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.summary-card strong { display: block; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; font-size: clamp(19px, 2.5vw, 27px); line-height: 1.15; letter-spacing: -.04em; }
.summary-card span { color: #859088; font-size: 12px; }
.summary-card.deduction { background: #fffafa; }
.summary-card.deduction strong { color: #a33c3c; }
.summary-card.net { border-color: #add8be; background: var(--brand-soft); }
.summary-card.net strong { color: var(--brand-dark); }
.summary-card.reseller { border-top: 3px solid var(--accent); }
.summary-card.provider { border-top: 3px solid var(--brand-dark); }

.settlement-card { margin-top: 20px; padding: 23px 25px; border: 1px solid #b9d9c5; border-left: 4px solid var(--brand); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.settlement-card.reseller_to_provider { border-color: #e4c78b; border-left-color: #d79518; }
.settlement-card.provider_to_reseller { border-color: #a9d4ba; border-left-color: var(--brand); }
.settlement-card.settled { border-color: #b9d9c5; border-left-color: var(--accent); }
.settlement-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.settlement-heading h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.025em; }
.settlement-status { padding: 6px 10px; border-radius: 99px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; font-weight: 800; }
.reseller_to_provider .settlement-status { color: #744d08; background: #fff4db; }
.settlement-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid #e2e7e4; border-radius: 10px; background: #e2e7e4; }
.settlement-values div { padding: 13px 15px; background: #fff; }
.settlement-values span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.settlement-values strong { font-size: 17px; letter-spacing: -.025em; }
.settlement-conclusion { display: flex; align-items: center; gap: 12px; margin-top: 15px; padding: 12px 14px; border-radius: 10px; color: #27583a; background: #f0f8f3; }
.reseller_to_provider .settlement-conclusion { color: #704d10; background: #fff8e9; }
.settlement-conclusion > span { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-weight: 900; }
.reseller_to_provider .settlement-conclusion > span { background: #cc8a15; }
.settlement-conclusion p { margin: 0; font-size: 12px; }
.settlement-note { margin: 10px 2px 0; color: #8a948e; font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 20px; margin-top: 20px; }
.result-panel { box-shadow: none; }
.deduction-list { margin: 0; }
.deduction-list > div { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 3px; border-bottom: 1px solid #edf0ee; }
.deduction-list dt { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; }
.deduction-list dt small { padding: 2px 6px; border-radius: 5px; color: #8b5555; background: #fff0f0; font-size: 12px; }
.deduction-list dd { margin: 0; font-weight: 750; font-size: 13px; }
.deduction-list .total { padding-top: 15px; border: 0; color: var(--brand-dark); }
.flow-card { padding: 27px; border-radius: 17px; color: #fff; background: #151f5c; box-shadow: var(--shadow); }
.flow-card .eyebrow { color: #f5d824; }
.flow-card h2 { margin: 8px 0 19px; font-size: 23px; letter-spacing: -.03em; }
.flow-card > p:last-child { margin: 18px 0 0; color: #c1d4c8; font-size: 12px; }
.flow-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.flow-steps span { padding: 6px 8px; border: 1px solid rgba(255,255,255,.2); border-radius: 7px; background: rgba(255,255,255,.07); font-size: 12px; font-weight: 700; }
.flow-steps i { color: #f5d824; font-style: normal; }
.flow-steps i .ui-arrow-icon { width: 18px; height: 18px; }
.table-panel { margin-top: 20px; box-shadow: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 14px; color: #5e6a63; background: #f4f7f5; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
th:nth-child(n+2), td:nth-child(n+2) { text-align: right; }
td { padding: 12px 14px; border-bottom: 1px solid #edf0ee; }
td:last-child { font-weight: 700; }
.table-note { display: block; margin-top: 2px; color: #869189; font-size: 12px; font-weight: 500; }
.negative { color: #a44242; }
.sub-total td { color: #536059; background: #fafbfa; font-weight: 700; }
.net-row td { color: var(--brand-dark); background: var(--brand-soft); font-weight: 800; }

.customer-stats { margin-top: 31px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stats-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.stats-grid p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.stats-grid strong { display: block; font-size: 17px; letter-spacing: -.025em; }
.stats-grid span { color: #9aa39d; font-size: 12px; }
.action-bar { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.action-bar form { margin: 0; }
.action-right { display: flex; gap: 9px; }
.button { min-height: 43px; padding: 0 18px; border-radius: 10px; font-size: 12px; font-weight: 750; }
.button.secondary { border: 1px solid #d4dcd7; color: #4b5850; background: #fff; }
.button.secondary:hover { border-color: #9eaaa3; }
.danger-hover:hover { border-color: #dd9c9c !important; color: var(--danger) !important; }
.site-footer { padding: 20px 0; border-top: 1px solid var(--line); color: #8b958f; background: #fff; font-size: 12px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; }
.print-report { display: none; }

/* Login, navigation, recap, and access management */
.page-brand-copy { min-width: 180px; }
.app-nav { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.app-nav > a, .app-nav > form button { min-height: 36px; padding: 0 10px; display: inline-flex; align-items: center; border: 0; border-radius: 8px; color: #526058; background: transparent; font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.app-nav > a:hover, .app-nav > a.active { color: var(--brand-dark); background: var(--brand-soft); }
.app-nav > form { margin: 0; }
.app-nav > form button { color: #8b3535; background: #fff4f4; }
.user-chip { min-width: 94px; padding: 3px 10px; border-left: 1px solid var(--line); line-height: 1.25; }
.user-chip b, .user-chip small { display: block; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip b { color: #2c3931; font-size: 12px; }
.user-chip small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.auth-body { min-height: 100vh; padding: 32px 18px; display: grid; place-items: center; background: radial-gradient(circle at top, #e7f6ec, var(--background) 48%); }
.auth-card { width: min(100%, 470px); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(17, 49, 31, .12); }
.auth-brand { margin-bottom: 24px; text-align: center; }
.auth-brand img { width: min(230px, 72%); max-height: 72px; object-fit: contain; }
.auth-brand p { margin: 18px 0 3px; color: var(--brand); font-size: 12px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.auth-brand h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.auth-brand span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.auth-form { display: grid; gap: 15px; }
.auth-submit { min-height: 47px; margin-top: 5px; border-radius: 10px; }
.auth-note { margin: 19px 0 0; color: #89948d; font-size: 12px; text-align: center; }

.admin-page { min-height: calc(100vh - 165px); padding-top: 34px; padding-bottom: 54px; }
.narrow-page { width: min(860px, calc(100% - 40px)); }
.admin-title { margin-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.admin-title h2 { margin: 6px 0 2px; font-size: 25px; letter-spacing: -.035em; }
.admin-title p { margin: 0; color: var(--muted); font-size: 12px; }
.admin-title .action-right { align-items: center; }
.admin-title .action-right form { margin: 0; }
.back-link { display: inline-block; margin-bottom: 7px; color: var(--brand-dark); font-size: 12px; font-weight: 750; text-decoration: none; }
.admin-panel { margin-top: 18px; }
.admin-panel > h3 { margin: 0 0 16px; font-size: 16px; }
.admin-panel .admin-title { margin-bottom: 17px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d4dcd7; color: #4b5850; background: #fff; text-decoration: none; white-space: nowrap; }
.button-primary, .button.primary-button { border-color: var(--brand); color: #fff; background: var(--brand); }
.button-primary:hover, .button.primary-button:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.button-small { min-height: 32px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.button-danger { border-color: #efc1c1; color: #9a3030; background: #fff5f5; }
.save-button { min-width: 150px; }
.month-strip { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.month-summary { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: #fff; text-decoration: none; transition: border-color .18s, transform .18s; }
.month-summary:hover, .month-summary.active { border-color: #8cc5a1; transform: translateY(-1px); }
.month-summary.active { background: var(--brand-soft); }
.month-summary span, .month-summary strong, .month-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-summary span { color: var(--muted); font-size: 12px; }
.month-summary strong { margin: 3px 0; color: var(--brand-dark); font-size: 15px; }
.month-summary small { color: #87928b; font-size: 12px; }
.filter-bar { margin-bottom: 20px; display: grid; grid-template-columns: 155px minmax(220px, 1fr) auto auto; align-items: end; gap: 10px; }
.filter-bar label { min-width: 0; }
.filter-bar label > span, .record-form label > span { display: block; margin-bottom: 6px; color: #34413a; font-size: 12px; font-weight: 700; }
.filter-bar input, .filter-bar select, .record-form input, .record-form select { width: 100%; height: 43px; outline: 0; border: 1px solid #d8dfdb; border-radius: 9px; padding: 0 11px; color: var(--ink); background: #fff; }
.filter-bar input:focus, .filter-bar select:focus, .record-form input:focus, .record-form select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,42,120,.1); }
.employee-filter { grid-template-columns: minmax(260px, 1fr) 180px auto auto; }
.employee-table { min-width: 1050px; }
.table-wrap { overflow-x: auto; }
.admin-table { min-width: 940px; }
.admin-table td { vertical-align: middle; }
.admin-table td > small, .admin-table td > strong { display: block; }
.admin-table td > small { margin-top: 2px; color: #87928b; font-size: 12px; font-weight: 500; }
.admin-table th:nth-child(n+2), .admin-table td:nth-child(n+2) { text-align: left; }
.admin-table .money-strong { color: var(--brand-dark); font-weight: 800; }
.empty-cell { padding: 34px !important; color: var(--muted); text-align: center !important; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.row-actions a, .row-actions button { min-height: 28px; padding: 0 7px; display: inline-flex; align-items: center; border: 0; border-radius: 6px; color: var(--brand-dark); background: #f1f3fb; font-size: 12px; font-weight: 750; text-decoration: none; }
.row-actions form { margin: 0; }
.row-actions form button { color: #9a3030; background: #fff1f1; }
.self-label { color: #87928b; font-size: 12px; white-space: nowrap; }
.pagination { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 5px; }
.pagination a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-size: 12px; text-decoration: none; }
.pagination a.active { border-color: var(--brand); color: #fff; background: var(--brand); }
.record-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.record-summary article { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.record-summary article.net { border-color: #add8be; background: var(--brand-soft); }
.record-summary span, .record-summary strong { display: block; }
.record-summary span { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.record-summary strong { overflow: hidden; color: #223029; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.record-summary .net strong { color: var(--brand-dark); }
.record-details { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid #e1e6e3; border-radius: 10px; background: #e1e6e3; }
.record-details > div { padding: 13px; background: #fff; }
.record-details dt { color: var(--muted); font-size: 12px; }
.record-details dd { margin: 4px 0 0; font-size: 14px; font-weight: 800; }
.record-details .attention { border: 1px solid #d7aa24; color: #5b4200; background: #fff1a8; }
.record-details .attention dt { color: #725300; font-weight: 800; }
.panel-inline-title { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-inline-title h3 { margin: 0; font-size: 16px; }
.panel-inline-title span { color: var(--muted); font-size: 12px; }
.customer-record-table { min-width: 1180px; font-size: 12px; }
.record-form { margin-top: 0; }
.record-form small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.record-form .form-actions { margin-top: 22px; padding-top: 18px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.check-field { margin-top: 18px; display: flex; align-items: center; gap: 9px; }
.check-field input { width: 17px; height: 17px; }
.check-field span { margin: 0 !important; }
.role-badge, .status-badge { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 12px; font-weight: 850; letter-spacing: .04em; }
.role-admin { color: #68480a; background: #fff0c8; }
.role-user { color: var(--brand-dark); background: var(--brand-soft); }
.status-badge.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.status-badge.is-inactive { color: #7d4646; background: #f8eaea; }

@media (max-width: 900px) {
    .header-inner { padding: 14px 0; flex-wrap: wrap; }
    .page-brand-copy { flex: 1; }
    .app-nav { width: 100%; justify-content: flex-start; overflow-x: auto; }
    .month-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .record-summary { grid-template-columns: 1fr 1fr; }
    .import-panel { grid-template-columns: 1fr; }
    .import-rule { margin-left: 45px; }
    .import-metrics { grid-template-columns: 1fr 1fr; }
    .form-layout, .detail-grid { grid-template-columns: 1fr; }
    .intro { align-items: flex-start; flex-direction: column; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-card, .summary-card:nth-child(1), .summary-card:nth-child(2) { grid-column: span 1; }
    .summary-card:last-child { grid-column: span 2; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
    .container { width: min(100% - 24px, 1180px); }
    .header-inner { min-height: 82px; }
    .page-brand-copy { min-width: calc(100% - 125px); }
    .app-nav > a, .app-nav > form button { padding: 0 8px; font-size: 12px; }
    .user-chip { order: 5; }
    .auth-card { padding: 24px 19px; }
    .admin-page { padding-top: 24px; }
    .narrow-page { width: min(100% - 24px, 860px); }
    .admin-title { align-items: stretch; flex-direction: column; }
    .admin-title > .button { width: 100%; }
    .month-strip, .filter-bar, .record-summary, .record-details { grid-template-columns: 1fr; }
    .filter-bar .button { width: 100%; }
    .record-form .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .record-form .form-actions .button { width: 100%; }
    .logo-slot { width: 42px; height: 42px; flex-basis: 42px; }
    .logo-slot.has-logo { width: 105px; height: 38px; flex-basis: 105px; }
    .site-header h1 { font-size: 17px; }
    .subtitle { display: none; }
    .page-content { padding-top: 21px; }
    .intro { padding-bottom: 20px; }
    .intro h2 { font-size: 26px; }
    .compact-sequence { width: 100%; overflow-x: auto; padding-bottom: 4px; }
    .panel { padding: 18px 16px; border-radius: 14px; }
    .import-panel { padding: 18px 15px; }
    .import-actions { flex-direction: column; }
    .template-button { min-height: 42px; }
    .file-drop { min-width: 0; }
    .import-rule { margin: -4px 0 0; }
    .form-grid, .form-grid.two-columns, .form-grid.three-columns { grid-template-columns: 1fr; }
    .form-grid .span-two { grid-column: auto; }
    .presets { grid-template-columns: 1fr 1fr; }
    .percentage-fields { grid-template-columns: 1fr 1fr !important; }
    .result-section { padding-top: 42px; }
    .section-title-row { align-items: flex-start; flex-direction: column; gap: 9px; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-card, .summary-card:nth-child(1), .summary-card:nth-child(2), .summary-card:last-child { grid-column: auto; }
    .summary-card strong { font-size: 24px; }
    .settlement-card { padding: 19px 16px; }
    .settlement-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
    .settlement-values { grid-template-columns: 1fr; }
    .flow-card { padding: 22px 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stats-grid article { padding: 14px 12px; }
    .stats-grid strong { font-size: 14px; }
    .action-bar { align-items: stretch; flex-direction: column-reverse; }
    .action-bar > form, .action-bar > form .button, .action-right, .action-right form { width: 100%; }
    .action-right .button { width: 100%; }
    .site-footer .container { flex-direction: column; gap: 4px; }
}

/* Tabler integration for the PHP application */
.tabler-auth {
    min-height: 100vh;
    color: #17213b;
    background:
        radial-gradient(circle at 14% 12%, rgba(242, 207, 0, .10), transparent 23rem),
        radial-gradient(circle at 88% 86%, rgba(28, 42, 120, .09), transparent 25rem),
        #f6f8fc !important;
}
.login-page { width: 100%; min-height: 100vh; padding: 38px 20px; display: grid; grid-template-columns: minmax(0, 420px); place-content: center; }
.login-shell { width: 100%; min-width: 0; }
.login-brand { height: 138px; margin-bottom: 24px; display: flex; align-items: center; justify-content: center; }
.login-brand img { width: 200px; height: 160px; display: block; object-fit: contain; transform: translateY(-8px); }
.login-card { width: 100%; min-width: 0; padding: 31px 32px 0; overflow: hidden; border: 1px solid #e1e5ee; border-radius: 16px; background: #fff; box-shadow: 0 22px 55px rgba(24, 36, 68, .14), 0 3px 10px rgba(24, 36, 68, .06); }
.login-card-header { margin-bottom: 24px; }
.login-access-badge { width: max-content; margin-bottom: 15px; padding: 6px 9px; display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; color: #1c2a78; background: #eef0fb; font-size: 12px; line-height: 1; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.login-access-badge svg { width: 14px; height: 14px; }
.login-card h1 { margin: 0 0 7px; color: #17213b; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.login-card-header p { margin: 0; color: #6d778b; font-size: 13px; line-height: 1.55; }
.login-alert { margin: -5px 0 20px; padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid; border-radius: 9px; font-size: 12px; line-height: 1.45; }
.login-alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.login-alert-success { color: #176238; border-color: #cce9d7; background: #f0faf4; }
.login-alert-warning { color: #775700; border-color: #ead99a; background: #fff9e8; }
.login-alert-danger { color: #8c3030; border-color: #f0cece; background: #fff4f4; }
.login-form { display: grid; gap: 17px; }
.login-field label { margin-bottom: 7px; display: block; color: #30394c; font-size: 12px; font-weight: 700; }
.login-control { min-height: 49px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #dfe3eb; border-radius: 9px; background: #f8f9fc; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.login-control:focus-within { border-color: #5c68ac; background: #fff; box-shadow: 0 0 0 3px rgba(28, 42, 120, .10); }
.login-control > svg { width: 18px; height: 18px; flex: 0 0 18px; color: #8791a5; }
.login-control input { width: 0; min-width: 0; height: 47px; padding: 0; flex: 1 1 auto; border: 0; outline: 0; color: #17213b; background: transparent; font-size: 13px; }
.login-control input::placeholder { color: #a0a8b7; opacity: 1; }
.login-password-control input { padding-right: 3px; }
.login-password-toggle { padding: 5px 2px; border: 0; color: #1c2a78; background: transparent; font-size: 12px; font-weight: 700; }
.login-password-toggle:hover, .login-password-toggle:focus-visible { color: #111a55; text-decoration: underline; }
.login-submit { min-height: 49px; margin-top: 3px; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 9px; color: #fff; background: #1c2a78; box-shadow: 0 7px 16px rgba(28, 42, 120, .20); font-size: 13px; font-weight: 750; transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
.login-submit svg { width: 17px; height: 17px; transition: transform .18s ease; }
.login-submit:hover { background: #111a55; box-shadow: 0 9px 19px rgba(28, 42, 120, .26); }
.login-submit:hover svg { transform: translateX(2px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:focus-visible { outline: 3px solid rgba(28, 42, 120, .22); outline-offset: 2px; }
.login-card-footer { margin: 27px -32px 0; padding: 14px 25px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #7b8495; border-top: 1px solid #edf0f4; background: #fafbfc; font-size: 12px; text-align: center; }
.login-card-footer svg { width: 15px; height: 15px; flex: 0 0 15px; color: #1c2a78; }
.login-copyright { margin: 18px 0 0; color: #8992a2; font-size: 12px; text-align: center; }

/* One-time welcome shown immediately after a successful login */
.welcome-overlay { position: fixed; inset: 0; z-index: 1085; padding: 22px; display: grid; place-items: center; background: rgba(15, 23, 42, .46); backdrop-filter: blur(3px); animation: welcome-fade-in .22s ease both; }
.welcome-dialog { position: relative; width: min(100%, 405px); padding: 34px 31px 28px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .72); border-radius: 17px; background: #fff; box-shadow: 0 28px 75px rgba(9, 15, 43, .28); text-align: center; animation: welcome-rise-in .32s cubic-bezier(.2,.8,.2,1) both; }
.welcome-close { position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; color: #8a93a5; background: transparent; }
.welcome-close:hover { color: #1c2a78; background: #f1f3f9; }
.welcome-close:focus-visible, .welcome-action:focus-visible { outline: 3px solid rgba(28, 42, 120, .18); outline-offset: 2px; }
.welcome-close svg { width: 18px; height: 18px; }
.welcome-icon { width: 62px; height: 62px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #1c2a78, #3446a3); box-shadow: 0 10px 25px rgba(28, 42, 120, .23), 0 0 0 8px #f0f2fc; }
.welcome-icon svg { width: 29px; height: 29px; }
.welcome-kicker { display: block; color: #1c2a78; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.welcome-dialog h2 { margin: 7px 0 8px; color: #17213b; font-size: 24px; line-height: 1.25; letter-spacing: -.035em; }
.welcome-dialog p { max-width: 315px; margin: 0 auto; color: #707a8d; font-size: 12px; line-height: 1.6; }
.welcome-role { width: max-content; margin: 15px auto 20px; padding: 5px 10px; display: block; border-radius: 99px; color: #766400; background: #fff8cc; font-size: 12px; font-weight: 750; }
.welcome-action { width: 100%; min-height: 45px; border: 0; border-radius: 9px; color: #fff; background: #1c2a78; font-size: 12px; font-weight: 750; }
.welcome-action:hover { background: #111a55; }
.welcome-timer { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; overflow: hidden; background: #edf0f5; }
.welcome-timer span { width: 100%; height: 100%; display: block; background: #f2cf00; transform-origin: left; animation: welcome-countdown 5.2s linear both; }
.welcome-overlay.is-closing { animation: welcome-fade-out .2s ease both; }
.welcome-overlay.is-closing .welcome-dialog { animation: welcome-scale-out .2s ease both; }
@keyframes welcome-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes welcome-rise-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes welcome-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes welcome-scale-out { from { transform: scale(1); } to { transform: scale(.98); } }
@keyframes welcome-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
    .welcome-overlay, .welcome-dialog, .welcome-timer span, .welcome-overlay.is-closing, .welcome-overlay.is-closing .welcome-dialog { animation: none; }
}

.app-page { min-height: 100vh; background: #f6f8fb; }
.app-page .page-wrapper { min-width: 0; min-height: 100vh; }
.app-sidebar { border-right: 1px solid #e6e9ef; background: #fff; }
.app-sidebar > .container-fluid { min-height: 100%; }
.app-brand { min-height: 132px; margin: 0; padding: 7px 12px; display: flex; align-items: center; justify-content: center; }
.app-brand img { width: 118px; height: 118px; object-fit: contain; }
.app-sidebar .navbar-collapse { flex: 1; align-items: stretch; }
.app-sidebar .navbar-nav { width: 100%; gap: 4px; }
.app-nav-section { margin: 12px 12px 2px; color: #8a94a3; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.app-sidebar .nav-link { min-height: 44px; border-radius: 8px; color: #4b5563; font-weight: 600; }
.app-sidebar .nav-item.active .nav-link { color: #1c2a78; background: #eef0fb; }
.app-sidebar .nav-link-icon svg { width: 20px; height: 20px; }
.app-mobile-logout form, .app-mobile-logout button { width: 100%; }
.app-mobile-logout button { border: 0; color: #d63939 !important; background: transparent; text-align: left; }
.app-mobile-logout button:hover { background: #fff0f0; }
.app-sidebar-note { margin: auto 8px 16px; padding: 15px; border: 1px solid #e6e9ef; border-radius: 10px; background: #f8fafc; }
.app-sidebar-note strong, .app-sidebar-note small { display: block; }
.app-sidebar-note strong { margin-top: 8px; color: #182433; font-size: 12px; }
.app-sidebar-note small { margin-top: 4px; color: #667382; font-size: 12px; line-height: 1.45; }
.app-sidebar-user { width: 100%; padding: 14px 18px; align-items: center; gap: 10px; border-top: 1px solid #e6e9ef; }
.app-sidebar-user strong, .app-sidebar-user small { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar-user strong { color: #182433; font-size: 12px; }
.app-sidebar-user small { color: #667382; font-size: 12px; }
.app-page-header > .container-xl, .app-page .footer > .container-xl { width: 100%; max-width: none; padding-right: 2rem; padding-left: 2rem; }
.app-page-header { display: none; margin: 0; padding: 1rem 0; border-bottom: 1px solid #e6e9ef; background: #fff; }
.app-page-header .page-title { color: #182433; font-size: 22px; }
.app-page-header .row { flex-wrap: nowrap; }
.app-page-header .col { min-width: 0; }
.app-page-header .page-title, .app-page-header .text-secondary { overflow-wrap: anywhere; }
.app-page-actions { display: flex; align-items: center; gap: 10px; }
.app-page-actions form { margin: 0; }
.app-page-user { display: flex; align-items: center; gap: 9px; padding-right: 10px; border-right: 1px solid #e6e9ef; }
.app-page-user strong, .app-page-user small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-page-user strong { color: #182433; font-size: 12px; }
.app-page-user small { color: #667382; font-size: 12px; }
.app-page .page-wrapper > main.container { width: auto; max-width: none; margin: 0; padding: 1rem 2rem 3rem; }
.app-page .page-wrapper > main.admin-page { min-height: auto; padding-top: 1rem; }
.app-page .intro { padding-top: 0; }
.app-page .intro, .app-page .import-panel, .app-page .import-copy, .app-page .import-copy > div, .app-page .import-actions, .app-page .form-layout { min-width: 0; }
.app-page .panel, .app-page .admin-panel, .app-page .summary-card, .app-page .settlement-card, .app-page .record-summary article, .app-page .stats-grid article { border-color: #e6e9ef; border-radius: 10px; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.app-page .panel { padding: 1.5rem; }
.app-page .primary-button, .app-page .button-primary, .app-page .button.primary-button { border-color: #1c2a78; background: #1c2a78; }
.app-page .primary-button:hover, .app-page .button-primary:hover, .app-page .button.primary-button:hover { border-color: #111a55; background: #111a55; }
.app-page .eyebrow { color: #1c2a78; }
.app-page input:focus, .app-page select:focus { border-color: #7580bd; box-shadow: 0 0 0 3px rgba(28,42,120,.12); }
.app-page .month-summary.active { border-color: #aeb5da; background: #eef0fb; }
.app-page .month-summary.active strong { color: #1c2a78; }
.app-page .footer { margin-top: auto; }

/* Administration dashboard */
.dashboard-page { display: grid; gap: 20px; }
.dashboard-welcome { padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid #dfe3f3; border-radius: 12px; background: linear-gradient(135deg, #fff 0%, #f1f3fc 100%); }
.dashboard-welcome h2 { margin: 5px 0 6px; color: #182433; font-size: 27px; letter-spacing: -.035em; }
.dashboard-welcome p:last-child { margin: 0; color: #667382; }
.dashboard-period { min-width: 190px; padding: 13px 16px; border-left: 4px solid var(--accent); border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(24,36,51,.06); }
.dashboard-period span, .dashboard-period strong { display: block; }
.dashboard-period span { color: #778392; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.dashboard-period strong { margin-top: 3px; color: var(--brand); font-size: 17px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.dashboard-stats article { min-width: 0; padding: 19px; display: flex; align-items: center; gap: 14px; border: 1px solid #e3e7ef; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.dashboard-stat-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 10px; }
.dashboard-stat-icon svg { width: 23px; height: 23px; }
.dashboard-stat-icon.blue { color: var(--brand); background: var(--brand-soft); }
.dashboard-stat-icon.yellow { color: #725e00; background: #fff7c8; }
.dashboard-stats article > div { min-width: 0; }
.dashboard-stats small, .dashboard-stats strong, .dashboard-stats article div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-stats small { color: #667382; font-size: 12px; }
.dashboard-stats strong { margin: 3px 0; color: #182433; font-size: 19px; }
.dashboard-stats article div span { color: #8a94a3; font-size: 12px; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 16px; }
.dashboard-recent, .dashboard-actions { margin-top: 0; }
.dashboard-recent .panel-inline-title h3, .dashboard-actions h3 { margin: 4px 0 0; }
.dashboard-table { min-width: 680px; }
.dashboard-empty { padding: 38px 15px; color: #778392; text-align: center; }
.dashboard-activity-list { display: grid; }
.dashboard-activity-item { min-width: 0; padding: 11px 3px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 18px; align-items: center; gap: 11px; color: inherit; border-bottom: 1px solid #edf0f3; text-decoration: none; }
.dashboard-activity-item:last-child { border-bottom: 0; }
.dashboard-activity-item:hover { color: inherit; }
.dashboard-activity-item:hover .dashboard-activity-copy strong { color: #1c2a78; }
.dashboard-activity-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; }
.dashboard-activity-icon svg { width: 18px; height: 18px; }
.dashboard-activity-icon.archive { color: #1c2a78; background: #eef0fb; }
.dashboard-activity-icon.report { color: #087443; background: #eaf8f1; }
.dashboard-activity-icon.payroll { color: #745f00; background: #fff7c8; }
.dashboard-activity-copy { min-width: 0; }
.dashboard-activity-copy strong, .dashboard-activity-copy small, .dashboard-activity-meta b, .dashboard-activity-meta time { display: block; }
.dashboard-activity-copy strong, .dashboard-activity-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-activity-copy strong { color: #253042; font-size: 12px; }
.dashboard-activity-copy small { margin-top: 2px; color: #7c8795; font-size: 12px; }
.dashboard-activity-meta { min-width: 105px; text-align: right; }
.dashboard-activity-meta b { color: #52606f; font-size: 12px; font-weight: 700; }
.dashboard-activity-meta time { margin-top: 2px; color: #9199a6; font-size: 12px; }
.dashboard-activity-arrow { color: #7f8998; }
.dashboard-activity-arrow .ui-arrow-icon { width: 20px; height: 20px; }
.dashboard-user-workspace { padding: 12px 4px; }
.dashboard-user-workspace h3 { margin: 5px 0 8px; color: #182433; }
.dashboard-user-workspace p:last-child { max-width: 650px; margin: 0; color: #667382; line-height: 1.65; }
.dashboard-actions > a { margin-top: 10px; padding: 12px; display: flex; align-items: center; gap: 11px; border: 1px solid #e3e7ef; border-radius: 9px; color: inherit; text-decoration: none; transition: border-color .18s, background .18s; }
.dashboard-actions > a:hover { border-color: #aeb5da; background: #f7f8fd; }
.dashboard-actions > a > span { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: var(--brand-soft); }
.dashboard-actions svg { width: 19px; height: 19px; }
.dashboard-actions strong, .dashboard-actions small { display: block; }
.dashboard-actions strong { color: #182433; font-size: 12px; }
.dashboard-actions small { margin-top: 2px; color: #778392; font-size: 12px; }
.status-badge.is-draft { color: #725e00; background: #fff7c8; }

/* Employees and payroll */
.payroll-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.payroll-summary-grid article { min-width: 0; padding: 17px; border: 1px solid #e3e7ef; border-radius: 10px; background: #fff; }
.payroll-summary-grid article.net { border-color: #c6cceb; background: var(--brand-soft); }
.payroll-summary-grid span, .payroll-summary-grid strong, .payroll-summary-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payroll-summary-grid span { color: #667382; font-size: 12px; }
.payroll-summary-grid strong { margin: 5px 0 2px; color: #182433; font-size: 18px; }
.payroll-summary-grid .net strong { color: var(--brand); }
.payroll-summary-grid small { color: #8a94a3; font-size: 12px; }
.payroll-filter { grid-template-columns: 155px minmax(230px, 1fr) 170px auto auto; }
.payroll-table { min-width: 1050px; }
.payroll-form-page { width: min(1020px, calc(100% - 40px)); }
.payroll-components { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; }
.payroll-components > .panel { margin-top: 0; }
.payroll-money-row { padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #edf0f4; }
.payroll-money-row > span { color: #34413a; font-size: 12px; font-weight: 700; }
.payroll-money-row > div { width: min(215px, 56%); display: flex; align-items: center; overflow: hidden; border: 1px solid #d8dfdb; border-radius: 8px; background: #fff; }
.payroll-money-row > div:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,42,120,.1); }
.payroll-money-row b { padding-left: 10px; color: var(--brand); font-size: 12px; }
.payroll-money-row input { height: 38px; padding: 0 10px 0 6px; border: 0; text-align: right; box-shadow: none !important; }
.payroll-live-summary { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid #dfe3eb; border-radius: 10px; background: #fff; }
.payroll-live-summary > div { padding: 15px 17px; border-right: 1px solid #e3e7ef; }
.payroll-live-summary > div:last-child { border: 0; }
.payroll-live-summary span, .payroll-live-summary strong { display: block; }
.payroll-live-summary span { color: #667382; font-size: 12px; }
.payroll-live-summary strong { margin-top: 4px; color: #182433; font-size: 18px; }
.payroll-live-summary .net { background: var(--brand-soft); }
.payroll-live-summary .net strong { color: var(--brand); }

/* Responsive record cards replace wide administration tables on mobile. */
.mobile-record-list { display: grid; gap: 12px; }
.mobile-record-card { overflow: hidden; border: 1px solid #e1e5ed; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.mobile-record-head { padding: 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f4; background: #fafbfe; }
.mobile-record-head > div { min-width: 0; }
.mobile-record-head strong, .mobile-record-head small { display: block; }
.mobile-record-head strong { overflow-wrap: anywhere; color: #182433; font-size: 14px; }
.mobile-record-head small { margin-top: 3px; color: #778392; font-size: 12px; }
.mobile-record-grid { margin: 0; padding: 14px 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.mobile-record-grid > div { min-width: 0; }
.mobile-record-grid dt { margin-bottom: 3px; color: #7c8795; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mobile-record-grid dd { margin: 0; overflow-wrap: anywhere; color: #263241; font-size: 12px; font-weight: 700; }
.mobile-record-wide { grid-column: 1 / -1; }
.mobile-net-value { padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); }
.mobile-net-value dd { color: var(--brand); font-size: 16px; }
.mobile-period-badge { padding: 5px 8px; border-radius: 7px; color: var(--brand); background: var(--brand-soft); font-size: 12px; font-weight: 800; white-space: nowrap; }
.mobile-record-actions { padding: 12px 15px 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-top: 1px solid #edf0f4; }
.mobile-record-actions > a, .mobile-record-actions > form, .mobile-record-actions > form button { width: 100%; }
.mobile-record-actions .button { min-height: 38px; padding: 0 10px; }
.mobile-record-actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.mobile-record-actions.single-action > a { grid-column: 1 / -1; }
.mobile-record-actions .self-label { grid-column: 1 / -1; padding: 8px 0; text-align: center; }
.mobile-empty-state { padding: 32px 16px; border: 1px dashed #d5dae4; border-radius: 10px; color: #778392; background: #fafbfc; text-align: center; }
.mobile-scroll-hint { margin-bottom: 10px; padding: 9px 11px; border-radius: 7px; color: #667382; background: #f3f5f9; font-size: 12px; }

/* Employee schedules */
.schedule-page { width: min(100% - 40px, 1540px); max-width: 1540px; }
.schedule-toolbar { margin-top: 0; padding: 14px 16px !important; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.schedule-month-nav, .schedule-month-nav form { display: flex; align-items: end; gap: 8px; }
.schedule-month-nav label { margin: 0; }
.schedule-month-nav label span { display: block; margin-bottom: 5px; color: #647180; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.schedule-month-nav input { min-width: 165px; }
.schedule-toolbar-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.schedule-toolbar-meta span { padding: 6px 9px; border-radius: 99px; color: #425063; background: #eef1f5; font-size: 12px; font-weight: 750; }
.schedule-panel { margin-top: 14px; padding: 0 !important; overflow: hidden; }
.schedule-table-scroll { width: 100%; overflow-x: auto; }
.schedule-table { width: 100%; min-width: 1260px; border-collapse: separate; border-spacing: 0; table-layout: fixed; color: #17202c; font-size: 12px; }
.schedule-table th, .schedule-table td { height: 42px; padding: 0; border-right: 1px solid #d8dde5; border-bottom: 1px solid #d8dde5; text-align: center; }
.schedule-table thead th { height: 48px; color: #293545; background: #eaf0f7; font-weight: 800; }
.schedule-table tr:last-child td { border-bottom: 0; }
.schedule-table th:last-child, .schedule-table td:last-child { border-right: 0; }
.schedule-table .schedule-number { position: sticky; left: 0; z-index: 3; width: 42px; background: #fff; }
.schedule-table thead .schedule-number { z-index: 5; background: #dce8f5; }
.schedule-table .schedule-name { position: sticky; left: 42px; z-index: 2; width: 190px; padding: 5px 9px; text-align: left; background: #fff; box-shadow: 4px 0 6px rgba(24,36,51,.06); }
.schedule-table thead .schedule-name { z-index: 4; text-align: center; background: #dce8f5; }
.schedule-name strong, .schedule-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-name strong { font-size: 12px; }
.schedule-name small { margin-top: 2px; color: #758192; font-size: 12px; font-weight: 600; }
.schedule-date { width: 34px; }
.schedule-date b, .schedule-date small { display: block; }
.schedule-date b { font-size: 12px; }
.schedule-date small { margin-top: 2px; font-size: 12px; }
.schedule-date.is-weekend, .schedule-date.is-holiday { color: #fff; background: #d92d32; }
.schedule-cell { width: 34px; transition: background .15s; }
.schedule-cell select { width: 100%; height: 41px; padding: 0; border: 0; border-radius: 0; color: #182433; background: transparent; font-size: 12px; font-weight: 850; text-align: center; text-align-last: center; box-shadow: none !important; cursor: pointer; appearance: none; }
.schedule-cell.status-l { background: #ef2c32; }
.schedule-cell.status-l select { color: #fff; }
.schedule-cell.status-sb { background: #fff000; }
.schedule-cell.status-sb select { color: #151515; }
.schedule-actions { padding: 14px 16px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; border-top: 1px solid #e2e6ed; background: #fafbfc; }
.admin-title-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button-warning { border-color: #d3ad16; color: #5f4b00; background: #fff3b0; }
.schedule-information { margin-top: 14px; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 14px; }
.schedule-information .panel { margin-top: 0; }
.schedule-legend { display: grid; gap: 9px; }
.schedule-legend > div { display: flex; align-items: center; gap: 10px; }
.schedule-legend b { width: 34px; height: 30px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 6px; font-size: 12px; }
.legend-p { border: 1px solid #d6dce5; background: #fff; }.legend-sb { background: #fff000; }.legend-l { color: #fff; background: #ef2c32; }
.schedule-legend span strong, .schedule-legend span small { display: block; }.schedule-legend span strong { font-size: 12px; }.schedule-legend span small { margin-top: 2px; color: #758192; font-size: 12px; }
.holiday-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.holiday-list > div { padding: 8px 0; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid #edf0f4; }
.holiday-list time { min-width: 70px; color: #bd242a; font-size: 12px; font-weight: 800; }.holiday-list span { font-size: 12px; font-weight: 700; }.holiday-list small { display: block; margin-top: 2px; color: #7a8593; font-size: 12px; font-weight: 500; }

/* Holiday management */
.holiday-summary { margin: 0 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.holiday-summary > div { padding: 16px 18px; border: 1px solid #e0e5eb; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(24, 36, 51, .035); }
.holiday-summary small, .holiday-summary strong { display: block; }
.holiday-summary small { color: #667382; font-size: 12px; font-weight: 700; }
.holiday-summary strong { margin-top: 5px; color: #182433; font-size: 22px; }
.holiday-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.7fr); align-items: start; gap: 14px; }
.holiday-layout .panel { margin-top: 0; }
.holiday-form { display: grid; gap: 14px; }
.holiday-form label, .holiday-year-filter label { margin: 0; }
.holiday-form label > span, .holiday-year-filter label > span { display: block; margin-bottom: 6px; color: #344052; font-size: 12px; font-weight: 750; }
.holiday-form label b { color: #d63939; }
.holiday-form-actions, .holiday-year-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.holiday-form-actions .primary-button { flex: 1; }
.holiday-year-filter { margin-bottom: 16px; justify-content: flex-end; }
.holiday-year-filter input { width: 130px; }
.holiday-table th:first-child { width: 145px; }
.holiday-table th:nth-child(3) { width: 150px; }
.holiday-table th:last-child { width: 100px; }
.holiday-type { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.holiday-type.type-national { color: #c2252c; background: #ffeaeb; }
.holiday-type.type-collective { color: #8a5b00; background: #fff2cc; }
.holiday-type.type-custom { color: #17663a; background: #ddf5e7; }
.holiday-mobile-card .mobile-record-head { align-items: flex-start; gap: 10px; }
.form-hint { margin: 14px 0 0; color: #758192; font-size: 12px; line-height: 1.6; }

@media (max-width: 991.98px) {
    .app-page .page-wrapper { width: 100%; max-width: 100vw; overflow-x: hidden; }
    .app-sidebar > .container-fluid { position: relative; min-height: 62px; }
    .app-sidebar > .container-fluid > .navbar-nav { display: none !important; }
    .app-sidebar .navbar-toggler { position: relative; z-index: 2; order: 1; }
    .app-brand { position: relative; top: auto; right: auto; left: auto; order: 2; width: 56px; min-height: 58px; margin: 0 0 0 auto !important; padding: 2px 0; justify-content: flex-end; transform: none; }
    .app-brand img { width: 56px; height: 56px; }
    .app-sidebar .navbar-collapse { width: 100%; flex-basis: 100%; order: 4; padding: 8px 0 12px; }
    .app-sidebar .navbar-nav { padding: 0 4px; }
    .app-sidebar-note, .app-sidebar-user { display: none !important; }
    .app-page-header { padding-top: 1rem; }
    .app-page-header > .container-xl, .app-page .footer > .container-xl { padding-right: 1rem; padding-left: 1rem; }
    .app-page .page-wrapper > main.container { width: 100%; max-width: 100%; min-width: 0; padding: 1rem 1rem 2.5rem; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-layout { grid-template-columns: 1fr; }
    .employee-filter { grid-template-columns: 1fr 1fr; }
    .payroll-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payroll-filter { grid-template-columns: 1fr 1fr; }
    .schedule-toolbar { align-items: stretch; flex-direction: column; }
    .schedule-toolbar-meta { justify-content: flex-start; }
    .schedule-information { grid-template-columns: 1fr; }
    .holiday-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .holiday-layout { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
    .login-page { padding: 24px 16px; align-items: center; }
    .login-brand { height: 116px; margin-bottom: 20px; }
    .login-brand img { width: 174px; height: 140px; transform: translateY(-6px); }
    .login-card { padding: 26px 22px 0; border-radius: 14px; }
    .login-card h1 { font-size: 23px; }
    .login-card-footer { margin-right: -22px; margin-left: -22px; padding-right: 18px; padding-left: 18px; }
    .welcome-overlay { padding: 17px; }
    .welcome-dialog { padding: 30px 22px 24px; border-radius: 15px; }
    .welcome-dialog h2 { font-size: 22px; }
    .app-page-header { display: none; }
    .app-page .page-wrapper > main.container { width: calc(100% - 24px); max-width: calc(100% - 24px); margin-right: 12px; margin-left: 12px; padding-right: 0; padding-left: 0; }
    .app-page-header > .container-xl, .app-page .footer > .container-xl { padding-right: 12px; padding-left: 12px; }
    .app-page-header .text-secondary { font-size: 12px; }
    .app-page-actions { display: none; }
    .app-page .intro h2, .app-page .import-copy h2, .app-page .import-copy p { max-width: 100%; overflow-wrap: anywhere; }
    .app-page .import-actions, .app-page .import-actions > * { width: 100%; max-width: 100%; }
    .app-page .intro, .app-page .panel, .app-page .import-panel, .app-page .form-layout, .app-page .form-panel, .app-page .settings-panel { width: 100%; max-width: 100%; min-width: 0; }
    .app-nav-section { margin-top: 10px; }
    .dashboard-welcome { padding: 19px; align-items: stretch; flex-direction: column; }
    .dashboard-welcome h2 { font-size: 23px; }
    .dashboard-period { width: 100%; min-width: 0; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .employee-filter, .payroll-filter { grid-template-columns: 1fr; }
    .filter-bar > label { width: 100%; max-width: none; }
    .payroll-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .payroll-summary-grid article { padding: 14px; }
    .payroll-summary-grid strong { font-size: 16px; }
    .payroll-components, .payroll-live-summary { grid-template-columns: 1fr; }
    .payroll-live-summary > div { border-right: 0; border-bottom: 1px solid #e3e7ef; }
    .payroll-money-row { align-items: stretch; flex-direction: column; gap: 6px; }
    .payroll-money-row > div { width: 100%; }
    .app-page .panel { padding: 20px; }
    .schedule-page { width: calc(100% - 24px) !important; }
    .schedule-toolbar { padding: 14px !important; }
    .schedule-month-nav { width: 100%; }
    .schedule-month-nav form { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .schedule-month-nav form label { min-width: 0; }
    .schedule-month-nav input { width: 100%; min-width: 0; }
    .schedule-toolbar-meta { gap: 5px; }
    .schedule-table { min-width: 1190px; }
    .schedule-table .schedule-name { width: 158px; }
    .schedule-actions { align-items: stretch; flex-direction: column; }
    .schedule-actions .button { width: 100%; }
    .holiday-list { grid-template-columns: 1fr; }
    .admin-title-actions { width: 100%; }
    .admin-title-actions .button { flex: 1; justify-content: center; }
    .holiday-summary { gap: 8px; }
    .holiday-summary > div { padding: 13px 14px; }
    .holiday-year-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .holiday-year-filter input { width: 100%; }
    .holiday-form-actions { align-items: stretch; flex-direction: column; }
    .holiday-form-actions .button { width: 100%; }
}

/* Tabler-aligned application shell and component rhythm */
body { color: #182433; background: #f6f8fb; font-size: 14px; line-height: 1.5; }
.app-page { background: #f6f8fb; }
.app-sidebar { width: 236px; border-right-color: #e6e8eb; box-shadow: none; }
.app-sidebar > .container-fluid { padding: 0 12px; }
.app-brand { min-height: 88px; padding: 8px 12px; border-bottom: 1px solid #edf0f3; }
.app-brand img { width: 76px; height: 76px; }
.app-sidebar .navbar-collapse { padding-top: 10px; }
.app-sidebar .navbar-nav { gap: 2px; }
.app-nav-section { margin: 15px 10px 5px; color: #929dab; font-size: 12px; letter-spacing: .1em; }
.app-sidebar .nav-link { position: relative; min-height: 40px; padding: 8px 10px; border-radius: 6px; color: #52606f; font-size: 13px; font-weight: 500; }
.app-sidebar .nav-link:hover { color: #182433; background: #f3f5f8; }
.app-sidebar .nav-item.active .nav-link { color: #1c2a78; background: #eef0fb; font-weight: 650; }
.app-sidebar .nav-item.active .nav-link::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: -12px; width: 3px; border-radius: 0 3px 3px 0; background: #1c2a78; }
.app-sidebar .nav-link-icon { margin-right: 8px; }
.app-sidebar .nav-link-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.app-sidebar-note { display: none; }
.app-sidebar-user { margin-top: auto; padding: 12px 10px; border-top-color: #edf0f3; background: #fff; }
.app-sidebar-user .avatar { border-radius: 6px; }
.app-sidebar-user strong { font-size: 12px; }.app-sidebar-user small { font-size: 12px; }
.app-sidebar-logout { margin: 0; }.app-sidebar-logout button { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 1px solid #e4e7eb; border-radius: 6px; color: #7c8795; background: #fff; }.app-sidebar-logout button:hover { color: #c43535; border-color: #efc4c4; background: #fff5f5; }.app-sidebar-logout svg { width: 17px; height: 17px; }

/* Customer document archive */
.archive-page, .archive-detail-page, .archive-recovery-page { width: 100%; max-width: none; }
.archive-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.archive-summary article { min-width: 0; padding: 18px; display: flex; align-items: center; gap: 13px; border: 1px solid #e4e8ee; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.archive-summary-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 9px; color: #1c2a78; background: #eef0fb; }
.archive-summary-icon svg { width: 21px; height: 21px; }
.archive-summary small, .archive-summary strong, .archive-summary article span:last-child { display: block; }
.archive-summary small { color: #667382; font-size: 12px; }
.archive-summary strong { margin: 1px 0; color: #182433; font-size: 21px; line-height: 1.2; }
.archive-summary article span:last-child { color: #8b94a2; font-size: 12px; }
.archive-recovery-notice, .archive-recovery-explanation { margin-bottom: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid #f0df86; border-radius: 10px; color: #594b00; background: #fffbea; text-decoration: none; }
.archive-recovery-notice:hover { border-color: #e1c73d; color: #332b00; }
.archive-recovery-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #d9b500; font-size: 13px; font-weight: 900; }
.archive-recovery-notice strong, .archive-recovery-notice small, .archive-recovery-explanation strong, .archive-recovery-explanation p { display: block; }
.archive-recovery-notice strong, .archive-recovery-explanation strong { font-size: 12px; }
.archive-recovery-notice small, .archive-recovery-explanation p { margin: 2px 0 0; color: #7b6b22; font-size: 12px; line-height: 1.5; }
.archive-recovery-arrow { margin-left: auto; color: #7b6512; }
.archive-recovery-arrow .ui-arrow-icon { width: 22px; height: 22px; }
.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 335px; align-items: start; gap: 18px; }
.archive-list-panel, .archive-create-panel { min-width: 0; }
.archive-title-row { align-items: center; }
.archive-search { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.archive-search label { min-width: 180px; flex: 1; }
.archive-search input { width: 100%; height: 38px; padding: 6px 10px; border: 1px solid #d8dce2; border-radius: 6px; outline: 0; color: #182433; background: #fff; font-size: 12px; }
.archive-search input:focus { border-color: #6c7cc6; box-shadow: 0 0 0 3px rgba(28,42,120,.1); }
.archive-table { min-width: 780px; }
.archive-table .archive-address { max-width: 290px; color: #5d6877; line-height: 1.45; }
.archive-document-count { min-width: 29px; height: 25px; padding: 0 8px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 99px; color: #1c2a78; background: #eef0fb; font-size: 12px; font-weight: 750; }
.archive-pagination { padding-top: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #778292; font-size: 12px; }
.archive-create-panel .panel-inline-title p:last-child { margin: 3px 0 0; color: #7c8795; font-size: 12px; }
.archive-form-stack { display: grid; gap: 14px; }
.archive-form-stack label > span, .archive-link-form label > span { margin-bottom: 5px; display: block; color: #52606f; font-size: 12px; font-weight: 600; }
.archive-form-stack input, .archive-form-stack textarea, .archive-link-form select { width: 100%; padding: 8px 10px; border: 1px solid #d8dce2; border-radius: 6px; outline: 0; color: #182433; background: #fff; font-size: 12px; }
.archive-form-stack input { height: 40px; }
.archive-form-stack input[type=file] { height: auto; min-height: 42px; padding: 8px; }
.archive-form-stack textarea { min-height: 92px; resize: vertical; }
.archive-form-stack input:focus, .archive-form-stack textarea:focus, .archive-link-form select:focus { border-color: #6c7cc6; box-shadow: 0 0 0 3px rgba(28,42,120,.1); }
.archive-upload-help { margin-top: -7px; color: #818b99; font-size: 12px; line-height: 1.5; }
.archive-primary-action, .archive-delete-customer { width: 100%; justify-content: center; }
.archive-customer-heading { margin-bottom: 18px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; border: 1px solid #e4e8ee; border-radius: 10px; background: #fff; }
.archive-customer-avatar { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #1c2a78; font-size: 18px; font-weight: 800; }
.archive-customer-heading > div:nth-child(2) { min-width: 0; }
.archive-customer-heading h2 { margin: 2px 0 1px; color: #182433; font-size: 21px; line-height: 1.25; }
.archive-customer-heading p:last-child { margin: 0; color: #697586; font-size: 12px; overflow-wrap: anywhere; }
.archive-document-total { margin-left: auto; padding-left: 18px; border-left: 1px solid #e7eaf0; text-align: center; }
.archive-document-total strong, .archive-document-total small { display: block; }
.archive-document-total strong { color: #1c2a78; font-size: 21px; }
.archive-document-total small { color: #7c8795; font-size: 12px; }
.archive-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px; }
.archive-documents-panel { min-width: 0; }
.archive-detail-side { display: grid; gap: 18px; }
.archive-detail-side > form { margin: 0; }
.archive-document-list, .archive-recovery-list { display: grid; gap: 9px; }
.archive-document-item { padding: 12px; display: flex; align-items: center; gap: 11px; border: 1px solid #e7eaf0; border-radius: 8px; background: #fff; }
.archive-file-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 8px; color: #b4232a; background: #fff0f1; font-size: 12px; font-weight: 850; }
.archive-file-copy { min-width: 0; flex: 1; }
.archive-file-copy strong, .archive-file-copy small { display: block; }
.archive-file-copy strong { overflow: hidden; color: #253042; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.archive-file-copy small { margin-top: 3px; color: #84909e; font-size: 12px; }
.archive-file-actions, .archive-recovery-links { display: flex; align-items: center; gap: 6px; }
.archive-file-actions form { margin: 0; }
.archive-empty { padding: 45px 15px; color: #7c8795; text-align: center; }
.archive-empty > span { width: 46px; height: 46px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 10px; color: #1c2a78; background: #eef0fb; }
.archive-empty svg { width: 23px; height: 23px; }
.archive-empty strong { display: block; color: #344054; font-size: 12px; }
.archive-empty p { margin: 4px 0 0; font-size: 12px; }
.archive-recovery-explanation { align-items: flex-start; }
.archive-recovery-item { padding: 13px; display: grid; grid-template-columns: 38px minmax(180px, 1fr) auto minmax(300px, .9fr); align-items: center; gap: 11px; border: 1px solid #e7eaf0; border-radius: 8px; }
.archive-link-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; }
.archive-link-form select { height: 36px; }

@media (max-width: 1100px) {
    .archive-layout, .archive-detail-layout { grid-template-columns: 1fr; }
    .archive-create-panel { order: -1; }
    .archive-recovery-item { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .archive-link-form { grid-column: 2 / -1; }
}

@media (max-width: 680px) {
    .archive-summary { grid-template-columns: 1fr; gap: 9px; }
    .archive-summary article { padding: 14px; }
    .archive-search { align-items: stretch; flex-wrap: wrap; }
    .archive-search label { min-width: 100%; }
    .archive-customer-heading { align-items: flex-start; flex-wrap: wrap; }
    .archive-document-total { margin-left: 0; padding: 0 0 0 62px; border-left: 0; display: flex; align-items: baseline; gap: 5px; flex-basis: 100%; text-align: left; }
    .archive-document-item { align-items: flex-start; flex-wrap: wrap; }
    .archive-file-copy { width: calc(100% - 52px); flex-basis: calc(100% - 52px); }
    .archive-file-actions { width: 100%; padding-left: 49px; flex-wrap: wrap; }
    .archive-file-actions .button { flex: 1; justify-content: center; }
    .archive-file-actions form { flex: 1; }
    .archive-file-actions form .button { width: 100%; }
    .archive-recovery-item { grid-template-columns: 38px minmax(0, 1fr); align-items: start; }
    .archive-recovery-links, .archive-link-form { grid-column: 1 / -1; }
    .archive-recovery-links .button { flex: 1; justify-content: center; }
    .archive-link-form { grid-template-columns: 1fr; }
    .dashboard-activity-item { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 9px; }
    .dashboard-activity-icon { width: 36px; height: 36px; }
    .dashboard-activity-meta { grid-column: 2; min-width: 0; display: flex; align-items: center; gap: 6px; text-align: left; }
    .dashboard-activity-meta time { margin-top: 0; }
    .dashboard-activity-arrow { grid-column: 3; grid-row: 1 / span 2; }
}

.app-page .page-wrapper > main.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 48px; }
.app-page .page-wrapper > main.schedule-page { max-width: 1540px; }
.app-page .page-wrapper > main.admin-page { min-height: auto; padding-top: 24px; }
.admin-title { margin-bottom: 20px; align-items: center; }
.admin-title h2 { margin: 3px 0; color: #182433; font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.25; }
.admin-title p { color: #667382; font-size: 12px; }
.eyebrow, .app-page .eyebrow { color: #667382; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.back-link { margin-bottom: 14px; color: #4263a8; font-size: 12px; font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 6px; }
.back-link .ui-arrow-icon { width: 18px; height: 18px; }

.app-page .panel, .app-page .admin-panel { border: 1px solid #e6e8eb; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.app-page .panel, .app-page .admin-panel:not(.schedule-panel) { padding: 20px; }
.admin-panel { margin-top: 16px; }
.panel-inline-title { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #edf0f3; }
.panel-inline-title h3, .admin-panel > h3 { margin: 2px 0 0; color: #182433; font-size: 16px; font-weight: 650; }

.button { min-height: 38px; padding: 7px 13px; border-color: #d8dce2; border-radius: 6px; color: #344054; background: #fff; font-size: 12px; font-weight: 600; line-height: 1.2; box-shadow: 0 1px 1px rgba(24,36,51,.03); }
.button:hover { border-color: #b9c0ca; color: #182433; background: #f8f9fb; }
.button-primary, .button.primary-button, .app-page .primary-button, .app-page .button-primary, .app-page .button.primary-button { border-color: #1c2a78; color: #fff; background: #1c2a78; }
.button-small { min-height: 30px; padding: 5px 9px; border-radius: 5px; font-size: 12px; }
.button-danger { border-color: #f0c4c4; color: #b4232a; background: #fff5f5; }
.button-warning { border-color: #e0bd31; color: #624f00; background: #fff4bd; }

.filter-bar { margin-bottom: 18px; gap: 12px; }
.filter-bar label > span, .record-form label > span { margin-bottom: 5px; color: #52606f; font-size: 12px; font-weight: 600; }
.filter-bar input, .filter-bar select, .record-form input, .record-form select { height: 38px; padding: 6px 10px; border-color: #d8dce2; border-radius: 6px; color: #182433; font-size: 12px; }
.filter-bar input:focus, .filter-bar select:focus, .record-form input:focus, .record-form select:focus { border-color: #6c7cc6; box-shadow: 0 0 0 3px rgba(28,42,120,.1); }
.form-grid { gap: 16px; }
.form-actions { padding-top: 18px; border-top: 1px solid #edf0f3; }

.table-scroll, .table-wrap { border: 1px solid #e6e8eb; border-radius: 7px; background: #fff; }
.admin-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; color: #344054; font-size: 12px; }
.admin-table thead th { padding: 10px 12px; border-bottom: 1px solid #dfe3e8; color: #667382; background: #f7f8fa; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.admin-table tbody td { padding: 11px 12px; border-bottom: 1px solid #edf0f3; background: #fff; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: #fafbfc; }
.admin-table td > small { color: #7c8795; font-size: 12px; }
.row-actions { gap: 6px; }
.row-actions a, .row-actions button { min-height: 28px; padding: 5px 8px; border: 1px solid #e2e6eb; border-radius: 5px; color: #3d5393; background: #fff; font-size: 12px; font-weight: 600; }
.row-actions a:hover, .row-actions button:hover { border-color: #c7ced7; background: #f5f7fa; }
.row-actions form { margin: 0; }
.status-badge, .role-badge { padding: 4px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0; }

.alert { padding: 12px 14px; border-radius: 7px; font-size: 12px; }
.month-strip { gap: 12px; }
.month-summary { padding: 14px 16px; border-radius: 8px; box-shadow: none; }
.payroll-summary-grid { gap: 12px; }
.payroll-summary-grid article { padding: 16px; border-radius: 8px; }
.dashboard-welcome { padding: 22px 24px; border-radius: 8px; background: #fff; }
.dashboard-welcome h2 { font-size: 24px; }
.dashboard-stats { gap: 12px; }
.dashboard-stats article { padding: 16px; border-radius: 8px; }
.dashboard-stat-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 7px; }
.dashboard-layout { gap: 16px; }
.mobile-record-card { border-radius: 8px; box-shadow: none; }
.mobile-record-head { background: #f8f9fb; }
.app-page .footer { border-top: 1px solid #e6e8eb; color: #7c8795; background: transparent; font-size: 12px; }
.app-page .footer > .container-xl { max-width: 1440px; padding-right: 28px; padding-left: 28px; }

@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
}

@media (max-width: 991.98px) {
    html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
    .app-page { width: 100%; max-width: 100vw; display: block; overflow-x: hidden; }
    .app-sidebar { position: sticky; top: 0; z-index: 1030; width: 100%; min-height: 62px; border-right: 0; border-bottom: 1px solid #e6e8eb; box-shadow: 0 1px 3px rgba(24,36,51,.06); }
    .app-sidebar > .container-fluid { width: 100%; max-width: 100%; min-height: 62px; padding-right: 14px; padding-left: 14px; }
    .app-sidebar .navbar-toggler { height: 62px; min-height: 62px; align-self: flex-start; display: flex; align-items: center; justify-content: center; }
    .app-brand { position: absolute !important; top: 4px; right: 14px !important; left: auto !important; width: 54px !important; max-width: 54px; min-height: 54px; margin: 0 !important; padding: 0 !important; border: 0; justify-content: center !important; overflow: visible; transform: none !important; }
    .app-brand img { display: block; width: 52px !important; max-width: 52px !important; height: 52px !important; object-fit: contain; }
    .app-sidebar .navbar-collapse { width: 100%; flex-basis: 100%; clear: both; max-height: calc(100vh - 62px); margin-top: 0; padding: 8px 0 14px; overflow-y: auto; border-top: 1px solid #edf0f3; background: #fff; }
    .app-sidebar .navbar-nav { gap: 2px; padding: 0; }
    .app-sidebar .nav-link { min-height: 42px; padding: 9px 11px; }
    .app-nav-section { margin-left: 11px; }
    .app-page .page-wrapper > main.container { max-width: 100%; padding: 20px 18px 40px; }
    .admin-title { align-items: flex-start; }
    .import-rule { overflow-wrap: anywhere; }
}

@media (max-width: 580px) {
    body { font-size: 13px; }
    .app-page .page-wrapper > main.container, .app-page .page-wrapper > main.schedule-page { width: calc(100% - 24px); margin: 0 12px; padding: 18px 0 36px; }
    .admin-title { margin-bottom: 16px; gap: 14px; }
    .admin-title h2 { font-size: 21px; }
    .admin-title p { font-size: 12px; line-height: 1.5; }
    .admin-title > .button { width: 100%; }
    .app-page .panel, .app-page .admin-panel:not(.schedule-panel) { padding: 16px; }
    .panel-inline-title { margin-bottom: 14px; padding-bottom: 12px; }
    .button { min-height: 40px; }
    .filter-bar { gap: 10px; }
    .mobile-record-head { padding: 13px 14px; }
    .mobile-record-grid { padding: 13px 14px; gap: 12px; }
    .mobile-record-actions { padding: 12px 14px 14px; }
    .payroll-summary-grid { gap: 8px; }
    .payroll-summary-grid article { padding: 13px; }
    .dashboard-welcome { padding: 18px; }
    .dashboard-stats article { padding: 14px; }
    .app-page .footer { display: none; }
}

/* Employee overtime */
.overtime-rate-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.overtime-rate-grid article { padding: 16px 18px; border: 1px solid #e0e5eb; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.overtime-rate-grid span, .overtime-rate-grid strong, .overtime-rate-grid small { display: block; }
.overtime-rate-grid span { color: #667382; font-size: 12px; font-weight: 700; }
.overtime-rate-grid strong { margin-top: 4px; color: #182433; font-size: 19px; }
.overtime-rate-grid small { margin-top: 2px; color: #84909d; font-size: 12px; }
.overtime-rate-grid .overtime-total-card { border-color: #cfd5f3; background: #f4f5fc; }
.overtime-rate-grid .overtime-total-card strong { color: #1c2a78; }
.overtime-layout { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.65fr); align-items: start; gap: 14px; }
.overtime-layout .panel { margin-top: 0; }
.overtime-form { display: grid; gap: 13px; }
.overtime-form label { margin: 0; }
.overtime-form label > span { display: block; margin-bottom: 5px; color: #52606f; font-size: 12px; font-weight: 600; }
.overtime-form label > span b { color: #d63939; }
.overtime-form input, .overtime-form select, .overtime-form textarea { width: 100%; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 6px; color: #182433; background: #fff; font-size: 12px; }
.overtime-form input, .overtime-form select { height: 38px; }
.overtime-form textarea { min-height: 76px; resize: vertical; }
.overtime-employee-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.overtime-employee-picker legend { width: 100%; margin: 0 0 7px; padding: 0; color: #52606f; font-size: 12px; font-weight: 600; }
.overtime-employee-picker legend b { color: #d63939; }
.overtime-employee-picker legend small { display: block; margin-top: 2px; color: #8793a2; font-size: 12px; font-weight: 500; }
.overtime-employee-options { max-height: 190px; padding: 4px; overflow-y: auto; border: 1px solid #d8dce2; border-radius: 7px; background: #fff; }
.overtime-employee-option { display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 0; padding: 7px 9px; border-radius: 5px; cursor: pointer; }
.overtime-employee-option:hover { background: #f4f6fb; }
.overtime-employee-option + .overtime-employee-option { border-top: 1px solid #edf0f4; }
.overtime-form .overtime-employee-option > input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: #1c2a78; }
.overtime-form .overtime-employee-option > span { min-width: 0; margin: 0; }
.overtime-employee-option strong,
.overtime-employee-option small { display: block; }
.overtime-employee-option strong { overflow: hidden; color: #263344; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.overtime-employee-option small { margin-top: 1px; overflow: hidden; color: #7a8796; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.overtime-employee-option.is-disabled { opacity: .55; cursor: not-allowed; }
.overtime-employee-option.is-disabled:hover { background: transparent; }
.overtime-employee-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 7px; }
.overtime-employee-picker-footer > span { color: #667382; font-size: 12px; font-weight: 600; }
.overtime-employee-picker-footer button { padding: 0; color: #283a8e; font-size: 12px; font-weight: 700; border: 0; background: transparent; cursor: pointer; }
.overtime-employee-picker-footer button:hover { text-decoration: underline; }
.overtime-preview { padding: 13px 14px; border: 1px solid #d9def5; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f5f6fc; }
.overtime-preview span { color: #596579; font-size: 12px; font-weight: 700; }
.overtime-preview strong { color: #1c2a78; font-size: 17px; white-space: nowrap; }
.overtime-form-actions { display: flex; align-items: stretch; gap: 8px; }
.overtime-form-actions .primary-button { flex: 1; }
.overtime-filter { display: grid; grid-template-columns: 150px minmax(170px, 1fr) 160px auto; align-items: end; }
.overtime-mini-summary { margin: -3px 0 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.overtime-mini-summary span { padding: 5px 8px; border-radius: 99px; color: #596579; background: #eef1f5; font-size: 12px; }
.overtime-mini-summary b { color: #293545; }
.overtime-table th:first-child { width: 95px; }
.overtime-table th:nth-child(3) { width: 150px; }
.overtime-table th:nth-child(4) { width: 90px; }
.overtime-table th:nth-child(5) { width: 115px; }
.overtime-table th:last-child { width: 100px; }
.overtime-type { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.overtime-type.type-home_check { color: #17663a; background: #ddf5e7; }
.overtime-type.type-maintenance { color: #174b83; background: #e3f0fc; }
.payroll-overtime-row { align-items: center; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; border-radius: 7px; background: #f5f6fc; }
.payroll-overtime-row > span small { display: block; margin-top: 2px; color: #707d8f; font-size: 12px; font-weight: 500; }
.payroll-overtime-row input[readonly] { color: #1c2a78; background: #eef0fa; font-weight: 700; cursor: default; }
.payroll-overtime-row > a { margin-left: auto; color: #354a96; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Employee cash advances */
.cash-advance-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cash-advance-summary article { padding: 16px 18px; border: 1px solid #e0e5eb; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.cash-advance-summary span, .cash-advance-summary strong, .cash-advance-summary small { display: block; }
.cash-advance-summary span { color: #667382; font-size: 12px; font-weight: 700; }
.cash-advance-summary strong { margin-top: 4px; color: #182433; font-size: 19px; }
.cash-advance-summary small { margin-top: 2px; color: #84909d; font-size: 12px; }
.cash-advance-summary .balance { border-color: #eedc9b; background: #fffaf0; }
.cash-advance-summary .balance strong { color: #8a5b00; }
.cash-advance-layout { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.65fr); align-items: start; gap: 14px; }
.cash-advance-layout .panel { margin-top: 0; }
.cash-advance-form { display: grid; gap: 13px; }
.cash-advance-form label { margin: 0; }
.cash-advance-form label > span { display: block; margin-bottom: 5px; color: #52606f; font-size: 12px; font-weight: 600; }
.cash-advance-form label > span b { color: #d63939; }
.cash-advance-form input, .cash-advance-form select, .cash-advance-form textarea { width: 100%; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 6px; color: #182433; background: #fff; font-size: 12px; }
.cash-advance-form input, .cash-advance-form select { height: 38px; }
.cash-advance-form textarea { min-height: 76px; resize: vertical; }
.cash-advance-money { position: relative; }
.cash-advance-money > b { position: absolute; top: 50%; left: 11px; z-index: 1; color: #647180; font-size: 12px; transform: translateY(-50%); }
.cash-advance-money input { padding-left: 34px; }
.cash-advance-form-actions { display: flex; align-items: stretch; gap: 8px; }
.cash-advance-form-actions .primary-button { flex: 1; }
.cash-advance-filter { display: grid; grid-template-columns: 170px minmax(180px, 1fr) auto; align-items: end; }
.cash-advance-period-total { margin: -3px 0 14px; padding: 9px 11px; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #596579; background: #f3f5f8; font-size: 12px; }
.cash-advance-period-total strong { color: #182433; font-size: 13px; }
.cash-advance-table th:first-child { width: 100px; }
.cash-advance-table th:nth-child(3) { width: 140px; }
.cash-advance-table th:last-child { width: 100px; }
.cash-advance-value { color: #8a5b00; font-size: 12px; font-weight: 800; white-space: nowrap; }
.payroll-cash-advance-row { flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; border-radius: 7px; background: #fffaf0; }
.payroll-cash-advance-row > span small { display: block; margin-top: 2px; color: #7c704c; font-size: 12px; font-weight: 500; }
.payroll-cash-advance-row > a { margin-left: auto; color: #806000; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Employee attendance */
.attendance-summary { margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.attendance-summary article { padding: 14px 16px; border: 1px solid #e0e5eb; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.attendance-summary span, .attendance-summary strong, .attendance-summary small { display: block; }
.attendance-summary span { color: #667382; font-size: 12px; font-weight: 700; }
.attendance-summary strong { margin-top: 4px; color: #182433; font-size: 17px; }
.attendance-summary small { margin-top: 2px; color: #84909d; font-size: 12px; }
.attendance-summary .unexcused { border-color: #f1c8c9; background: #fff7f7; }
.attendance-summary .unexcused strong { color: #bd242a; }
.attendance-summary .deduction { border-color: #eedc9b; background: #fffaf0; }
.attendance-summary .deduction strong { color: #8a5b00; }
.attendance-rule { margin-bottom: 14px; padding: 10px 13px; border-left: 3px solid #1c2a78; border-radius: 0 7px 7px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; color: #596579; background: #f1f3fa; font-size: 12px; }
.attendance-rule strong { color: #1c2a78; }
.attendance-layout { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.65fr); align-items: start; gap: 14px; }
.attendance-layout .panel { margin-top: 0; }
.attendance-form { display: grid; gap: 13px; }
.attendance-form label { margin: 0; }
.attendance-form label > span { display: block; margin-bottom: 5px; color: #52606f; font-size: 12px; font-weight: 600; }
.attendance-form label > span b { color: #d63939; }
.attendance-form input, .attendance-form select, .attendance-form textarea { width: 100%; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 6px; color: #182433; background: #fff; font-size: 12px; }
.attendance-form input, .attendance-form select { height: 38px; }
.attendance-form textarea { min-height: 76px; resize: vertical; }
.attendance-form-actions { display: flex; align-items: stretch; gap: 8px; }
.attendance-form-actions .primary-button { flex: 1; }
.attendance-filter { display: grid; grid-template-columns: 150px minmax(170px, 1fr) 170px auto; align-items: end; }
.attendance-table th:first-child { width: 95px; }
.attendance-table th:nth-child(3) { width: 135px; }
.attendance-table th:nth-child(4) { width: 125px; }
.attendance-table th:last-child { width: 100px; }
.attendance-status { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.attendance-status.status-sick { color: #174b83; background: #e3f0fc; }
.attendance-status.status-permit { color: #765500; background: #fff2cc; }
.attendance-status.status-unexcused { color: #b4232a; background: #ffeaeb; }
.payroll-attendance-row { flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; border-radius: 7px; background: #fff7f7; }
.payroll-attendance-row > span small { display: block; margin-top: 2px; color: #84666a; font-size: 12px; font-weight: 500; }
.payroll-attendance-row input[readonly] { color: #b4232a; background: #fff0f0; font-weight: 700; cursor: default; }
.payroll-attendance-row > a { margin-left: auto; color: #a32930; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Compact input modal shared by overtime, cash advances, and attendance. */
.entry-modal {
    width: min(94vw, 520px);
    max-width: 520px;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    color: inherit;
    border: 0;
    border-radius: 12px;
    background: transparent;
}
.entry-modal::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.entry-modal .panel {
    position: relative;
    max-height: calc(100vh - 32px);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #dfe4eb;
    border-radius: 12px;
    box-shadow: 0 22px 64px rgba(15, 23, 42, .24);
}
.entry-modal .panel-inline-title { padding-right: 42px; }
.entry-modal-close {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 14px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: #64748b;
    font-size: 0;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.entry-modal-close::before,
.entry-modal-close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 1.5px;
    border-radius: 99px;
    background: currentColor;
    content: '';
}
.entry-modal-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.entry-modal-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.entry-modal-close:hover { color: #172554; border-color: #aab6c7; background: #f7f9fc; }
.entry-modal .alert { margin: 12px 0 16px; }
.overtime-list-panel,
.cash-advance-list-panel,
.attendance-list-panel { margin-top: 14px; }

@media (max-width: 1100px) {
    .overtime-layout { grid-template-columns: 1fr; }
    .overtime-form-panel { order: -1; }
    .cash-advance-layout { grid-template-columns: 1fr; }
    .cash-advance-form-panel { order: -1; }
    .attendance-layout { grid-template-columns: 1fr; }
    .attendance-form-panel { order: -1; }
}

@media (max-width: 680px) {
    .overtime-rate-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .overtime-rate-grid .overtime-total-card { grid-column: 1 / -1; }
    .overtime-rate-grid article { padding: 13px 14px; }
    .overtime-rate-grid strong { font-size: 16px; }
    .overtime-filter { grid-template-columns: 1fr; }
    .overtime-filter .button { width: 100%; }
    .overtime-form-actions { flex-direction: column; }
    .overtime-form-actions .button { width: 100%; }
    .payroll-overtime-row > a { width: 100%; margin-left: 0; padding-left: 42%; }
    .cash-advance-summary { grid-template-columns: 1fr; gap: 8px; }
    .cash-advance-summary article { padding: 13px 14px; }
    .cash-advance-summary strong { font-size: 16px; }
    .cash-advance-filter { grid-template-columns: 1fr; }
    .cash-advance-filter .button { width: 100%; }
    .cash-advance-form-actions { flex-direction: column; }
    .cash-advance-form-actions .button { width: 100%; }
    .payroll-cash-advance-row > a { width: 100%; margin-left: 0; padding-left: 42%; }
    .attendance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .attendance-summary article { padding: 12px 13px; }
    .attendance-summary strong { font-size: 15px; }
    .attendance-filter { grid-template-columns: 1fr; }
    .attendance-filter .button { width: 100%; }
    .attendance-form-actions { flex-direction: column; }
    .attendance-form-actions .button { width: 100%; }
    .payroll-attendance-row > a { width: 100%; margin-left: 0; padding-left: 42%; }
}

@media (max-width: 580px) {
    .entry-modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
    .entry-modal .panel { max-height: calc(100dvh - 24px); padding: 18px 16px; border-radius: 10px; }
    .entry-modal-close { top: 11px; right: 11px; }
    .entry-modal .overtime-form-actions,
    .entry-modal .cash-advance-form-actions,
    .entry-modal .attendance-form-actions { display: grid; grid-template-columns: 1fr; }
    .entry-modal .overtime-form-actions .button,
    .entry-modal .cash-advance-form-actions .button,
    .entry-modal .attendance-form-actions .button { width: 100%; justify-content: center; }
}

/* Read-only employee portal. */
.employee-portal-page { padding-bottom: 28px; }
.employee-profile-strip { margin-bottom: 14px; padding: 16px 18px; display: flex; align-items: center; gap: 13px; color: #182433; border: 1px solid #dde3eb; border-radius: 9px; background: #fff; }
.employee-profile-strip .employee-profile-avatar { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; color: #fff; border-radius: 10px; background: #1c2a78; font-size: 20px; font-weight: 800; }
.employee-profile-strip h2 { margin: 1px 0 2px; font-size: 19px; }
.employee-profile-strip span { color: #6b7786; font-size: 12px; }
.employee-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.employee-overview-grid > a { min-width: 0; padding: 17px 18px; color: inherit; text-decoration: none; border: 1px solid #dfe4eb; border-radius: 9px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); transition: border-color .15s ease, transform .15s ease; }
.employee-overview-grid > a:hover { border-color: #9aa6cf; transform: translateY(-1px); }
.employee-overview-grid span,
.employee-overview-grid strong,
.employee-overview-grid small { display: block; }
.employee-overview-grid span { color: #687585; font-size: 12px; font-weight: 700; }
.employee-overview-grid strong { margin-top: 6px; overflow: hidden; color: #182433; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.employee-overview-grid small { margin-top: 3px; color: #8793a1; font-size: 12px; }
.employee-welcome-panel h3 { margin: 4px 0 6px; font-size: 18px; }
.employee-welcome-panel p:last-child { max-width: 760px; margin: 0; color: #667382; font-size: 12px; line-height: 1.65; }
.employee-period-toolbar { margin-top: 0; display: flex; align-items: end; justify-content: center; gap: 8px; }
.employee-period-toolbar form { display: flex; align-items: end; gap: 8px; }
.employee-period-toolbar label { margin: 0; }
.employee-period-toolbar label span { display: block; margin-bottom: 4px; color: #657283; font-size: 12px; font-weight: 700; }
.employee-period-toolbar input { height: 36px; padding: 6px 9px; border: 1px solid #d8dee7; border-radius: 6px; }
.employee-payroll-list { display: grid; gap: 12px; }
.employee-payroll-card { margin-top: 0; display: grid; grid-template-columns: minmax(160px, .7fr) minmax(300px, 1.5fr) auto; align-items: center; gap: 20px; }
.employee-payroll-card h3 { margin: 6px 0 1px; font-size: 18px; }
.employee-payroll-card > div > small { color: #7a8796; font-size: 12px; }
.employee-payroll-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.employee-payroll-card dl > div { padding: 10px 12px; border-radius: 7px; background: #f5f7fa; }
.employee-payroll-card dl > .net { background: #eef0fb; }
.employee-payroll-card dt { color: #708091; font-size: 12px; }
.employee-payroll-card dd { margin: 3px 0 0; color: #263344; font-size: 13px; font-weight: 800; }
.employee-payroll-card .net dd { color: #1c2a78; }
.employee-cash-summary { margin-top: 14px; }
.employee-attendance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.employee-section-summary { margin: -2px 0 14px; padding-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e8ebef; color: #647182; font-size: 12px; }
.employee-section-summary strong { color: #1c2a78; font-size: 16px; }
.employee-schedule-panel { overflow: hidden; }
.employee-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(105px, 1fr)); gap: 7px; }
.employee-calendar-grid article { position: relative; min-height: 104px; padding: 10px; border: 1px solid #e0e5eb; border-radius: 7px; background: #fff; }
.employee-calendar-grid article > header { display: flex; align-items: center; justify-content: space-between; color: #718092; font-size: 12px; }
.employee-calendar-grid article > header strong { color: #273545; font-size: 15px; }
.employee-calendar-grid article > b { display: inline-grid; width: 27px; height: 24px; margin-top: 9px; place-items: center; border-radius: 5px; color: #24553b; background: #ddf5e7; font-size: 12px; }
.employee-calendar-grid article > small { display: block; margin-top: 5px; color: #657384; font-size: 12px; }
.employee-calendar-grid article.status-l > b { color: #fff; background: #ed2d32; }
.employee-calendar-grid article.status-sb > b { color: #403600; background: #ffe900; }
.employee-calendar-grid article.is-holiday { border-color: #f2c4c6; background: #fff8f8; }
.employee-calendar-grid article > em { display: block; margin-top: 5px; color: #c1252b; font-size: 12px; line-height: 1.3; }
.employee-schedule-legend { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 18px; }
.employee-schedule-legend > div { min-width: 130px; }
.role-badge.role-employee { color: #24553b; background: #ddf5e7; }

/* Administrator activity log. */
.activity-log-retention { padding: 6px 10px; color: #29613e; border: 1px solid #c9e9d6; border-radius: 99px; background: #edf9f2; font-size: 12px; font-weight: 700; white-space: nowrap; }
.activity-log-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.activity-log-summary article { padding: 15px 17px; border: 1px solid #e0e5eb; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(24,36,51,.04); }
.activity-log-summary span,
.activity-log-summary strong,
.activity-log-summary small { display: block; }
.activity-log-summary span { color: #667382; font-size: 12px; font-weight: 700; }
.activity-log-summary strong { margin-top: 4px; color: #182433; font-size: 19px; }
.activity-log-summary small { margin-top: 2px; color: #8793a1; font-size: 12px; }
.activity-log-summary .warning { border-color: #f1c8c9; background: #fff8f8; }
.activity-log-summary .warning strong { color: #b4232a; }
.activity-log-panel { margin-top: 0; }
.activity-log-filter { display: grid; grid-template-columns: 135px 135px minmax(145px, .8fr) minmax(135px, .7fr) minmax(175px, 1fr) minmax(210px, 1.2fr) auto auto; align-items: end; gap: 9px; }
.activity-log-filter label { min-width: 0; margin: 0; }
.activity-log-filter label > span { display: block; margin-bottom: 4px; color: #657283; font-size: 12px; font-weight: 700; }
.activity-log-filter input,
.activity-log-filter select { width: 100%; height: 36px; padding: 6px 9px; color: #263344; border: 1px solid #d8dee7; border-radius: 6px; background: #fff; font-size: 12px; }
.activity-log-result { margin: 15px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #566477; font-size: 12px; }
.activity-log-result small { color: #84909e; font-size: 12px; }
.activity-log-table th:first-child { width: 105px; }
.activity-log-table th:nth-child(2) { width: 165px; }
.activity-log-table th:nth-child(3) { min-width: 240px; }
.activity-log-table th:nth-child(4) { width: 130px; }
.activity-log-table th:nth-child(5) { width: 120px; }
.activity-log-table th:last-child { width: 80px; }
.activity-log-table td { vertical-align: top; }
.activity-log-table td > strong,
.activity-log-table td > small { display: block; }
.activity-log-table td > small { margin-top: 3px; color: #778494; font-size: 12px; line-height: 1.4; }
.activity-log-table code { color: #4d5b6b; font-size: 12px; white-space: nowrap; }
.activity-event { display: inline-flex; padding: 4px 7px; border-radius: 99px; color: #235b3a; background: #e0f4e7; font-size: 12px; font-weight: 800; white-space: nowrap; }
.activity-event.event-authentication { color: #234b78; background: #e5effa; }
.activity-event.action-login_failed,
.activity-event.action-login_rate_limited { color: #a5262d; background: #ffe9ea; }
.activity-event.action-logout,
.activity-event.action-session_expired_idle,
.activity-event.action-session_expired_absolute { color: #586575; background: #edf0f4; }
.activity-log-details { position: relative; }
.activity-log-details summary { color: #354a96; font-size: 12px; font-weight: 700; cursor: pointer; }
.activity-log-details dl { position: absolute; z-index: 3; top: 21px; right: 0; width: 230px; margin: 0; padding: 9px 11px; border: 1px solid #dce2ea; border-radius: 7px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.14); }
.activity-log-details dl > div { display: grid; grid-template-columns: minmax(80px, .8fr) minmax(0, 1.2fr); gap: 8px; padding: 3px 0; }
.activity-log-details dt { color: #7b8795; font-size: 12px; }
.activity-log-details dd { margin: 0; overflow-wrap: anywhere; color: #263344; font-size: 12px; font-weight: 700; }
.activity-log-card > p { margin: 10px 0; color: #445265; font-size: 12px; line-height: 1.5; }
.activity-log-pagination { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.activity-log-pagination > span { color: #687585; font-size: 12px; }
.activity-log-pagination .button { display: inline-flex; align-items: center; gap: 5px; }
.activity-log-pagination .button.disabled { opacity: .45; pointer-events: none; }
.activity-log-pagination .ui-arrow-icon { width: 17px; height: 17px; }

@media (max-width: 1200px) {
    .activity-log-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .activity-log-filter .activity-log-search { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .employee-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .employee-payroll-card { grid-template-columns: 1fr; gap: 14px; }
    .employee-payroll-card > .button { width: 100%; justify-content: center; }
    .employee-calendar-grid { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
    .activity-log-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .activity-log-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .activity-log-filter .activity-log-search { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
    .employee-profile-strip { padding: 14px; }
    .employee-overview-grid { grid-template-columns: 1fr; gap: 8px; }
    .employee-overview-grid > a { padding: 14px 15px; }
    .employee-period-toolbar { display: grid; grid-template-columns: auto 1fr auto; align-items: end; padding: 13px; }
    .employee-period-toolbar form { display: grid; grid-template-columns: 1fr; }
    .employee-period-toolbar form .button { width: 100%; justify-content: center; }
    .employee-period-toolbar input { width: 100%; }
    .employee-payroll-card dl { grid-template-columns: 1fr; }
    .employee-attendance-summary { grid-template-columns: 1fr; }
    .employee-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .activity-log-summary { gap: 8px; }
    .activity-log-summary article { padding: 13px 14px; }
    .activity-log-filter { grid-template-columns: 1fr; }
    .activity-log-filter .activity-log-search { grid-column: auto; }
    .activity-log-filter .button { width: 100%; justify-content: center; }
    .activity-log-result { align-items: flex-start; flex-direction: column; }
    .activity-log-pagination { justify-content: space-between; gap: 6px; }
    .activity-log-pagination > span { text-align: center; }
}

@page { size: A4 portrait; margin: 14mm 15mm; }
@media print {
    * { box-shadow: none !important; }
    html, body { width: 210mm; min-height: 297mm; margin: 0; color: #111; background: #fff; font-family: Arial, sans-serif; font-size: 10pt; }
    .no-print, .screen-report, .site-header, .site-footer { display: none !important; }
    .print-report { display: block !important; width: 100%; }
    .print-header { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 15px; border-bottom: 2px solid #1c2a78; }
    .print-logo-space { width: 39px; height: 39px; border: 1px solid #aab3ad; }
    .print-logo-space img { width: 100%; height: 100%; object-fit: contain; }
    .print-logo-space.has-logo { width: 72px; height: 72px; border: 0; }
    .print-header p { margin: 0 0 2px; color: #1c2a78; font-size: 7.5pt; font-weight: 700; letter-spacing: 1px; }
    .print-header h1 { margin: 0; font-size: 15pt; }
    .print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 17px; border: 1px solid #d9deda; }
    .print-meta div { padding: 7px 9px; border-bottom: 1px solid #e6e9e7; }
    .print-meta div:nth-child(odd) { border-right: 1px solid #e6e9e7; }
    .print-meta span { display: block; margin-bottom: 2px; color: #69716c; font-size: 7.5pt; }
    .print-meta strong { font-size: 9pt; }
    .print-import-summary { padding: 7px 9px; border: 1px solid #cbded2; background: #f4faf6 !important; font-size: 8pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-import-summary strong, .print-import-summary span { display: block; }
    .print-import-summary span { margin-top: 2px; color: #526158; font-size: 7.5pt; }
    .print-report h2 { margin: 15px 0 7px; color: #21342a; font-size: 10pt; text-transform: uppercase; letter-spacing: .4px; }
    .print-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #b9cfc0; background: #f4faf6; }
    .print-summary div { padding: 9px; border-right: 1px solid #cddfd3; }
    .print-summary div:last-child { border: 0; }
    .print-summary span { display: block; color: #526158; font-size: 7.5pt; }
    .print-summary strong { display: block; margin-top: 3px; color: #1c2a78; font-size: 11pt; }
    .print-report table { font-size: 8.5pt; }
    .print-report th { padding: 7px 8px; color: #fff; background: #1c2a78 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-report td { padding: 7px 8px; }
    .print-emphasis td { color: #07592c; background: #edf8f1 !important; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-scheme { margin-top: 12px; padding: 8px 10px; border: 1px solid #d9deda; display: flex; justify-content: space-between; gap: 15px; font-size: 8pt; }
    .print-settlement { margin-top: 12px; padding: 8px 10px; border: 1px solid #b9cfc0; page-break-inside: avoid; }
    .print-settlement h2 { margin: 0 0 7px; }
    .print-settlement div { width: 32.5%; display: inline-block; }
    .print-settlement div span { display: block; color: #69716c; font-size: 7.5pt; }
    .print-settlement div strong { font-size: 9pt; }
    .print-settlement p { margin: 7px 0 0; padding-top: 6px; border-top: 1px solid #e1e6e2; color: #07592c; font-weight: 700; }
    .signatures { margin-top: 21px; page-break-inside: avoid; }
    .signatures > p { margin: 0 0 9px; font-weight: 700; }
    .signatures > div { display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
    .signature-column { padding: 0 30px; }
    .signature-column > strong { display: block; font-size: 9pt; }
    .signature-mark { height: 58px; display: flex; align-items: flex-end; justify-content: center; }
    .signature-mark img { max-width: 115px; max-height: 55px; object-fit: contain; }
    .signature-column > b { display: block; padding-top: 4px; border-top: 1px solid #2e3832; font-size: 9pt; }
}
