:root{
  --bg:#f6f7fb;--surface:#fff;--surface-soft:#fafafe;--text:#1f2033;--muted:#74768a;
  --line:#e8e8f0;--primary:#6f36d9;--primary-dark:#5927bd;--primary-soft:#f1ebff;
  --accent:#ff5a1f;--accent-dark:#e84a12;--accent-soft:#fff0e9;
  --success:#1fb778;--success-soft:#ecfbf4;--warning:#ee8c2d;--warning-soft:#fff7ed;
  --danger:#ef4857;--danger-soft:#fff0f2;--sidebar:#2f294d;--sidebar-2:#28223f;
  --shadow:0 2px 6px rgba(36,32,59,.04),0 12px 30px rgba(36,32,59,.05);
  --radius:14px;--radius-sm:9px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--text);background:var(--bg)
}
*{box-sizing:border-box}html{min-height:100%}body{margin:0;min-height:100vh;background:var(--bg);color:var(--text);font-size:14px;line-height:1.55}
a{color:var(--primary);text-decoration:none}a:hover{color:var(--primary-dark)}

.app-shell{min-height:100vh;display:grid;grid-template-columns:226px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,var(--sidebar) 0%,var(--sidebar-2) 100%);padding:18px 14px 16px;display:flex;flex-direction:column;color:#fff;box-shadow:8px 0 28px rgba(39,32,65,.07);z-index:30}
.brand{display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:2px 7px 23px;color:#fff!important;min-height:62px}.brand-logo{display:block;width:170px;max-width:100%;height:auto;object-fit:contain}.brand-icon{display:none;width:42px;height:42px;object-fit:contain}.brand-subtitle{display:block;width:100%;padding-left:5px;margin-top:-3px;color:#c0b9d7;font-size:11px;letter-spacing:.02em}.sidebar-section-label{padding:6px 11px 9px;color:#958dac;text-transform:uppercase;letter-spacing:.11em;font-size:9px;font-weight:800}.sidebar-nav{display:flex;flex-direction:column;gap:5px}.nav-link{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:8px;color:#d1cce0;font-weight:600;transition:.16s ease}.nav-link svg,.logout-link svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.nav-link:hover{background:rgba(255,255,255,.075);color:#fff}.nav-link.active{background:linear-gradient(90deg,#7545dd,#6732cc);color:#fff;box-shadow:0 5px 15px rgba(92,46,191,.28)}
.sidebar-footer{margin-top:auto;padding-top:16px;border-top:1px solid rgba(255,255,255,.09)}.user-card{display:flex;align-items:center;gap:10px;padding:4px 9px 12px}.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#6f36d9,#fc5261);color:#fff;font-weight:800;box-shadow:0 5px 13px rgba(0,0,0,.16)}.user-copy{min-width:0;display:flex;flex-direction:column}.user-copy strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}.user-copy span{font-size:9px;color:#9f98b7;letter-spacing:.1em;margin-top:2px}.logout-link{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:8px;color:#afa8c4}.logout-link:hover{background:rgba(255,255,255,.06);color:#fff}

.app-main{min-width:0;display:flex;flex-direction:column;min-height:100vh}.topbar{height:74px;background:rgba(255,255,255,.95);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);padding:0 30px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:20}.topbar-eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.09em;color:#9a9caf;font-weight:800}.topbar-title{font-size:18px;font-weight:780;letter-spacing:-.015em;margin-top:1px}.topbar-role{display:flex;align-items:center;gap:8px;background:#fbfaff;border:1px solid #ece8f5;padding:7px 11px;border-radius:999px;color:#59566e;font-size:11px;font-weight:750}.status-dot{width:7px;height:7px;border-radius:50%;background:#21b879;box-shadow:0 0 0 3px #e8faF2}.content-area{width:100%;max-width:1480px;margin:0 auto;padding:28px 30px 42px;flex:1}.app-footer{text-align:center;color:#aaa9b4;font-size:10px;padding:0 24px 22px}

h1{font-size:28px;line-height:1.2;letter-spacing:-.035em;margin:0 0 21px;font-weight:790}h2{font-size:21px;letter-spacing:-.02em;margin:0 0 10px}h3{font-size:15px;letter-spacing:-.01em;margin:0 0 12px}p{margin:0 0 14px}hr{border:0;border-top:1px solid var(--line);margin:22px 0}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:21px;box-shadow:var(--shadow);margin-bottom:18px}.card>h3:first-child{margin-bottom:7px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:18px}.kpi{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:17px 19px;box-shadow:0 2px 8px rgba(36,32,59,.035);color:#85869a;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;position:relative;overflow:hidden}.kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:linear-gradient(180deg,var(--primary),#9c6cff)}.kpi strong{display:block;color:var(--text);font-size:27px;line-height:1.1;margin-top:8px;letter-spacing:-.035em;text-transform:none}.muted{color:var(--muted)}.ok{color:var(--success)}.warn{color:var(--warning)}.bad{color:var(--danger)}

.flash{position:relative;padding:12px 14px;border-radius:10px;background:var(--primary-soft);border:1px solid #ded0ff;color:#5630a5;margin-bottom:15px}.flash.ok{background:var(--success-soft);border-color:#bcebd5;color:#12865a}.flash.warn{background:var(--warning-soft);border-color:#ffd9af;color:#b66312}.flash.bad{background:var(--danger-soft);border-color:#ffc8ce;color:#bf3542}
label{display:block;font-size:11px;font-weight:780;color:#55566a;margin:13px 0 6px}input,select,textarea{width:100%;min-height:41px;padding:9px 11px;border:1px solid #d9d9e6;border-radius:8px;background:#fff;color:var(--text);font:inherit;outline:none;transition:border-color .15s,box-shadow .15s}textarea{min-height:90px;resize:vertical}input:focus,select:focus,textarea:focus{border-color:#a789ed;box-shadow:0 0 0 3px rgba(111,54,217,.10)}input[type=file]{padding:8px;background:#fdfcff}input:disabled,select:disabled,button:disabled{opacity:.55;cursor:not-allowed}
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:39px;background:var(--accent);color:#fff!important;border:1px solid transparent;border-radius:8px;padding:8px 14px;font:inherit;font-weight:780;line-height:1;cursor:pointer;box-shadow:0 3px 9px rgba(255,90,31,.20);transition:background .15s,transform .05s,box-shadow .15s}button:hover,.btn:hover{background:var(--accent-dark);box-shadow:0 5px 14px rgba(255,90,31,.23)}button:active,.btn:active{transform:translateY(1px)}.btn-secondary{background:#fff!important;color:#514c63!important;border-color:#d9d5e3;box-shadow:none}.btn-secondary:hover{background:#faf9fc!important;border-color:#aaa2ba}.btn-danger{background:#fff!important;color:#cf3b49!important;border-color:#ffc9cf;box-shadow:none}.btn-danger:hover{background:#fff3f4!important}.actions{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}.actions form{margin:0}

.card:has(table){overflow:hidden;padding:0}.card:has(table)>h3{padding:19px 20px 0}.card:has(table)>.flash,.card:has(table)>p{margin-left:20px;margin-right:20px}table{width:100%;border-collapse:separate;border-spacing:0;background:#fff}th,td{padding:11px 14px;border-bottom:1px solid #efeff4;text-align:left;font-size:12px;vertical-align:middle}th{background:#fafafe;color:#8b8c9d;font-size:9.5px;text-transform:uppercase;letter-spacing:.065em;font-weight:850;white-space:nowrap}tr:last-child td{border-bottom:0}tbody tr:hover td{background:#fdfcff}.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#f1ecff;border:1px solid #e3d8ff;color:#6340aa;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.035em}.badge:has(+*){vertical-align:middle}code{background:#f5f3fa;border:1px solid #e7e3ef;padding:2px 6px;border-radius:6px;color:#514c63}

.guest-shell{min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(circle at 16% 0%,#f0eaff 0,transparent 34%),linear-gradient(180deg,#faf9fc,#f2f2f7)}.guest-brand{display:flex;align-items:center;gap:12px;padding:25px 30px;background:var(--sidebar)}.guest-logo{width:170px;height:auto;display:block}.guest-brand span{color:#aaa3bc;font-size:11px}.guest-content{flex:1;display:grid;place-items:center;padding:24px}.login{width:min(440px,100%);margin:0;background:rgba(255,255,255,.97);border:1px solid #e9e6ef;border-radius:18px;padding:31px;box-shadow:0 25px 70px rgba(47,41,77,.11)}.login h2{font-size:25px;margin-bottom:5px}.login button{width:100%;min-height:44px;margin-top:4px}.guest-footer{text-align:center;color:#aaa9b4;font-size:10px;padding:22px}

@media (max-width:1050px){
  .app-shell{grid-template-columns:76px minmax(0,1fr)}.sidebar{padding-left:9px;padding-right:9px}.brand{justify-content:center;padding:1px 0 20px}.brand-logo,.brand-subtitle,.sidebar-section-label,.nav-link span,.user-copy,.logout-link span{display:none}.brand-icon{display:block;width:46px;height:46px}.nav-link{justify-content:center;padding:11px}.nav-link svg{width:20px;height:20px}.user-card{justify-content:center;padding-left:0;padding-right:0}.logout-link{justify-content:center}.topbar{padding:0 22px}.content-area{padding:24px 22px 38px}.sidebar-footer{display:flex;flex-direction:column;align-items:center}.avatar{width:36px;height:36px}
}
@media (max-width:680px){
  .app-shell{display:block}.sidebar{position:sticky;top:0;width:100%;height:auto;z-index:30;padding:8px 12px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px}.brand{padding:0}.brand-icon{width:36px;height:36px}.sidebar-section-label,.sidebar-footer,.brand-logo,.brand-subtitle{display:none}.sidebar-nav{display:flex;flex-direction:row;overflow-x:auto;gap:3px}.nav-link{min-width:42px;padding:9px}.nav-link.active{box-shadow:none;background:#6f36d9}.topbar{height:62px;padding:0 16px;position:static}.topbar-eyebrow{display:none}.topbar-title{font-size:16px}.content-area{padding:19px 14px 30px}h1{font-size:23px}.grid{grid-template-columns:1fr 1fr;gap:10px}.kpi{padding:14px}.kpi strong{font-size:22px}.card{padding:17px;border-radius:12px}.card:has(table){overflow-x:auto}.card:has(table) table{min-width:720px}.actions{align-items:stretch}.actions input,.actions button{width:100%!important}.guest-brand{padding:17px}.guest-logo{width:150px}.login{padding:23px;border-radius:15px}
}
@media (max-width:430px){.grid{grid-template-columns:1fr}.topbar-role{display:none}}

/* v1.6 filing/access-control UI */
.locked-banner{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:16px 18px;margin:0 0 18px;border:1px solid #b7e4ce;background:#ecfdf5;border-radius:12px;color:#14532d}.locked-banner strong{font-size:15px;white-space:nowrap}.locked-banner span{font-size:13px;color:#3f6251}.filing-box{margin-top:18px;padding:18px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:12px}.filing-box h4{margin-top:0}.danger-zone{border-color:#fecaca;background:#fff7f7}.check-row{display:flex!important;align-items:center;gap:9px;margin:12px 0 16px!important;font-weight:600}.check-row input[type=checkbox]{width:17px!important;height:17px!important;margin:0!important;flex:0 0 auto}.status-ready{background:#ecfdf5!important;color:#047857!important}.status-generated{background:#eff6ff!important;color:#1d4ed8!important}.status-locked{background:#ede9fe!important;color:#6d28d9!important}.status-needs_review{background:#fff7ed!important;color:#c2410c!important}@media(max-width:760px){.locked-banner{display:block}.locked-banner strong{display:block;margin-bottom:5px}}

/* v1.9 historical GST tax/state mismatch safety */
.tax-mismatch-card{border-color:#fecaca!important;background:linear-gradient(180deg,#fff,#fffafa)!important}
.tax-mismatch-card .section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 20px 0}
.tax-mismatch-card .section-heading h3{color:#b4232f;margin-bottom:5px}
.tax-mismatch-card .table-wrap{overflow-x:auto}
.tax-mismatch-card table{min-width:980px}
.tax-mismatch-card td strong{color:#8f1d28}
.tax-mismatch-card .flash.warn{margin:16px 20px 20px}
@media(max-width:760px){.tax-mismatch-card .section-heading{display:block}.tax-mismatch-card .section-heading .badge{margin-top:8px}}


/* v2.1 final GSTR cleanup */
.card{padding:24px}
.card:has(table)>h3{padding:22px 24px 0}
.card:has(table)>.flash,.card:has(table)>p{margin-left:24px;margin-right:24px}
input,select,textarea{min-height:43px;padding:10px 13px}
label{margin-top:15px}
.form-actions{margin-top:18px}

/* Branding: keep the SoftSprint logo clean without an additional Accounts label. */
.brand{padding-bottom:20px;min-height:58px}
.brand-logo{width:176px}
.guest-brand{padding:22px 30px}
.guest-logo{width:205px}

/* Login spacing and polish. */
.login{width:min(460px,100%);padding:36px 36px 32px}
.login h2{font-size:26px;margin-bottom:6px}
.login-intro{margin-bottom:20px}
.login-form label{margin-top:14px;margin-bottom:7px}
.login-form input{min-height:45px}
.login-submit{margin-top:20px}
.login-submit button{width:100%;min-height:46px;margin:0}
.login-help{margin:16px 0 0;font-size:12px}

/* New run form: compact month selector rather than a full-width control. */
.new-run-card{padding:26px 28px 28px}
.return-period-field{width:min(340px,100%)}
.return-period-field input{width:100%;cursor:pointer}
.return-period-help{margin-top:7px;max-width:720px}
.advanced-options{margin-top:18px}
.advanced-options-body{padding-top:6px;max-width:760px}

/* Duplicate invoice warning is informational and never blocks generation. */
.duplicate-invoice-card{border-color:#f4d6a8;background:linear-gradient(180deg,#fff,#fffdf8)}
.duplicate-invoice-card .section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.duplicate-invoice-card .section-heading h3{margin-bottom:5px;color:#9a5b14}
.duplicate-invoice-card .table-wrap{overflow-x:auto;margin-top:10px}
.duplicate-invoice-card table{min-width:720px}
.status-warning{background:#fff7ed!important;color:#b45309!important;border-color:#fed7aa!important}

@media(max-width:680px){
  .card{padding:19px}
  .new-run-card{padding:20px}
  .return-period-field{width:100%}
  .guest-brand{padding:16px 18px}
  .guest-logo{width:180px}
  .login{padding:26px 22px 24px}
  .duplicate-invoice-card .section-heading{display:block}
  .duplicate-invoice-card .section-heading .badge{margin-top:8px}
}

/* v2.1.1 section spacing hotfix
   Cards that contain tables intentionally let the table run edge-to-edge.
   Keep the headings/descriptions and details controls inside the normal card gutter. */
.card:has(table):not(.tax-mismatch-card) > .section-heading{
  padding:22px 24px 4px;
}
.card:has(table) > details > summary{
  margin:0;
  padding:11px 24px 10px;
}
.card:has(table) > details > .table-wrap{
  margin-top:0;
}
.duplicate-invoice-card .table-wrap{
  margin-top:0;
}

@media(max-width:680px){
  .card:has(table):not(.tax-mismatch-card) > .section-heading{
    padding:18px 19px 4px;
  }
  .card:has(table) > details > summary{
    padding:10px 19px 9px;
  }
}

/* v2.2.6.1 History + User Activity UI polish */
.page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:20px}
.page-heading h1{margin-bottom:5px}.page-subtitle{margin:0;max-width:760px;font-size:13px}
.nowrap{white-space:nowrap}.period-text{font-weight:650;color:#343548}
.btn-compact{min-height:34px;padding:7px 12px;border-radius:8px;font-size:11px;box-shadow:none}
.btn-open{background:#fff!important;color:var(--primary)!important;border-color:#ddd2f5;box-shadow:none}
.btn-open:hover{background:var(--primary-soft)!important;border-color:#cbb8f2;color:var(--primary-dark)!important}

.history-card{overflow:hidden!important}.history-card .table-wrap{overflow-x:auto}.history-table{min-width:920px}
.history-table th,.history-table td{padding-top:12px;padding-bottom:12px}.history-actions-head{text-align:right;padding-right:20px}
.history-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;white-space:nowrap}.history-actions form{margin:0}
.history-note,.activity-info{display:flex;align-items:flex-start;gap:9px;color:#6f7082;font-size:12px;line-height:1.55}
.history-note{margin:4px 2px 0}.history-note-icon{flex:0 0 20px;width:20px;height:20px;border-radius:50%;display:inline-grid;place-items:center;background:#f0ebff;color:var(--primary);font-size:11px;font-weight:850;margin-top:0}

.user-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.user-actions form{margin:0}
.user-activity-heading{align-items:center}.back-button{min-height:38px;box-shadow:none;white-space:nowrap}.back-button span{font-size:16px;line-height:1}
.user-profile-card{padding:26px 28px!important}.user-profile-main{display:flex;align-items:center;gap:15px;margin-bottom:22px}
.user-profile-avatar{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,#6f36d9,#9b6cf0);color:#fff;font-size:20px;font-weight:850;box-shadow:0 8px 18px rgba(111,54,217,.18)}
.user-profile-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.user-profile-title-row h2{font-size:21px;margin:0;letter-spacing:-.025em}.user-profile-email{margin:4px 0 0;font-size:13px}
.activity-kpis{display:grid;grid-template-columns:1.25fr 1.25fr .7fr;gap:14px}.activity-kpi{border:1px solid #eceaf3;background:linear-gradient(180deg,#fff,#fbfaff);border-radius:12px;padding:15px 17px;position:relative;overflow:hidden}.activity-kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:linear-gradient(180deg,var(--primary),#9c6cff)}.activity-kpi span{display:block;color:#8c8d9f;font-size:9.5px;text-transform:uppercase;letter-spacing:.07em;font-weight:850}.activity-kpi strong{display:block;margin-top:7px;color:#252638;font-size:14px;line-height:1.35}
.activity-card{padding:0!important;overflow:hidden!important}.activity-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 24px 14px}.activity-card-header h3{margin:0 0 4px;font-size:16px}.activity-card-header p{margin:0}.activity-info{margin:0 24px 16px;padding:10px 12px;background:#faf9fe;border:1px solid #ece8f5;border-radius:9px}.activity-count{white-space:nowrap;background:#f7f4ff!important;color:#6641b7!important;border-color:#e6dcff!important}.activity-table{min-width:720px}.work-activity-table{min-width:980px}.activity-name{font-weight:650;color:#343548}.reference-text{color:#66677a}.browser-text{display:block;max-width:360px;color:#77788b;white-space:normal;word-break:break-word;font-size:11px;line-height:1.4}.ip-code{white-space:nowrap;background:#f7f6fa;border-color:#ece9f1;color:#55566a;font-size:11px}

@media(max-width:820px){.activity-kpis{grid-template-columns:1fr 1fr}.activity-kpi:last-child{grid-column:1/-1}.page-heading{display:block}.page-heading .back-button{margin-top:12px}.history-actions{justify-content:flex-start}}
@media(max-width:680px){.user-profile-card{padding:20px!important}.user-profile-main{align-items:flex-start}.activity-kpis{grid-template-columns:1fr}.activity-kpi:last-child{grid-column:auto}.activity-card-header{padding:18px 19px 12px}.activity-info{margin:0 19px 14px}.history-note{padding:0 2px}.user-actions{gap:6px}}

/* v2.2.6.2 run identity, responsive issue badges, processing + confirmation modals */
.run-number{display:inline-flex;align-items:center;justify-content:center;min-width:42px;padding:5px 8px;border:1px solid #e6e1f2;background:#faf8ff;border-radius:8px;color:#6542b7;font-size:11px;font-weight:850;white-space:nowrap}
.issue-count-badge{flex:0 0 auto;display:inline-flex!important;align-items:center;justify-content:center;min-width:auto!important;max-width:none!important;width:auto!important;padding:6px 10px!important;border-radius:999px!important;white-space:nowrap!important;line-height:1!important;font-size:9px!important;letter-spacing:.035em!important;text-transform:uppercase}
.tax-mismatch-card .section-heading,.duplicate-invoice-card .section-heading{align-items:flex-start}

body.modal-open{overflow:hidden}
.ss-modal-backdrop,.ss-processing-backdrop{position:fixed;inset:0;z-index:9999;background:rgba(24,24,35,.55);display:grid;place-items:center;padding:18px;backdrop-filter:blur(2px)}
.ss-modal-backdrop[hidden],.ss-processing-backdrop[hidden]{display:none!important}
.ss-modal{width:min(460px,100%);background:#fff;border:1px solid #e5e3ec;border-radius:14px;box-shadow:0 24px 70px rgba(20,18,35,.26);overflow:hidden;animation:ssModalIn .16s ease-out}
.ss-modal-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 20px;border-bottom:1px solid #eceaf1;background:#fbfaff}.ss-modal-header h3{margin:0;font-size:17px}.ss-modal-close{width:32px;height:32px;padding:0!important;margin:0!important;background:transparent!important;color:#9993a6!important;border:0!important;box-shadow:none!important;font-size:24px;line-height:1}.ss-modal-close:hover{color:#4d465d!important;background:#f1edf8!important}
.ss-modal-body{padding:21px 20px 19px}.ss-modal-body p{margin:0;color:#555668;font-size:13px;line-height:1.6}
.ss-modal-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:14px 20px 18px;background:#fff}.ss-modal-footer .btn,.ss-modal-footer button{min-height:38px;margin:0;padding:8px 15px;box-shadow:none}
.ss-modal-footer .btn-danger{background:#dc3545!important;border-color:#dc3545!important;color:#fff!important}.ss-modal-footer .btn-danger:hover{background:#c92f3e!important;border-color:#c92f3e!important}

.ss-processing-card{width:min(420px,100%);padding:31px 28px 27px;text-align:center;background:#fff;border:1px solid #e7e3f1;border-radius:16px;box-shadow:0 24px 70px rgba(20,18,35,.25);animation:ssModalIn .16s ease-out}.ss-processing-card h3{margin:16px 0 7px;font-size:19px}.ss-processing-card p{margin:0 auto;color:#68697b;font-size:13px;line-height:1.55;max-width:330px}.ss-processing-note{margin-top:13px;color:#9a97a8;font-size:11px}.ss-spinner{width:42px;height:42px;margin:0 auto;border:4px solid #eee9fb;border-top-color:var(--primary);border-radius:50%;animation:ssSpin .8s linear infinite}
@keyframes ssSpin{to{transform:rotate(360deg)}}@keyframes ssModalIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}

@media(max-width:680px){
  .tax-mismatch-card .section-heading,.duplicate-invoice-card .section-heading{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:9px!important}
  .tax-mismatch-card .section-heading .issue-count-badge,.duplicate-invoice-card .section-heading .issue-count-badge{margin:0!important;align-self:flex-start!important}
  .ss-modal-footer{display:grid;grid-template-columns:1fr 1fr}.ss-modal-footer .btn,.ss-modal-footer button{width:100%!important}
  .ss-processing-card{padding:27px 20px 23px}
}

/* v2.2.6.3 responsive issue badges + reliable processing states */
.js-processing-form .is-processing{pointer-events:none;opacity:.72}
@media(max-width:900px){
  .tax-mismatch-card .section-heading,.duplicate-invoice-card .section-heading{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:10px!important}
  .tax-mismatch-card .issue-count-badge,.duplicate-invoice-card .issue-count-badge{align-self:flex-start!important;margin:0!important;white-space:nowrap!important;line-height:1!important;padding:6px 9px!important;font-size:8.5px!important}
}

/* v2.2.6.4 compact issue chips + reliable visible processing state */
.issue-count-badge{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  width:auto!important;min-width:0!important;max-width:100%!important;height:auto!important;
  padding:5px 8px!important;border-radius:8px!important;
  white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;
  line-height:1.1!important;font-size:8.5px!important;letter-spacing:.025em!important;
}
@media(max-width:900px){
  .tax-mismatch-card .section-heading,.duplicate-invoice-card .section-heading{
    display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:8px!important;
  }
  .tax-mismatch-card .issue-count-badge,.duplicate-invoice-card .issue-count-badge{
    align-self:flex-start!important;margin:0!important;
  }
}

/* Accounts Phase 1 — Financial Dashboard + Sales */
.sidebar-nav-grouped .sidebar-section-label{margin:18px 12px 7px}.sidebar-nav-grouped .sidebar-section-label:first-child{margin-top:4px}
.eyebrow-pill{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;background:#f2edff;color:#6d42cc;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.075em;margin-bottom:8px}
.accounts-heading{align-items:center}.accounts-dashboard{max-width:1280px;margin:0 auto}.dashboard-period-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:-4px 0 18px;padding:10px 12px;background:#fff;border:1px solid #e9e7ef;border-radius:13px;box-shadow:0 5px 18px rgba(36,29,61,.045)}
.period-tabs{display:flex;gap:5px}.period-tab{min-height:34px!important;padding:7px 12px!important;margin:0!important;border-radius:8px!important;background:transparent!important;color:#66677a!important;border:1px solid transparent!important;box-shadow:none!important;font-size:11px!important}.period-tab:hover{background:#f7f4ff!important;color:var(--primary)!important}.period-tab.active{background:#eee7ff!important;color:#6638c6!important;border-color:#ded0ff!important}
.custom-period{display:flex;align-items:center;gap:8px}.custom-period input{width:145px;min-height:34px;padding:7px 9px;margin:0}.custom-period span{font-size:11px;color:#9993a3}
.finance-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:16px}.finance-kpi{position:relative;padding:19px 18px;border:1px solid #e9e7ef;background:linear-gradient(180deg,#fff,#fcfbff);border-radius:14px;box-shadow:0 8px 24px rgba(35,28,61,.055);overflow:hidden}.finance-kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#b798ff}.finance-kpi.primary:before{background:linear-gradient(180deg,#6d36d8,#ff7a45)}.finance-kpi span{display:block;color:#85869a;font-size:9px;font-weight:850;letter-spacing:.075em;text-transform:uppercase}.finance-kpi strong{display:block;margin-top:7px;color:#222437;font-size:23px;line-height:1.15;letter-spacing:-.035em}.finance-kpi small{display:block;margin-top:8px;color:#8d8e9e;font-size:10.5px;line-height:1.35}
.dashboard-split{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.75fr);gap:16px;margin-bottom:16px}.chart-card,.quick-links-card,.recent-sales-card{padding:0!important;overflow:hidden}.card-header-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 22px 12px}.card-header-row h3{margin:0 0 3px;font-size:16px}.card-header-row p{margin:0;font-size:11.5px}.text-link{font-size:11px;color:var(--primary);font-weight:750;text-decoration:none;white-space:nowrap}.text-link:hover{text-decoration:underline}
.sales-chart{height:230px;padding:4px 20px 0;color:#7442dd;display:flex;align-items:center;justify-content:center}.sales-chart svg{width:100%;height:100%;overflow:visible}.empty-state{color:#9993a5;font-size:12px;padding:60px 10px}.chart-foot{display:flex;gap:24px;padding:11px 22px 18px;border-top:1px solid #f0eef4;color:#85869a;font-size:10.5px}.chart-foot strong{color:#333446;margin-left:4px}
.quick-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:4px 18px 18px}.quick-action{min-height:105px;padding:15px;border:1px solid #ebe7f2;border-radius:12px;background:#fff;text-decoration:none;color:#343548;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;transition:.15s ease}.quick-action:hover{border-color:#d7c7fa;background:#faf8ff;transform:translateY(-1px);box-shadow:0 8px 18px rgba(83,55,143,.07)}.quick-action.disabled{opacity:.55;pointer-events:none}.qa-icon{width:31px;height:31px;border-radius:9px;background:#f1ebff;color:#7040d3;display:grid;place-items:center;font-weight:900;margin-bottom:9px}.quick-action strong{font-size:12px}.quick-action small{margin-top:4px;color:#9596a6;font-size:10px}
.recent-sales-card .table-wrap{margin-top:0}.recent-sales-card table{margin:0}.table-sub{margin-top:3px;color:#999aaa;font-size:9.5px}.num{text-align:right;white-space:nowrap}.empty-cell{text-align:center!important;color:#9a96a5!important;padding:32px!important}.sales-cat{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;font-size:8px;font-weight:850;letter-spacing:.04em}.cat-b2b{background:#eee9ff;color:#6440ba}.cat-b2c{background:#e9f8ef;color:#18764a}.cat-export{background:#eaf4ff;color:#2469aa}.cat-refunded{background:#f2eafa;color:#7a48a5}
.sales-filter-bar{display:grid;grid-template-columns:160px 160px 170px minmax(230px,1fr) auto;align-items:end;gap:12px;padding:15px;background:#fff;border:1px solid #e9e7ef;border-radius:13px;margin-bottom:15px;box-shadow:0 5px 18px rgba(36,29,61,.04)}.sales-filter-bar label{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:#8d8e9e;font-weight:850;margin-bottom:6px}.sales-filter-bar input,.sales-filter-bar select{margin:0;min-height:39px}.sales-filter-bar button{margin:0;min-height:39px}.sales-summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:15px}.sales-summary-grid>div{padding:15px 17px;background:#fff;border:1px solid #e9e7ef;border-radius:12px}.sales-summary-grid span{display:block;color:#8d8e9e;text-transform:uppercase;font-size:8.5px;font-weight:850;letter-spacing:.07em}.sales-summary-grid strong{display:block;margin-top:6px;font-size:17px;color:#28293c}.sales-ledger-card{padding:0!important;overflow:hidden!important}.sales-ledger-table{min-width:1120px}.sales-ledger-table th,.sales-ledger-table td{padding:11px 12px}.table-limit-note{padding:11px 15px;border-top:1px solid #eceaf1;background:#faf9fc;color:#7e7f91;font-size:10.5px}
@media(max-width:1100px){.finance-kpi-grid{grid-template-columns:repeat(3,1fr)}.dashboard-split{grid-template-columns:1fr}.sales-filter-bar{grid-template-columns:1fr 1fr 1fr}.sales-search{grid-column:1/3}.sales-filter-bar button{grid-column:3}}
@media(max-width:760px){.accounts-heading .btn{margin-top:12px}.dashboard-period-bar{align-items:stretch}.period-tabs{width:100%;overflow:auto}.period-tab{flex:1;white-space:nowrap}.custom-period{width:100%;display:grid;grid-template-columns:1fr auto 1fr auto}.custom-period input{width:100%}.finance-kpi-grid{grid-template-columns:1fr 1fr}.finance-kpi strong{font-size:20px}.sales-chart{height:190px}.quick-action-grid{grid-template-columns:1fr 1fr}.sales-filter-bar{grid-template-columns:1fr 1fr}.sales-filter-bar>div:nth-child(3),.sales-search,.sales-filter-bar button{grid-column:auto}.sales-filter-bar button{grid-column:1/-1}.sales-summary-grid{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.finance-kpi-grid{grid-template-columns:1fr}.quick-action-grid{grid-template-columns:1fr}.custom-period{grid-template-columns:1fr 1fr}.custom-period span{display:none}.custom-period .btn{grid-column:1/-1}.sales-filter-bar{grid-template-columns:1fr}.sales-filter-bar>*{grid-column:1!important}.sales-summary-grid{grid-template-columns:1fr 1fr}.card-header-row{padding:18px 18px 11px}.chart-foot{padding-left:18px}.finance-kpi{padding:17px 16px}}

/* Accounts Phase 1.1 — recognised paid WooCommerce statuses */
.sales-status{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:#f3f1f8;color:#5f6072;font-size:8.5px;font-weight:800;white-space:nowrap;text-transform:capitalize}
.sales-filter-bar{grid-template-columns:150px 150px 160px 190px minmax(220px,1fr) auto}
@media(max-width:1100px){.sales-filter-bar{grid-template-columns:1fr 1fr 1fr}.sales-search{grid-column:auto}.sales-filter-bar button{grid-column:auto}}
@media(max-width:760px){.sales-filter-bar{grid-template-columns:1fr 1fr}.sales-filter-bar button{grid-column:1/-1}}
@media(max-width:520px){.sales-filter-bar{grid-template-columns:1fr}.sales-filter-bar>*{grid-column:1!important}}
\n\n/* Phase 1.2: sales status compatibility + mobile ledger cards */\n@media(max-width:760px){\n  .sales-ledger-card{background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}\n  .sales-ledger-card .table-wrap{overflow:visible!important}\n  .sales-ledger-table{min-width:0!important;width:100%!important;border-collapse:separate!important;border-spacing:0 10px!important}\n  .sales-ledger-table thead{display:none!important}\n  .sales-ledger-table tbody,.sales-ledger-table tr,.sales-ledger-table td{display:block!important;width:100%!important;box-sizing:border-box!important}\n  .sales-ledger-table tr{position:relative;background:#fff;border:1px solid #e9e7ef;border-radius:14px;box-shadow:0 6px 18px rgba(36,29,61,.05);padding:12px 14px;margin-bottom:10px;overflow:hidden}\n  .sales-ledger-table td{display:grid!important;grid-template-columns:112px minmax(0,1fr)!important;gap:10px;align-items:start;padding:7px 0!important;border:0!important;text-align:left!important;white-space:normal!important;min-width:0!important}\n  .sales-ledger-table td:before{content:attr(data-label);font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.055em;color:#8b8c9d;padding-top:2px}\n  .sales-ledger-table td.num{text-align:left!important}\n  .sales-ledger-table .sales-total-cell{margin-top:5px;padding-top:11px!important;border-top:1px solid #efedf3!important}\n  .sales-ledger-table .sales-total-cell strong{font-size:16px;color:#242139}\n  .sales-ledger-table .table-sub{overflow-wrap:anywhere}\n}\n@media(max-width:430px){\n  .sales-ledger-table td{grid-template-columns:92px minmax(0,1fr)!important}\n}\n
/* Phase 1.4 sales refresh actions */
.sales-heading-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
@media(max-width:700px){.sales-heading-actions{width:100%}.sales-heading-actions .btn{flex:1 1 180px;text-align:center}}

/* Accounts Phase 1.5 — dashboard finalisation, sales pagination and detail view */
.finance-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.finance-kpi.net-sales:before{background:linear-gradient(180deg,#16a36a,#7c4dff)}
.sales-summary-five{grid-template-columns:repeat(5,minmax(0,1fr))}
.sales-summary-five small{display:block;margin-top:5px;color:#9394a5;font-size:9.5px}
.sales-status.status-processing{background:#eaf3ff;color:#2868a8}
.sales-status.status-creatingbacklinks{background:#f2ecff;color:#6b3cc3}
.sales-status.status-completed{background:#e8f8ef;color:#13784a}
.sales-status.status-refunded{background:#f8eaf1;color:#a13d6b}
.invoice-link,.order-link{color:#4f2fb7;text-decoration:none}.invoice-link:hover,.order-link:hover{text-decoration:underline}
.row-view-link{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:5px 9px;border:1px solid #e1d8f4;border-radius:8px;color:#6438c2;text-decoration:none;font-size:9.5px;font-weight:800;background:#faf8ff;white-space:nowrap}.row-view-link:hover{background:#f1ebff}
.sales-pagination{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;border-top:1px solid #eceaf1;background:#faf9fc}.pagination-info{font-size:10.5px;color:#7d7e90}.pagination-links{display:flex;align-items:center;gap:9px}.page-btn{display:inline-flex;align-items:center;min-height:31px;padding:6px 10px;border:1px solid #ded8e9;border-radius:8px;background:#fff;color:#5c3ab0;text-decoration:none;font-size:10px;font-weight:750}.page-btn:hover{background:#f5f1ff}.page-current{font-size:10px;color:#777889;white-space:nowrap}
.sale-detail-heading{align-items:center}.sale-detail-hero{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:22px;padding:20px 22px!important}.detail-label{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.07em;color:#8c8d9e;font-weight:850}.detail-invoice{display:block;font-size:22px;color:#242438;margin-top:5px}.detail-sub{display:block;margin-top:4px;color:#9091a1;font-size:10.5px}.detail-badges{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.detail-total{text-align:right}.detail-total span{display:block;color:#8b8c9c;font-size:9px;text-transform:uppercase;font-weight:850;letter-spacing:.06em}.detail-total strong{display:block;margin-top:5px;font-size:24px;color:#25263a}.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.detail-card{padding:20px!important;margin:0!important}.detail-card h3{margin:0 0 14px;font-size:14px}.detail-card dl{margin:0}.detail-card dl>div{display:grid;grid-template-columns:145px minmax(0,1fr);gap:16px;padding:9px 0;border-bottom:1px solid #f0eef4}.detail-card dl>div:last-child{border-bottom:0}.detail-card dt{font-size:9px;text-transform:uppercase;letter-spacing:.055em;color:#9293a3;font-weight:850}.detail-card dd{margin:0;color:#303144;font-size:11.5px;overflow-wrap:anywhere}.detail-tax .detail-total-row{margin-top:4px;padding-top:13px;border-top:2px solid #ece7f7}.detail-tax .detail-total-row dd{font-size:16px;font-weight:850;color:#222338}
@media(max-width:1100px){.sales-summary-five{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.finance-kpi-grid{grid-template-columns:1fr 1fr}.sales-summary-five{grid-template-columns:1fr 1fr}.sales-pagination{align-items:flex-start;flex-direction:column}.sale-detail-hero{grid-template-columns:1fr}.detail-total{text-align:left}.detail-grid{grid-template-columns:1fr}.sales-ledger-table td:last-child{border-top:1px solid #efedf3!important;margin-top:4px;padding-top:10px!important}.row-view-link{width:100%;box-sizing:border-box}.detail-badges{justify-content:flex-start}}
@media(max-width:520px){.finance-kpi-grid{grid-template-columns:1fr}.sales-summary-five{grid-template-columns:1fr 1fr}.pagination-links{width:100%;justify-content:space-between}.detail-card dl>div{grid-template-columns:105px minmax(0,1fr)}.detail-invoice{font-size:19px}}

/* Phase 1.6: final responsive Sales Ledger card layout */
@media(max-width:980px){
  .sales-ledger-card{background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;padding:0!important}
  .sales-ledger-card .table-wrap{overflow:visible!important}
  .sales-ledger-table{min-width:0!important;width:100%!important;border-collapse:separate!important;border-spacing:0 12px!important}
  .sales-ledger-table thead{display:none!important}
  .sales-ledger-table tbody{display:block!important;width:100%!important}
  .sales-ledger-table tr{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:0 16px!important;position:relative;background:#fff;border:1px solid #e8e5ef;border-radius:15px;box-shadow:0 7px 22px rgba(36,29,61,.055);padding:15px 16px;margin:0 0 12px;overflow:hidden;width:100%!important;box-sizing:border-box!important}
  .sales-ledger-table td{display:block!important;width:auto!important;padding:0!important;border:0!important;white-space:normal!important;min-width:0!important;text-align:left!important}
  .sales-ledger-table td:before{display:none!important}
  .sales-ledger-table td[data-label="Invoice"]{grid-column:1;grid-row:1;margin-bottom:3px}
  .sales-ledger-table td[data-label="Total"]{grid-column:2;grid-row:1/3;text-align:right!important;align-self:start;padding-top:1px!important;margin:0!important;border:0!important}
  .sales-ledger-table td[data-label="Total"] strong{font-size:16px;color:#242139;white-space:nowrap}
  .sales-ledger-table td[data-label="Order"]{grid-column:1;grid-row:2;font-size:10px;margin-bottom:12px}
  .sales-ledger-table td[data-label="Customer"]{grid-column:1/3;grid-row:3;margin-bottom:10px}
  .sales-ledger-table td[data-label="Customer"]>strong{font-size:13px;color:#28263b}
  .sales-ledger-table td[data-label="Status"]{grid-column:1;grid-row:4;margin-bottom:12px}
  .sales-ledger-table td[data-label="Category"]{grid-column:2;grid-row:4;text-align:right!important;margin-bottom:12px}
  .sales-ledger-table td[data-label="Date"],
  .sales-ledger-table td[data-label="GSTIN / POS"],
  .sales-ledger-table td[data-label="Currency"],
  .sales-ledger-table td[data-label="Taxable"],
  .sales-ledger-table td[data-label="GST"]{display:grid!important;grid-template-columns:94px minmax(0,1fr)!important;gap:10px;align-items:start;grid-column:1/3;padding:7px 0!important;border-top:1px solid #f0eef4!important;font-size:11px}
  .sales-ledger-table td[data-label="Date"]{grid-row:5}
  .sales-ledger-table td[data-label="GSTIN / POS"]{grid-row:6}
  .sales-ledger-table td[data-label="Currency"]{grid-row:7}
  .sales-ledger-table td[data-label="Taxable"]{grid-row:8;text-align:left!important}
  .sales-ledger-table td[data-label="GST"]{grid-row:9;text-align:left!important}
  .sales-ledger-table td[data-label="Date"]:before,
  .sales-ledger-table td[data-label="GSTIN / POS"]:before,
  .sales-ledger-table td[data-label="Currency"]:before,
  .sales-ledger-table td[data-label="Taxable"]:before,
  .sales-ledger-table td[data-label="GST"]:before{display:block!important;content:attr(data-label);font-size:8.5px;font-weight:850;text-transform:uppercase;letter-spacing:.06em;color:#9293a3;padding-top:1px}
  .sales-ledger-table td:last-child{grid-column:1/3;grid-row:10;border-top:1px solid #ece9f1!important;margin-top:4px;padding-top:11px!important}
  .sales-ledger-table .row-view-link{display:flex!important;align-items:center;justify-content:center;width:100%;min-height:36px;box-sizing:border-box;border-radius:9px}
  .sales-ledger-table .table-sub{overflow-wrap:anywhere}
  .sales-summary-five{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:600px){
  .sales-filter-bar{grid-template-columns:1fr!important}
  .sales-filter-bar>*{grid-column:1!important}
  .sales-summary-five{grid-template-columns:1fr 1fr!important}
  .sales-heading-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%;gap:9px!important}
  .sales-heading-actions .btn{width:100%;box-sizing:border-box;text-align:center;padding-left:10px;padding-right:10px}
}
@media(max-width:420px){
  .sales-ledger-table tr{padding:14px}
  .sales-ledger-table td[data-label="Date"],
  .sales-ledger-table td[data-label="GSTIN / POS"],
  .sales-ledger-table td[data-label="Currency"],
  .sales-ledger-table td[data-label="Taxable"],
  .sales-ledger-table td[data-label="GST"]{grid-template-columns:82px minmax(0,1fr)!important}
  .sales-summary-five{grid-template-columns:1fr!important}
  .sales-heading-actions{grid-template-columns:1fr!important}
}

/* Phase 1.7 — modern Sales Ledger polish */
.sales-heading-actions{gap:14px!important}
.sales-heading-actions .btn{min-height:40px;padding:10px 16px!important;border-radius:10px!important;font-size:11px!important;font-weight:800!important;box-shadow:0 5px 14px rgba(36,29,61,.06)}
.sales-heading-actions .btn+.btn{margin-left:2px}
.sales-ledger-card{border-radius:15px!important;box-shadow:0 8px 26px rgba(37,30,62,.055)!important;border-color:#e8e5ef!important}
.sales-ledger-table th{font-size:9px!important;letter-spacing:.065em!important;color:#89899a!important;background:#faf9fc!important;padding-top:12px!important;padding-bottom:12px!important}
.sales-ledger-table td{font-size:11.25px!important;line-height:1.42!important;padding-top:12px!important;padding-bottom:12px!important;vertical-align:middle!important}
.sales-ledger-table tbody tr{transition:background .14s ease,box-shadow .14s ease}
.sales-ledger-table tbody tr:hover{background:#fcfbff!important;box-shadow:inset 3px 0 0 #8b5cf6}
.sales-ledger-table td strong{font-size:11.75px!important}
.sales-ledger-table .table-sub{font-size:9.75px!important;line-height:1.35!important;margin-top:4px!important;color:#9293a2!important}
.invoice-link,.order-link{font-weight:800!important}
.row-view-link{min-height:32px!important;padding:6px 11px!important;border-radius:9px!important;font-size:10px!important}
.sales-status,.sales-cat{font-size:8.75px!important;padding:4px 8px!important}
.sales-pagination{padding:15px 17px!important;background:#fff!important;border-top:1px solid #eceaf1!important}
.pagination-info{font-size:11px!important;color:#7f8090!important}
.pagination-links{display:flex!important;align-items:center!important;gap:0!important;border:1px solid #ddd8e7!important;border-radius:9px!important;overflow:hidden;background:#fff;box-shadow:0 3px 10px rgba(36,29,61,.035)}
.pagination-links .page-btn{min-width:36px!important;height:36px!important;padding:0 10px!important;border:0!important;border-right:1px solid #e8e4ed!important;border-radius:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:11px!important;font-weight:800!important;color:#5f3abd!important;background:#fff!important;box-sizing:border-box}
.pagination-links .page-btn:last-child{border-right:0!important}
.pagination-links .page-btn:hover{background:#f4f0ff!important;color:#5427ba!important}
.pagination-links .page-btn.active{background:#6d3fe0!important;color:#fff!important}
.pagination-links .page-btn.disabled{color:#b6b2bf!important;background:#f7f6f8!important;pointer-events:none}
.page-ellipsis{height:36px;min-width:34px;display:inline-flex;align-items:center;justify-content:center;border-right:1px solid #e8e4ed;color:#9d99a7;font-size:12px;background:#fff}
@media(max-width:980px){
  .sales-ledger-table tr{padding:18px!important;border-radius:16px!important;box-shadow:0 8px 24px rgba(36,29,61,.065)!important}
  .sales-ledger-table td[data-label="Invoice"] strong{font-size:14px!important}
  .sales-ledger-table td[data-label="Total"] strong{font-size:18px!important}
  .sales-ledger-table td[data-label="Customer"]>strong{font-size:13.5px!important}
  .sales-ledger-table td[data-label="Order"]{font-size:10.5px!important}
  .sales-ledger-table td[data-label="Date"],.sales-ledger-table td[data-label="GSTIN / POS"],.sales-ledger-table td[data-label="Currency"],.sales-ledger-table td[data-label="Taxable"],.sales-ledger-table td[data-label="GST"]{font-size:11.5px!important;padding:8px 0!important}
  .sales-ledger-table td[data-label="Date"]:before,.sales-ledger-table td[data-label="GSTIN / POS"]:before,.sales-ledger-table td[data-label="Currency"]:before,.sales-ledger-table td[data-label="Taxable"]:before,.sales-ledger-table td[data-label="GST"]:before{font-size:9px!important}
  .sales-status,.sales-cat{font-size:9px!important;padding:5px 8px!important}
  .sales-ledger-table .row-view-link{min-height:40px!important;font-size:10.5px!important}
}
@media(max-width:760px){
  .sales-pagination{align-items:center!important;gap:12px!important}
  .pagination-links{max-width:100%;overflow-x:auto!important}
  .pagination-links .page-btn{flex:0 0 36px!important}
  .sales-heading-actions{gap:10px!important}
}
@media(max-width:600px){
  .sales-heading-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
  .sales-heading-actions .btn+.btn{margin-left:0!important}
  .sales-heading-actions .btn{min-height:42px!important}
}
@media(max-width:420px){
  .sales-heading-actions{grid-template-columns:1fr!important}
  .sales-pagination{align-items:flex-start!important}
  .pagination-links{width:100%!important;justify-content:flex-start!important}
}

/* Phase 1.8 — Sales responsive visual refinement */
.sales-heading-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:12px!important;
}
.sales-heading-actions .btn,
.sales-heading-actions .btn+.btn{
  margin:0!important;
  min-height:42px!important;
  padding:10px 17px!important;
  font-size:12px!important;
  border-radius:10px!important;
}

/* Slightly more readable desktop ledger */
.sales-ledger-table td{font-size:12.25px!important;line-height:1.5!important}
.sales-ledger-table td strong{font-size:12.75px!important}
.sales-ledger-table .table-sub{font-size:10.5px!important}
.sales-ledger-table th{font-size:9.5px!important}
.sales-status,.sales-cat{font-size:9.25px!important}
.row-view-link{font-size:10.75px!important}

@media(max-width:980px){
  /* Remove the outer table/card background so each invoice is one clean card only. */
  .sales-ledger-card,
  .sales-ledger-card.card{
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    padding:0!important;
    overflow:visible!important;
  }
  .sales-ledger-card .table-wrap,
  .sales-ledger-table,
  .sales-ledger-table tbody{
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }
  .sales-ledger-table{border-spacing:0!important}
  .sales-ledger-table tr{
    margin:0 0 16px!important;
    padding:20px!important;
    border:1px solid #e4e0ec!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:0 8px 24px rgba(35,29,59,.07)!important;
  }
  .sales-ledger-table td[data-label="Invoice"] strong{font-size:16px!important;line-height:1.35!important}
  .sales-ledger-table td[data-label="Total"] strong{font-size:20px!important;line-height:1.3!important}
  .sales-ledger-table td[data-label="Order"]{font-size:12px!important;line-height:1.4!important;margin-bottom:15px!important}
  .sales-ledger-table td[data-label="Customer"]{margin-bottom:13px!important}
  .sales-ledger-table td[data-label="Customer"]>strong{font-size:15px!important;line-height:1.4!important}
  .sales-ledger-table td[data-label="Customer"] .table-sub{font-size:11.5px!important;line-height:1.45!important}
  .sales-status,.sales-cat{font-size:10.5px!important;padding:5px 9px!important}
  .sales-ledger-table td[data-label="Date"],
  .sales-ledger-table td[data-label="GSTIN / POS"],
  .sales-ledger-table td[data-label="Currency"],
  .sales-ledger-table td[data-label="Taxable"],
  .sales-ledger-table td[data-label="GST"]{
    grid-template-columns:105px minmax(0,1fr)!important;
    font-size:13.25px!important;
    line-height:1.45!important;
    padding:10px 0!important;
  }
  .sales-ledger-table td[data-label="Date"]:before,
  .sales-ledger-table td[data-label="GSTIN / POS"]:before,
  .sales-ledger-table td[data-label="Currency"]:before,
  .sales-ledger-table td[data-label="Taxable"]:before,
  .sales-ledger-table td[data-label="GST"]:before{
    font-size:10px!important;
    line-height:1.4!important;
  }
  .sales-ledger-table .row-view-link{
    min-height:44px!important;
    font-size:12px!important;
    border-radius:10px!important;
  }
}

@media(max-width:760px){
  .sales-heading-actions{
    width:100%!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:12px!important;
    margin-top:14px!important;
  }
  .sales-heading-actions .btn,
  .sales-heading-actions .btn+.btn{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    text-align:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
  }
}

@media(max-width:430px){
  .sales-ledger-table tr{padding:17px!important}
  .sales-ledger-table td[data-label="Date"],
  .sales-ledger-table td[data-label="GSTIN / POS"],
  .sales-ledger-table td[data-label="Currency"],
  .sales-ledger-table td[data-label="Taxable"],
  .sales-ledger-table td[data-label="GST"]{
    grid-template-columns:92px minmax(0,1fr)!important;
    font-size:12.75px!important;
  }
}

/* === SoftSprint Accounts Phase 2: Expenses / Vendors / Recurring Bills === */
.accounts-page-heading{align-items:flex-end}
.expense-filter{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr)) auto;gap:14px;align-items:end;padding:18px;margin-bottom:16px}
.expense-filter label,.expense-form label,.compact-form label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:700;color:#5f6079}
.expense-filter input,.expense-filter select,.expense-form input,.expense-form select,.expense-form textarea,.compact-form input,.compact-form select,.compact-form textarea{width:100%;border:1px solid #dedff0;border-radius:10px;background:#fff;padding:11px 12px;color:#15152b;font:inherit;box-sizing:border-box;outline:none}
.expense-filter input:focus,.expense-filter select:focus,.expense-form input:focus,.expense-form select:focus,.expense-form textarea:focus,.compact-form input:focus,.compact-form select:focus,.compact-form textarea:focus{border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(124,58,237,.08)}
.expense-stat-grid{grid-template-columns:repeat(5,minmax(0,1fr));margin-bottom:16px}
.expense-list-card{padding:0;overflow:hidden}
.expense-table{width:100%;border-collapse:collapse;font-size:13px}
.expense-table th{background:#f8f8fc;color:#888aa3;text-transform:uppercase;letter-spacing:.045em;font-size:10px;text-align:left;padding:13px 14px;border-bottom:1px solid #ececf5}
.expense-table td{padding:14px;border-bottom:1px solid #eeeeF5;vertical-align:middle;color:#292a3f}
.expense-table tbody tr:last-child td{border-bottom:0}
.expense-table td strong{display:block;font-weight:750;color:#17172b}
.expense-table td small{display:block;margin-top:4px;color:#8a8ca3;font-size:11px}
.expense-status{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}
.expense-status.status-paid{background:#e9fbf1;color:#067647}
.expense-status.status-unpaid{background:#fff0ef;color:#c43228}
.expense-status.status-part-paid{background:#fff7e6;color:#a15c00}
.doc-count{display:inline-flex;align-items:center;border-radius:999px;background:#f4f1ff;color:#6541d8;padding:5px 9px;font-size:11px;font-weight:800;white-space:nowrap}
.btn-sm{padding:7px 11px!important;min-height:auto!important;font-size:11px!important}
.empty-cell{text-align:center!important;padding:32px!important;color:#9092a8!important}

.expense-form{padding:24px}
.form-section-title{font-size:15px;font-weight:800;color:#19192d;margin:6px 0 14px;padding-bottom:10px;border-bottom:1px solid #eeeeF5}
.form-section-title:not(:first-of-type){margin-top:24px}
.form-grid{display:grid;gap:16px}
.form-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.form-grid .span-2{grid-column:span 2}
.check-label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:9px!important;margin-top:28px}
.check-label input{width:auto!important}
.upload-panel{border:1.5px dashed #cfc8f6;background:#faf9ff;border-radius:14px;padding:20px;display:flex;flex-direction:column;gap:7px;margin-bottom:18px}
.upload-panel input{padding:0;border:0;background:transparent;box-shadow:none}
.upload-panel strong{font-size:14px;color:#24243a}
.upload-panel span{font-size:12px;color:#7d7f96;line-height:1.5}
.form-actions{display:flex;gap:12px;margin-top:20px}

.expense-detail-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:24px;margin-bottom:18px}
.expense-documents{margin-top:18px;padding:22px}
.section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:14px}
.section-title-row h3{margin:0 0 4px}
.document-list{display:grid;gap:10px}
.document-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #ececf5;border-radius:12px;text-decoration:none;color:#26263c;background:#fff;transition:.15s ease}
.document-item:hover{border-color:#cfc5fb;background:#fbfaff;transform:translateY(-1px)}
.document-icon{font-size:22px}.document-item span:nth-child(2){display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.document-item strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document-item small{font-size:11px;color:#9193a8}.document-download{font-size:11px;font-weight:800;color:#6d3fe3}

.two-column-admin{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:18px;align-items:start}
.compact-form{padding:22px;display:grid;gap:14px;position:sticky;top:84px}.compact-form h3{margin:0 0 2px}
.vendor-list,.bill-list{display:grid}.vendor-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:13px 4px;border-bottom:1px solid #efeff5}.vendor-row:last-child{border-bottom:0}.vendor-avatar{width:38px;height:38px;border-radius:11px;background:linear-gradient(135deg,#ede9fe,#ffe7df);color:#6d3fe3;font-weight:900;display:grid;place-items:center}.vendor-row strong,.vendor-row small{display:block}.vendor-row strong{font-size:13px}.vendor-row small{margin-top:3px;color:#8b8da3;font-size:11px}
.bill-row{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:14px;align-items:center;padding:15px 2px;border-bottom:1px solid #efeff5}.bill-row:last-child{border-bottom:0}.bill-date{width:50px;height:50px;border-radius:13px;background:#f4f1ff;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#673de0}.bill-date strong{font-size:17px;line-height:1}.bill-date span{font-size:10px;font-weight:800;text-transform:uppercase;margin-top:3px}.bill-main strong,.bill-main small,.bill-amount small{display:block}.bill-main strong{font-size:13px}.bill-main small{font-size:11px;color:#8b8da3;margin-top:4px}.bill-amount{text-align:right;font-size:14px;font-weight:850;color:#17172b}.bill-amount small{font-size:10px;color:#7c7e93;margin-top:4px;font-weight:700}.bill-amount small.due-soon{color:#b26700}.bill-amount small.due-overdue{color:#c43228}

@media(max-width:1180px){.expense-filter{grid-template-columns:repeat(3,minmax(0,1fr))}.expense-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.accounts-page-heading{align-items:flex-start}.expense-filter{grid-template-columns:1fr 1fr}.expense-stat-grid{grid-template-columns:1fr 1fr}.two-column-admin{grid-template-columns:1fr}.compact-form{position:static}.form-grid.cols-3,.form-grid.cols-4{grid-template-columns:1fr 1fr}.expense-list-card{background:transparent;border:0;box-shadow:none;overflow:visible}.expense-table thead{display:none}.expense-table,.expense-table tbody{display:block}.expense-table tr{display:grid;grid-template-columns:1fr 1fr;background:#fff;border:1px solid #e9e9f3;border-radius:15px;padding:16px;margin-bottom:12px;box-shadow:0 7px 20px rgba(31,26,65,.05)}.expense-table td{display:block;border:0;padding:5px 0}.expense-table td:before{display:block;color:#999bb0;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.045em;margin-bottom:3px}.expense-table td:nth-child(1):before{content:'Date'}.expense-table td:nth-child(2):before{content:'Expense'}.expense-table td:nth-child(3):before{content:'Vendor'}.expense-table td:nth-child(4):before{content:'Category'}.expense-table td:nth-child(5):before{content:'Taxable'}.expense-table td:nth-child(6):before{content:'GST'}.expense-table td:nth-child(7):before{content:'Total'}.expense-table td:nth-child(8):before{content:'Status'}.expense-table td:nth-child(9):before{content:'Bill'}.expense-table td:nth-child(2),.expense-table td:nth-child(10){grid-column:1/-1}.expense-table td:nth-child(10) .btn{width:100%;margin-top:5px}.expense-detail-hero{align-items:flex-start;flex-direction:column}}
@media(max-width:620px){.expense-filter,.expense-stat-grid,.form-grid.cols-3,.form-grid.cols-4{grid-template-columns:1fr}.form-grid .span-2{grid-column:auto}.form-actions{flex-direction:column}.form-actions .btn{width:100%}.section-title-row{align-items:flex-start}.bill-row{grid-template-columns:48px minmax(0,1fr)}.bill-amount{grid-column:2;text-align:left}.expense-table tr{grid-template-columns:1fr}.expense-table td:nth-child(2),.expense-table td:nth-child(10){grid-column:auto}.document-download{display:none}}

/* Phase 2.1.1: dynamic payment fields must stay hidden until relevant method is selected */
#upi_provider_wrap[hidden],
#other_payment_wrap[hidden],
#transaction_reference_wrap[hidden]{
  display:none !important;
}

/* === SoftSprint Accounts Phase 2.2: Dynamic GST entry + expense settings === */
#cgst_wrap[hidden],#sgst_wrap[hidden],#igst_wrap[hidden]{display:none!important}
.gst-entry-panel{padding:18px;border:1px solid #ececf5;border-radius:14px;background:linear-gradient(180deg,#fff 0%,#fcfbff 100%)}
.gst-entry-panel .check-label{margin-top:16px}
.gst-tax-fields{margin-top:16px;align-items:end}
.gst-total-summary{min-height:64px;border:1px solid #e7e3f7;background:#f8f6ff;border-radius:12px;padding:11px 13px;display:flex;flex-direction:column;justify-content:center;gap:2px;box-sizing:border-box}
.gst-total-summary span{font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:#8b87a4;font-weight:800}
.gst-total-summary strong{font-size:18px;color:#26194f;line-height:1.15}
.gst-total-summary small{font-size:10px;color:#9a96ad}
.gst-helper{margin:12px 0 0;font-size:11.5px;line-height:1.55}

.settings-page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:18px}
.settings-page-heading h1{margin-bottom:5px}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start;margin-bottom:18px}
.settings-card{padding:22px;margin-bottom:18px}
.settings-grid .settings-card{margin-bottom:0}
.settings-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px;padding-bottom:13px;border-bottom:1px solid #eeeeF5}
.settings-card-head h3{margin:0 0 4px}
.settings-card form>label,.settings-inline-form label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:750;color:#5f6079;margin-bottom:12px}
.settings-card input,.settings-card select,.settings-card textarea{width:100%;border:1px solid #dedff0;border-radius:10px;background:#fff;padding:10px 11px;color:#15152b;font:inherit;box-sizing:border-box;outline:none}
.settings-card input:focus,.settings-card select:focus,.settings-card textarea:focus{border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(124,58,237,.08)}
.settings-inline-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:end}
.settings-inline-form label{margin:0}
.settings-inline-form button{min-height:42px}
.settings-add-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;margin-bottom:14px}
.settings-add-row input{margin:0!important}
.settings-manage-list{display:grid;gap:9px}
.settings-manage-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border:1px solid #ececf5;border-radius:12px;background:#fbfbfe}
.settings-row-main{display:grid;grid-template-columns:minmax(100px,1fr) auto auto;gap:9px;align-items:center;margin:0!important}
.category-manage-list .settings-row-main{grid-template-columns:minmax(180px,1fr) auto auto}
.settings-row-main input{margin:0!important}
.settings-row-actions{display:flex;gap:7px;align-items:center}
.settings-row-actions form{margin:0!important}
.settings-row-actions button,.settings-row-main button{white-space:nowrap}

@media(max-width:1100px){
  .settings-grid{grid-template-columns:1fr}
  .settings-inline-form{grid-template-columns:1fr 1fr}
  .settings-inline-form button{grid-column:1/-1;width:max-content}
}
@media(max-width:760px){
  .gst-entry-panel{padding:14px}
  .settings-inline-form{grid-template-columns:1fr}
  .settings-inline-form button{grid-column:auto;width:100%}
  .settings-add-row{grid-template-columns:1fr}
  .settings-add-row button{width:100%}
  .settings-manage-row{grid-template-columns:1fr}
  .settings-row-main,.category-manage-list .settings-row-main{grid-template-columns:1fr auto}
  .settings-row-main input{grid-column:1/-1}
  .settings-row-actions{justify-content:flex-start;flex-wrap:wrap}
}

/* === SoftSprint Accounts Phase 2.3: partial-payment balances === */
#paid_amount_wrap[hidden],#pending_amount_wrap[hidden]{display:none!important}
#pending_amount{background:#f7f7fb;color:#47465c;font-weight:800;cursor:default}
.pending-small{display:block;margin-top:5px;color:#b56716;font-size:10.5px;font-weight:800;white-space:nowrap}
@media(max-width:620px){
  #paid_amount_wrap,#pending_amount_wrap{grid-column:auto}
}

/* === SoftSprint Accounts Phase 2.4: Expense summary visual fix === */
.accounts-stat-grid{
  display:grid;
  gap:14px;
  width:100%;
}
.expense-stat-grid{
  grid-template-columns:repeat(5,minmax(0,1fr));
  margin:0 0 18px;
}
.account-stat{
  min-height:96px;
  padding:18px 20px!important;
  border:1px solid #e9e7ef!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 7px 22px rgba(36,29,61,.045)!important;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  position:relative;
  overflow:hidden;
}
.account-stat:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:#7c3aed;
  opacity:.8;
}
.account-stat span{
  display:block;
  color:#8a8b9d;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-size:9.5px;
  line-height:1.2;
  font-weight:850;
}
.account-stat strong{
  display:block;
  color:#1f2033;
  font-size:21px;
  line-height:1.15;
  font-weight:800;
  letter-spacing:-.02em;
}
.expense-stat-grid .account-stat:nth-child(3):before,
.expense-stat-grid .account-stat:nth-child(4):before{background:#10b981}
.expense-stat-grid .account-stat:nth-child(5):before{background:#f59e0b}
.expense-list-card{margin-top:0}

@media(max-width:1180px){
  .expense-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .expense-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .account-stat{min-height:88px;padding:16px 17px!important}
  .account-stat strong{font-size:20px}
}
@media(max-width:560px){
  .expense-stat-grid{grid-template-columns:1fr!important;gap:10px}
  .account-stat{min-height:82px}
}


/* Phase 2.5 expense editing + payment ledger */
.expense-detail-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.expense-payment-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:16px 0}
.expense-payment-kpis>div{background:#fff;border:1px solid #e7e4ef;border-radius:14px;padding:16px 18px;box-shadow:0 8px 22px rgba(42,35,72,.06)}
.expense-payment-kpis span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#8c879b;font-weight:800;margin-bottom:5px}.expense-payment-kpis strong{font-size:22px;color:#19152d}.expense-payment-kpis .pending{border-left:4px solid #ff8a3d}.expense-payment-kpis .pending strong{color:#b65a16}
.payment-ledger-card{padding:20px;margin-top:16px}.payment-ledger-table td,.payment-ledger-table th{padding:12px 14px}.payment-ledger-table tbody tr:hover{background:#fbfaff}
.add-payment-panel{margin-top:18px;border:1px solid #e4def6;border-radius:13px;background:#fbfaff;padding:0 16px 16px}.add-payment-panel summary{cursor:pointer;padding:15px 0;font-weight:800;color:#5c2bd9}.payment-entry-form{padding-top:4px}.payment-entry-form .btn{margin-top:12px}
.paid-complete-banner{margin-top:16px;padding:13px 16px;border:1px solid #b9ebd1;background:#effcf5;color:#087a49;border-radius:12px;font-weight:800}
.expense-danger-zone{margin-top:16px;border-color:#ffd6da;padding:20px}.expense-danger-zone h3{color:#b42332}.expense-danger-zone .btn-danger{margin-top:8px}
.dashboard-payment-summary{margin-top:16px;padding:20px}.payment-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-top:12px}.payment-summary-grid>div{border:1px solid #ece8f5;background:#fbfaff;border-radius:12px;padding:13px 15px}.payment-summary-grid span{display:block;color:#777087;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.payment-summary-grid strong{display:block;font-size:18px;margin-top:5px;color:#1f1932}
@media(max-width:760px){.expense-payment-kpis{grid-template-columns:1fr}.expense-detail-actions{width:100%}.expense-detail-actions .btn{flex:1;text-align:center}.payment-ledger-card .table-wrap{overflow-x:auto}.payment-entry-form .form-grid{grid-template-columns:1fr!important}}


/* Phase 2.6 payment-entry polish */
#ledger_provider_wrap[hidden],
#ledger_other_wrap[hidden],
#ledger_ref_wrap[hidden]{display:none!important}

.payment-ledger-card{
  padding:26px;
  overflow:hidden;
}
.payment-ledger-card>.section-title-row{
  margin-bottom:16px;
}
.payment-ledger-card .table-wrap{
  border:1px solid #ece9f4;
  border-radius:13px;
  overflow:hidden;
  margin-bottom:20px;
}
.payment-ledger-card .payment-ledger-table{
  margin:0;
}
.add-payment-panel{
  margin:20px 0 0;
  padding:0 20px 20px;
  border-radius:15px;
}
.add-payment-panel summary{
  padding:17px 0;
  font-size:15px;
}
.payment-entry-form{
  padding-top:7px;
}
.payment-entry-form .form-grid{
  gap:18px;
}
.payment-entry-form label{
  min-width:0;
}
.payment-entry-form .span-3{
  grid-column:1/-1;
}
.payment-entry-form textarea,
.expense-form textarea,
.compact-form textarea{
  width:100%;
  min-height:112px;
  resize:vertical;
}
.payment-note-field{
  width:100%;
}
.payment-entry-form .btn{
  margin-top:16px;
}

@media(max-width:760px){
  .payment-ledger-card{padding:18px}
  .add-payment-panel{padding:0 15px 16px}
}

/* Phase 2.6.1: restore proper inner gutter for payment-history card.
   Generic .card:has(table) intentionally removes padding for normal tables;
   payment ledger is a composed card and must retain its own gutter. */
.card.payment-ledger-card:has(table){
  padding:26px!important;
  overflow:hidden;
}
.card.payment-ledger-card:has(table)>.section-title-row{
  padding:0!important;
  margin:0 0 18px!important;
}
.card.payment-ledger-card:has(table)>.section-title-row .muted{
  margin:5px 0 0!important;
}
.card.payment-ledger-card:has(table)>.table-wrap{
  margin:0 0 20px!important;
  width:100%;
  box-sizing:border-box;
}
.card.payment-ledger-card:has(table)>.add-payment-panel{
  margin:20px 0 0!important;
}
@media(max-width:760px){
  .card.payment-ledger-card:has(table){padding:18px!important}
}

/* Phase 2.7 - managed vendors and recurring bills */
.vendor-directory-card,.recurring-directory-card{overflow:hidden}
.managed-vendor-list,.managed-bill-list{display:flex;flex-direction:column;gap:12px;margin-top:18px}
.managed-vendor-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:16px;border:1px solid var(--border,#e7e8ef);border-radius:14px;background:#fff}
.vendor-main{min-width:0;display:flex;flex-direction:column;gap:3px}
.vendor-main strong{font-size:15px;color:#17172b}
.vendor-main small{color:#7f8299}
.vendor-usage{font-size:12px;color:#9a9caf;margin-top:2px}
.vendor-actions,.bill-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.vendor-actions form,.bill-actions form{margin:0}
.vendor-edit-form{max-width:980px}
.managed-bill-row{display:grid;grid-template-columns:58px minmax(0,1fr) auto minmax(280px,auto);gap:16px;align-items:center;padding:16px;border:1px solid var(--border,#e7e8ef);border-radius:14px;background:#fff}
.managed-bill-row.bill-paused{opacity:.68;background:#fafafd}
.recurring-status-line{display:flex;align-items:center;gap:10px;margin-top:7px;flex-wrap:wrap}
.recurring-status-line small{font-weight:700;font-size:12px}
.bill-actions .btn,.bill-actions .btn-danger,.vendor-actions .btn,.vendor-actions .btn-danger{white-space:nowrap}
@media (max-width:1100px){
  .managed-bill-row{grid-template-columns:58px 1fr auto}.bill-actions{grid-column:2/-1;justify-content:flex-start}.managed-vendor-row{grid-template-columns:auto 1fr auto}.vendor-actions{grid-column:2/-1;justify-content:flex-start}
}
@media (max-width:720px){
  .managed-vendor-row{grid-template-columns:auto 1fr}.managed-vendor-row>.expense-status{justify-self:start;grid-column:2}.vendor-actions{grid-column:1/-1}
  .managed-bill-row{grid-template-columns:52px 1fr}.bill-amount{grid-column:2;justify-self:start}.bill-actions{grid-column:1/-1}.bill-actions>*{flex:1 1 140px}.bill-actions .btn,.bill-actions .btn-danger{width:100%;text-align:center}
}

/* Phase 2.8 — vendor directory, global 10-record pagination */
.vendor-add-form{margin-bottom:18px}
.vendor-add-form,.vendor-directory-card{width:100%;box-sizing:border-box}
.vendor-add-form .section-title-row{margin-bottom:18px}
.vendor-search-form{display:grid;grid-template-columns:minmax(0,1fr) 190px auto;gap:12px;align-items:end;padding:16px 0 2px;margin-top:8px;border-top:1px solid #eeeaf5}
.vendor-search-form label{margin:0}
.vendor-inline-warning{margin:16px 0 0}
.standard-pagination{margin-top:14px;border-radius:0 0 13px 13px}
.vendor-directory-card .standard-pagination,.recurring-directory-card .standard-pagination{margin-left:-1px;margin-right:-1px;margin-bottom:-1px}
.vendor-main small+small{margin-top:2px}
.vendor-add-form .form-grid.cols-3,.vendor-edit-form .form-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.vendor-add-form .span-3,.vendor-edit-form .span-3{grid-column:1/-1}

@media(max-width:980px){
  .vendor-add-form .form-grid.cols-3,.vendor-edit-form .form-grid.cols-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .vendor-add-form .span-3,.vendor-edit-form .span-3{grid-column:1/-1}
  .vendor-search-form{grid-template-columns:1fr 180px}
  .vendor-search-form .btn{grid-column:1/-1;justify-self:start}
}
@media(max-width:640px){
  .vendor-add-form .form-grid.cols-3,.vendor-edit-form .form-grid.cols-3{grid-template-columns:1fr}
  .vendor-add-form .span-3,.vendor-edit-form .span-3{grid-column:1}
  .vendor-search-form{grid-template-columns:1fr}
  .vendor-search-form .btn{grid-column:auto;width:100%}
  .vendor-directory-card{padding-left:14px!important;padding-right:14px!important}
  .managed-vendor-row{padding:14px!important}
  .standard-pagination{padding-left:0!important;padding-right:0!important}
}


/* Phase 2.9 — compact responsive form grid + vendor directory polish */
.form-grid .span-4{grid-column:1/-1}
.app-responsive-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px 16px}
.vendor-add-form .section-title-row{margin-bottom:14px}
.vendor-add-form label,.vendor-edit-form label{font-size:12px}
.vendor-add-form input,.vendor-add-form select,.vendor-edit-form input,.vendor-edit-form select{min-height:42px}
.vendor-add-form textarea,.vendor-edit-form textarea{min-height:88px}

.managed-vendor-list{gap:8px;margin-top:14px}
.managed-vendor-row{
  grid-template-columns:38px minmax(0,1fr) auto auto;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  min-height:58px;
}
.managed-vendor-row .vendor-avatar{width:36px;height:36px;min-width:36px;border-radius:10px;font-size:13px}
.managed-vendor-row .vendor-main{gap:1px;line-height:1.25}
.managed-vendor-row .vendor-main strong{font-size:14px}
.managed-vendor-row .vendor-main small{font-size:11px;line-height:1.25}
.managed-vendor-row .vendor-usage{font-size:10.5px;margin-top:1px}
.managed-vendor-row .expense-status{font-size:9px;padding:5px 8px}
.managed-vendor-row .vendor-actions{gap:6px}
.managed-vendor-row .vendor-actions .btn,
.managed-vendor-row .vendor-actions .btn-danger{padding:7px 10px;font-size:11px;border-radius:8px}
.vendor-directory-card{padding-top:18px!important;padding-bottom:16px!important}
.vendor-directory-card .section-title-row{margin-bottom:8px}

/* App-wide full-width form standard: 4 large, 2 medium, 1 mobile. */
@media(max-width:1180px){
  .app-responsive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .app-responsive-grid .span-4{grid-column:1/-1}
  .managed-vendor-row{grid-template-columns:38px minmax(0,1fr) auto}
  .managed-vendor-row .vendor-actions{grid-column:2/-1;justify-content:flex-start}
}
@media(max-width:640px){
  .app-responsive-grid{grid-template-columns:1fr!important}
  .app-responsive-grid .span-2,.app-responsive-grid .span-4{grid-column:1!important}
  .managed-vendor-row{grid-template-columns:36px minmax(0,1fr);padding:10px}
  .managed-vendor-row>.expense-status{grid-column:2;justify-self:start}
  .managed-vendor-row .vendor-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  .managed-vendor-row .vendor-actions>*{width:100%}
  .managed-vendor-row .vendor-actions .btn,.managed-vendor-row .vendor-actions .btn-danger{width:100%;text-align:center}
}

/* Phase 2.10 — compact Bootstrap-style vendor directory */
.vendor-add-form .app-responsive-grid{gap:12px 16px}
.vendor-add-form input[name="address"],.vendor-edit-form input[name="address"]{min-height:42px}
.vendor-add-form textarea[name="notes"],.vendor-edit-form textarea[name="notes"]{min-height:82px}
.vendor-directory-table{margin-top:14px;border:1px solid #e8e4f1;border-radius:13px;overflow:hidden;background:#fff}
.vendor-directory-head{display:grid;grid-template-columns:minmax(210px,1.35fr) minmax(190px,1.2fr) minmax(150px,.9fr) 130px 90px minmax(185px,auto);gap:12px;align-items:center;padding:10px 14px;background:#f8f7fc;border-bottom:1px solid #e8e4f1;color:#777089;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.055em}
.vendor-directory-table .managed-vendor-list{gap:0;margin-top:0}
.vendor-directory-table .managed-vendor-row{display:grid;grid-template-columns:minmax(210px,1.35fr) minmax(190px,1.2fr) minmax(150px,.9fr) 130px 90px minmax(185px,auto);gap:12px;align-items:center;min-height:0;padding:10px 14px;border:0;border-bottom:1px solid #eeebf4;border-radius:0;background:#fff}
.vendor-directory-table .managed-vendor-row:last-child{border-bottom:0}
.vendor-directory-table .managed-vendor-row:hover{background:#fcfbff}
.vendor-identity{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center;min-width:0}
.vendor-directory-table .vendor-avatar{width:34px;height:34px;min-width:34px;border-radius:9px;font-size:12px}
.vendor-directory-table .vendor-main,.vendor-contact,.vendor-location{min-width:0;display:flex;flex-direction:column;gap:2px}
.vendor-directory-table .vendor-main strong,.vendor-contact strong,.vendor-location strong{font-size:12.5px;color:#18152b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vendor-directory-table .vendor-main small,.vendor-contact small,.vendor-location small{font-size:10.5px;color:#858096;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vendor-usage-cell{display:grid;grid-template-columns:auto 1fr;column-gap:5px;row-gap:1px;align-items:baseline}
.vendor-usage-cell strong{font-size:12px;color:#1d1832}.vendor-usage-cell small{font-size:10px;color:#8b8698}
.vendor-status-cell{display:flex;align-items:center}
.vendor-directory-table .vendor-actions{display:flex;justify-content:flex-end;gap:5px;flex-wrap:nowrap}.vendor-directory-table .vendor-actions form{margin:0}
.vendor-directory-table .vendor-actions .btn,.vendor-directory-table .vendor-actions .btn-danger{padding:6px 9px;font-size:10.5px;border-radius:7px}.vendor-empty{padding:18px;margin:0}
@media(max-width:1180px){.vendor-directory-head{display:none}.vendor-directory-table{border:0;background:transparent;overflow:visible}.vendor-directory-table .managed-vendor-list{gap:9px}.vendor-directory-table .managed-vendor-row{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 110px;gap:10px 14px;padding:12px 13px;border:1px solid #e8e4f1;border-radius:12px}.vendor-identity{grid-column:1}.vendor-contact{grid-column:2}.vendor-status-cell{grid-column:3;grid-row:1;justify-self:end}.vendor-location{grid-column:1}.vendor-usage-cell{grid-column:2}.vendor-directory-table .vendor-actions{grid-column:3;justify-content:flex-end!important;align-self:end}}
@media(max-width:640px){.vendor-directory-table .managed-vendor-row{grid-template-columns:1fr auto;gap:9px 12px;padding:12px}.vendor-identity{grid-column:1}.vendor-status-cell{grid-column:2;grid-row:1}.vendor-contact{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:3px 10px;padding-top:7px;border-top:1px solid #f0edf5}.vendor-contact strong{grid-column:1/-1}.vendor-location{grid-column:1}.vendor-usage-cell{grid-column:2;justify-self:end}.vendor-directory-table .vendor-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.vendor-directory-table .vendor-actions>*{width:100%}.vendor-directory-table .vendor-actions .btn,.vendor-directory-table .vendor-actions .btn-danger{width:100%;text-align:center}}

/* Phase 2.11 — vendor search actions remain in one row */
.vendor-search-form{
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) minmax(130px,180px) auto auto!important;
  gap:10px!important;
  align-items:end!important;
}
.vendor-search-form .vendor-search-field,
.vendor-search-form .vendor-status-field{min-width:0}
.vendor-search-form .vendor-search-btn,
.vendor-search-form .vendor-clear-btn{
  grid-column:auto!important;
  justify-self:stretch!important;
  width:auto!important;
  min-width:78px;
  white-space:nowrap;
  text-align:center;
}
@media(max-width:820px){
  .vendor-search-form{
    grid-template-columns:minmax(0,1fr) 132px auto auto!important;
    gap:8px!important;
  }
  .vendor-search-form label{font-size:10.5px}
  .vendor-search-form input,.vendor-search-form select{min-height:38px;padding:8px 10px;font-size:11px}
  .vendor-search-form .vendor-search-btn,.vendor-search-form .vendor-clear-btn{min-width:66px;padding:9px 10px;font-size:11px}
}
@media(max-width:520px){
  .vendor-search-form{
    grid-template-columns:minmax(0,1fr) 106px 58px 58px!important;
    gap:6px!important;
  }
  .vendor-search-form input{padding-left:8px;padding-right:8px}
  .vendor-search-form .vendor-search-btn,.vendor-search-form .vendor-clear-btn{min-width:0;padding-left:6px;padding-right:6px;font-size:10.5px}
}


/* Phase 2.12 — vendor profile, statement and payment detail */
.vendor-name-link{color:inherit;text-decoration:none}.vendor-name-link:hover{color:#6d3fe3;text-decoration:underline}
.vendor-profile-card{padding:18px 20px!important}.vendor-profile-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 22px}.vendor-profile-grid>div{min-width:0}.vendor-profile-grid span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:800;color:#9290a4;margin-bottom:4px}.vendor-profile-grid strong{font-size:13px;color:#17172a;line-height:1.4;word-break:break-word}.vendor-profile-address{grid-column:1/-1}
.vendor-period-filter{display:grid;grid-template-columns:220px 220px auto auto 1fr;gap:12px;align-items:end;padding:16px 18px!important;margin-top:14px}.vendor-period-filter label{margin:0}.vendor-period-filter .btn{white-space:nowrap}
.vendor-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0}.vendor-summary-grid .summary-card{position:relative;overflow:hidden;padding:16px 17px;min-height:92px}.vendor-summary-grid .summary-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#8155ee}.vendor-summary-grid .summary-card.summary-warning:before{background:#f59e0b}.vendor-summary-grid .summary-card.summary-positive:before{background:#16a36a}.vendor-summary-grid .summary-card span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.055em;font-weight:800;color:#8e8a9d}.vendor-summary-grid .summary-card strong{display:block;font-size:19px;margin-top:8px;color:#17172a}.vendor-summary-grid .summary-card small{display:block;margin-top:4px;font-size:10px;color:#9895a7}
.vendor-ledger-card{padding:0!important;overflow:hidden;margin-top:14px}.vendor-ledger-card>.section-title-row{padding:17px 18px 13px;margin:0;border-bottom:1px solid #eeeaf5}.vendor-ledger-card .table-wrap{margin:0}.vendor-ledger-table{width:100%}.vendor-ledger-table th{font-size:9.5px;letter-spacing:.05em}.vendor-ledger-table td{font-size:11.5px;padding-top:10px;padding-bottom:10px}.vendor-ledger-table td small{display:block;color:#9693a4;font-size:9.5px;margin-top:2px}.vendor-ledger-card .standard-pagination{margin:0;border-radius:0;border-left:0;border-right:0;border-bottom:0}
@media(max-width:1100px){.vendor-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vendor-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vendor-period-filter{grid-template-columns:1fr 1fr auto auto}.vendor-ledger-card .table-wrap{overflow-x:auto}}
@media(max-width:680px){.vendor-profile-heading .header-actions{width:100%}.vendor-profile-heading .header-actions .btn{flex:1;text-align:center}.vendor-profile-grid{grid-template-columns:1fr}.vendor-profile-address{grid-column:auto}.vendor-period-filter{grid-template-columns:1fr 1fr auto auto;padding:13px!important;gap:8px}.vendor-period-filter label{font-size:10px}.vendor-period-filter input{min-height:38px;padding:7px 8px;font-size:11px}.vendor-period-filter .btn{padding:9px 8px;font-size:10px}.vendor-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.vendor-summary-grid .summary-card{padding:13px;min-height:80px}.vendor-summary-grid .summary-card strong{font-size:16px}.vendor-ledger-card>.section-title-row{padding:14px}.vendor-ledger-table{min-width:760px}}
@media(max-width:420px){.vendor-period-filter{grid-template-columns:1fr 1fr}.vendor-period-filter .btn{width:100%;text-align:center}.vendor-summary-grid{grid-template-columns:1fr 1fr}}

/* Phase 2.13 — vendor details visual polish */
.vendor-profile-heading{align-items:flex-start!important;gap:18px}
.vendor-profile-heading .header-actions{display:flex!important;gap:12px!important;align-items:center!important;flex-wrap:wrap!important}
.vendor-profile-heading .header-actions .btn{margin:0!important}
.vendor-profile-card{background:#fff;border:1px solid #ebe8f2;border-radius:15px;box-shadow:0 8px 24px rgba(38,30,72,.06)}
.vendor-period-filter{background:#fff;border:1px solid #ebe8f2;border-radius:15px;box-shadow:0 8px 24px rgba(38,30,72,.05)}
.vendor-period-filter label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#45405a}
.vendor-period-filter input[type="date"]{cursor:pointer;background-color:#fff}
.vendor-summary-grid .summary-card{background:#fff;border:1px solid #ebe8f2;border-radius:14px;box-shadow:0 7px 20px rgba(38,30,72,.055)}
.vendor-summary-grid .summary-card:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(38,30,72,.075)}
.vendor-summary-grid .summary-card{transition:box-shadow .18s ease,transform .18s ease}
.vendor-ledger-card{background:#fff;border:1px solid #ebe8f2;border-radius:15px!important;box-shadow:0 8px 24px rgba(38,30,72,.05)}
.vendor-ledger-card>.section-title-row{background:#fff}
.vendor-ledger-card .empty-cell{padding:28px 18px!important;color:#9894a8;text-align:center}
.vendor-profile-grid strong{font-size:13.5px}
.vendor-profile-grid span{font-size:10.5px}
@media(max-width:680px){
  .vendor-profile-heading{gap:12px}
  .vendor-profile-heading .header-actions{width:auto!important;display:flex!important;gap:10px!important;flex-wrap:nowrap!important}
  .vendor-profile-heading .header-actions .btn{flex:0 0 auto!important;width:auto!important;white-space:nowrap}
  .vendor-period-filter{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto!important}
  .vendor-summary-grid .summary-card{min-height:88px;background:#fff;border-radius:12px}
}
@media(max-width:520px){
  .vendor-profile-heading .header-actions{width:100%!important}
  .vendor-profile-heading .header-actions .btn{flex:1 1 0!important;text-align:center}
  .vendor-period-filter{grid-template-columns:1fr 1fr!important}
  .vendor-period-filter .btn{width:100%!important}
}


/* Phase 2.14 – Recurring Bills dashboard & tracking */
.recurring-stat-grid{grid-template-columns:repeat(5,minmax(0,1fr));margin-bottom:18px}
.recurring-add-form,.recurring-directory-card,.recurring-profile-card,.recurring-history-card{padding:22px}
.recurring-add-form{margin-bottom:18px}
.recurring-form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:18px 0}
.recurring-form-grid .grid-span-2{grid-column:span 2}
.recurring-filter-toolbar{display:grid;grid-template-columns:minmax(220px,2fr) repeat(4,minmax(135px,1fr)) auto auto;gap:10px;align-items:end;margin:18px 0}
.recurring-filter-toolbar label{margin:0}
.recurring-filter-toolbar .btn{height:42px;white-space:nowrap}
.recurring-table{width:100%;border-collapse:collapse}
.recurring-table th,.recurring-table td{padding:13px 14px;border-bottom:1px solid #ececf5;vertical-align:middle;text-align:left}
.recurring-table th{font-size:11px;text-transform:uppercase;letter-spacing:.055em;color:#77758c;background:#fafafe}
.recurring-table td{font-size:13px}.recurring-table td small{display:block;margin-top:4px;color:#858298}
.table-primary-link{color:#4f24d8;font-weight:700;text-decoration:none}.table-primary-link:hover{text-decoration:underline}
.compact-action-group{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.recurring-profile-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.recurring-detail-stats{grid-template-columns:repeat(6,minmax(0,1fr));margin:18px 0}.recurring-history-card{margin-top:18px}
.header-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
@media(max-width:1250px){.recurring-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.recurring-detail-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.recurring-filter-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}.recurring-filter-toolbar .btn{width:100%}}
@media(max-width:900px){.recurring-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.recurring-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.recurring-table{min-width:900px}.recurring-directory-card,.recurring-history-card{overflow:hidden}}
@media(max-width:640px){.recurring-stat-grid,.recurring-detail-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.recurring-form-grid,.recurring-filter-toolbar,.recurring-profile-grid{grid-template-columns:1fr}.recurring-form-grid .grid-span-2{grid-column:auto}.recurring-add-form,.recurring-directory-card,.recurring-profile-card,.recurring-history-card{padding:16px}.header-actions{width:100%;gap:8px}.header-actions .btn{flex:1 1 auto;text-align:center}}

/* =========================================================
   Phase 2.15 - app-wide typography + recurring schedule gutter
   ========================================================= */

/* Global readable type scale. Keep layout compact, but avoid 9-11px UI text. */
body{font-size:15px;line-height:1.56}
.page-subtitle,.accounts-page-heading p,.muted{font-size:14px;line-height:1.55}
h1{font-size:29px}h2{font-size:22px}h3{font-size:16px}
label{font-size:12.5px}
input,select,textarea{font-size:14px;line-height:1.45}
.btn,.btn-danger,button{font-size:12.5px}

/* Core tables */
th,td{font-size:13px}
th{font-size:10.5px}
.badge,.expense-status{font-size:10.5px}
.table-sub,.expense-table td small{font-size:11.5px}

/* Sidebar / top navigation */
.nav-link,.logout-link{font-size:14px}
.sidebar-section-label{font-size:10px}
.user-copy strong{font-size:13.5px}.user-copy span{font-size:10px}
.topbar-eyebrow{font-size:10.5px}.topbar-title{font-size:18.5px}.topbar-role{font-size:12px}

/* Summary/KPI cards */
.kpi,.finance-kpi span,.summary-card span,.account-stat span{font-size:10.75px}
.kpi strong{font-size:27px}
.finance-kpi small,.summary-card small,.account-stat small{font-size:11px}

/* Forms and settings */
.expense-filter label,.expense-form label,.compact-form label,.settings-card form>label,.settings-inline-form label,.vendor-add-form label,.vendor-edit-form label{font-size:12.5px!important}
.form-section-title{font-size:16px}
.settings-card p,.upload-panel span,.gst-helper{font-size:12.5px}

/* Sales ledger: previous compact rules were intentionally small; increase them globally. */
.sales-ledger-table th{font-size:10.5px!important}
.sales-ledger-table td{font-size:13px!important;line-height:1.5!important}
.sales-ledger-table td strong{font-size:13.5px!important}
.sales-ledger-table .table-sub{font-size:11.25px!important}
.sales-status,.sales-cat{font-size:10px!important}
.row-view-link{font-size:11.5px!important}
.pagination-info,.pagination-links .page-btn{font-size:12px!important}

/* Expenses */
.expense-table{font-size:13.5px}
.expense-table th{font-size:10.5px}
.expense-table td small{font-size:11.5px}
.btn-sm{font-size:12px!important}
.doc-count{font-size:11.5px}
.pending-small{font-size:11.5px}

/* Vendor directory/details */
.vendor-directory-head{font-size:10.5px}
.vendor-directory-table .vendor-main strong,.vendor-contact strong,.vendor-location strong{font-size:13.5px}
.vendor-directory-table .vendor-main small,.vendor-contact small,.vendor-location small{font-size:11.5px}
.vendor-usage-cell strong{font-size:13px}.vendor-usage-cell small{font-size:11px}
.vendor-directory-table .vendor-actions .btn,.vendor-directory-table .vendor-actions .btn-danger{font-size:11.5px}
.vendor-profile-grid span{font-size:10.75px}.vendor-profile-grid strong{font-size:14px}
.vendor-summary-grid .summary-card span{font-size:10.75px}.vendor-summary-grid .summary-card small{font-size:11px}.vendor-summary-grid .summary-card strong{font-size:20px}
.vendor-ledger-table th{font-size:10.5px}.vendor-ledger-table td{font-size:13px}.vendor-ledger-table td small{font-size:11px}

/* Recurring Bills: restore a real inner gutter despite generic table-card reset. */
.card.recurring-directory-card:has(table){padding:22px!important;overflow:hidden}
.recurring-directory-card>.section-title-row{margin:0 0 16px!important;padding:0 0 14px!important;border-bottom:1px solid #eeeaf5}
.recurring-directory-card>.section-title-row .muted{margin-top:5px}
.recurring-directory-card .recurring-filter-toolbar{margin:14px 0 18px}
.recurring-directory-card .table-wrap{border:1px solid #ece9f3;border-radius:12px;overflow:auto;background:#fff}
.recurring-directory-card .standard-pagination{margin:14px 0 0!important;border:1px solid #ece9f3!important;border-radius:10px!important}
.recurring-table th{font-size:10.5px}.recurring-table td{font-size:13.5px}.recurring-table td small{font-size:11.5px}
.recurring-filter-toolbar label{font-size:12.5px}
.recurring-filter-toolbar input,.recurring-filter-toolbar select{font-size:13.5px}

/* Recurring add/details */
.recurring-add-form p,.recurring-profile-card p,.recurring-history-card p{font-size:13.5px}
.recurring-add-form label,.recurring-profile-card label{font-size:12.5px}

@media(max-width:900px){
  body{font-size:15px}
  .card.recurring-directory-card:has(table){padding:18px!important}
  .sales-ledger-table td[data-label="Invoice"] strong{font-size:16px!important}
  .sales-ledger-table td[data-label="Total"] strong{font-size:20px!important}
  .sales-ledger-table td[data-label="Customer"]>strong{font-size:15px!important}
  .sales-ledger-table td[data-label="Date"],.sales-ledger-table td[data-label="GSTIN / POS"],.sales-ledger-table td[data-label="Currency"],.sales-ledger-table td[data-label="Taxable"],.sales-ledger-table td[data-label="GST"]{font-size:13px!important}
  .sales-ledger-table td:before{font-size:10px!important}
}
@media(max-width:640px){
  .card.recurring-directory-card:has(table){padding:15px!important}
  .recurring-directory-card>.section-title-row{padding-bottom:12px!important;margin-bottom:12px!important}
}


/* Phase 2.16 - recurring bill detail polish + composed table-card audit */
.card.recurring-history-card:has(table){padding:22px!important;overflow:hidden}
.card.recurring-history-card:has(table)>.section-title-row{margin:0 0 16px!important;padding:0 0 14px!important;border-bottom:1px solid #eeeaf5}
.card.recurring-history-card:has(table)>.section-title-row .muted{margin-top:5px}
.card.recurring-history-card:has(table)>.table-wrap{margin:0!important;border:1px solid #ece9f3;border-radius:12px;overflow:auto;background:#fff}
.card.recurring-history-card:has(table)>.standard-pagination{margin:14px 0 0!important;border:1px solid #ece9f3!important;border-radius:10px!important}
.recurring-profile-grid>div{min-width:0;display:flex;flex-direction:column;gap:6px}
.recurring-profile-grid>div>span{display:block;color:#858298;font-size:11.5px;line-height:1.35;font-weight:800;text-transform:uppercase;letter-spacing:.045em}
.recurring-profile-grid>div>strong{display:block;color:#252439;font-size:14.5px;line-height:1.45;overflow-wrap:anywhere}
.recurring-profile-grid .detail-span-full{grid-column:1/-1}
@media(max-width:900px){.card.recurring-history-card:has(table){padding:18px!important}}
@media(max-width:640px){.card.recurring-history-card:has(table){padding:15px!important}.card.recurring-history-card:has(table)>.section-title-row{padding-bottom:12px!important;margin-bottom:12px!important}.recurring-profile-grid>div>strong{font-size:14px}}


/* Phase 2.17 - recurring amount prefill */
.recurring-amount-notice{
  display:flex;align-items:flex-start;justify-content:space-between;gap:18px;
  margin:0 0 18px;padding:13px 15px;border:1px solid #ddd4ff;border-radius:11px;
  background:#f8f5ff;color:#4c327e;
}
.recurring-amount-notice strong{font-size:13.5px;line-height:1.4}
.recurring-amount-notice span{font-size:12.5px;line-height:1.45;color:#706789;text-align:right}
@media(max-width:700px){.recurring-amount-notice{flex-direction:column;gap:5px}.recurring-amount-notice span{text-align:left}}


/* Phase 2.18 - recurring bill expected amount prefill */
.recurring-amount-notice{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin:0 0 18px;padding:13px 15px;border:1px solid #ddd4ff;border-radius:11px;background:#f8f5ff;color:#4c327e}
.recurring-amount-notice strong{font-size:13.5px;line-height:1.4}
.recurring-amount-notice span{font-size:12.5px;line-height:1.45;color:#706789;text-align:right;max-width:620px}
@media(max-width:700px){.recurring-amount-notice{flex-direction:column;gap:5px}.recurring-amount-notice span{text-align:left}}


/* Phase 2.19 - recurring expected amount prefill */
.recurring-amount-notice{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin:0 0 18px;padding:13px 15px;border:1px solid #ddd4ff;border-radius:11px;background:#f8f5ff;color:#4c327e}
.recurring-amount-notice strong{font-size:13.5px;line-height:1.4}
.recurring-amount-notice span{font-size:12.5px;line-height:1.45;color:#706789;text-align:right;max-width:620px}
@media(max-width:700px){.recurring-amount-notice{flex-direction:column;gap:5px}.recurring-amount-notice span{text-align:left}}


/* Phase 3.0 - Employees foundation */
.employee-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:18px}
.employee-filter-bar{display:grid;grid-template-columns:minmax(280px,1fr) 210px auto auto;gap:12px;align-items:end;padding:18px;background:#fff;border:1px solid #e8e5f0;border-radius:15px;box-shadow:0 10px 28px rgba(26,18,50,.045);margin-bottom:18px}
.employee-filter-bar label{margin:0}.employee-filter-bar .btn{min-height:44px;margin:0}
.employee-directory-card:has(table){padding:0!important;overflow:hidden}.employee-directory-card .table-wrap{margin:0}.employee-table td small{display:block;margin-top:4px;color:#8d899d}.employee-row-actions{display:flex;gap:6px;justify-content:flex-end;align-items:center;flex-wrap:wrap}.employee-row-actions form{margin:0}.employee-form{padding:24px}.employee-form-actions{display:flex;gap:12px;margin-top:20px}.employee-profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:18px}.employee-profile-card{padding:22px}.employee-profile-card h3{margin:0 0 16px}.employee-profile-card dl{display:grid;grid-template-columns:130px 1fr;gap:11px 14px;margin:0}.employee-profile-card dt{color:#8b8799;font-weight:700}.employee-profile-card dd{margin:0;font-weight:600;overflow-wrap:anywhere}.employee-payroll-placeholder,.employee-notes{padding:22px;margin-top:18px}.employee-payroll-placeholder .empty-cell{padding:34px 10px}.notes-full{display:block;margin-top:18px}.notes-full textarea{width:100%}.dashboard-workforce{padding:20px;margin-bottom:18px}
#itc_eligible_wrap[hidden],#edit_itc_wrap[hidden]{display:none!important}
@media(max-width:1000px){.employee-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.employee-profile-grid{grid-template-columns:1fr 1fr}.employee-filter-bar{grid-template-columns:minmax(0,1fr) 180px auto auto}}
@media(max-width:700px){.employee-kpi-grid,.employee-profile-grid{grid-template-columns:1fr}.employee-filter-bar{grid-template-columns:minmax(0,1fr) 120px auto auto;gap:8px;padding:12px}.employee-filter-bar input,.employee-filter-bar select{min-width:0}.employee-filter-bar .btn{padding-left:11px;padding-right:11px}.employee-profile-card dl{grid-template-columns:110px 1fr}.employee-row-actions{justify-content:flex-start}.employee-form{padding:18px}}


/* Phase 3.0.1 - Employee form responsive grid + salary UX */
.employee-form .app-responsive-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:15px 16px}
.employee-form .form-section-title{margin-top:6px;margin-bottom:16px}
.employee-form .field-optional,.employee-form .field-hint{font-size:11px;color:#9691a4;font-weight:600;margin-left:5px}
.employee-form input[name="pan_number"]{text-transform:uppercase}
.salary-zero-question{margin-top:12px!important;color:#27233a!important}
@media(max-width:1100px){.employee-form .app-responsive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.employee-form .span-2{grid-column:1/-1}}
@media(max-width:640px){.employee-form .app-responsive-grid{grid-template-columns:1fr!important}.employee-form .span-2{grid-column:1!important}}


/* Phase 3.0.2 - Employee form visual structure */
.employee-form{display:grid;gap:18px;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
.employee-form-section{padding:22px!important;margin:0!important}
.employee-section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 18px;padding:0 0 14px;border-bottom:1px solid #ece9f3}
.employee-section-heading h3{margin:0 0 5px;font-size:17px}
.employee-section-heading p{margin:0;color:#8b8799;font-size:13px}
.employee-form input::placeholder,.employee-form textarea::placeholder{color:#b7b2c3!important;opacity:1;font-weight:500}
.employee-form .employee-full-address{grid-column:1/-1!important}
.employee-form .notes-full{grid-column:1/-1!important;margin-top:0}
.employee-form-actions{margin:0!important;padding:2px 0 0}
#preferred_salary_other_wrap[hidden]{display:none!important}
@media(max-width:1100px){.employee-form .app-responsive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.employee-form .employee-full-address,.employee-form .notes-full{grid-column:1/-1!important}}
@media(max-width:640px){.employee-form .app-responsive-grid{grid-template-columns:1fr!important}.employee-form .employee-full-address,.employee-form .notes-full{grid-column:1!important}.employee-form-section{padding:17px!important}}

/* Phase 3.1 - Payroll */
.payroll-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}
.payroll-filter-bar{display:grid;grid-template-columns:190px minmax(240px,1fr) 180px auto auto;gap:12px;align-items:end;padding:18px;background:#fff;border:1px solid #e8e5f0;border-radius:15px;box-shadow:0 10px 28px rgba(26,18,50,.045);margin-bottom:18px}
.payroll-filter-bar label{margin:0}.payroll-filter-bar .btn{min-height:44px;margin:0}
.payroll-list-card:has(table){padding:0!important;overflow:hidden}.payroll-list-card .table-wrap{margin:0}.payroll-table td small{display:block;color:#8e899e;margin-top:4px}
.payroll-form{padding:24px}.payroll-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}.payroll-form label small{display:block;margin-top:5px;color:#928da0;font-weight:500}
.payroll-posting-note{margin-top:18px;padding:13px 15px;border:1px solid #ddd4ff;background:#f8f5ff;border-radius:11px;color:#655480;line-height:1.5}
.payroll-detail-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin-bottom:18px}.payroll-payment-history{padding:22px}.payroll-payment-history .table-wrap{margin:15px 0 0;border:1px solid #ece9f3;border-radius:12px;overflow:auto}
.payroll-payment-action{display:flex;align-items:center;gap:14px;margin-top:16px}.employee-payroll-history{padding:22px;margin-top:18px}.employee-payroll-history .table-wrap{margin:16px 0 0;border:1px solid #ece9f3;border-radius:12px;overflow:auto}.salary-history-footer{text-align:right;margin-top:12px}.dashboard-payroll{padding:20px;margin-bottom:18px}
@media(max-width:1100px){.payroll-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.payroll-detail-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.payroll-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.payroll-filter-bar{grid-template-columns:160px minmax(200px,1fr) 150px auto auto}}
@media(max-width:720px){.payroll-kpi-grid,.payroll-detail-kpis{grid-template-columns:1fr 1fr}.payroll-grid{grid-template-columns:1fr!important}.payroll-filter-bar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:12px}.payroll-filter-bar .btn{width:100%}.payroll-payment-action{align-items:flex-start;flex-direction:column}}
@media(max-width:480px){.payroll-detail-kpis{grid-template-columns:1fr}}


/* Phase 3.1.2 - Salary History spacing + PDF action */
.employee-payroll-history.card{padding:22px!important;overflow:hidden!important}
.employee-payroll-history>.section-title-row{margin:0 0 16px!important}
.employee-payroll-history .table-wrap{margin:0!important;border:1px solid #ece9f3!important;border-radius:12px!important;overflow:auto!important}
.employee-payroll-history .salary-history-footer{margin:14px 0 0!important;padding:0!important}
.employee-payroll-history table th,.employee-payroll-history table td{padding-left:14px!important;padding-right:14px!important}
.payroll-payment-history.card{padding:22px!important}
.salary-row-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end}
@media(max-width:700px){.employee-payroll-history.card,.payroll-payment-history.card{padding:16px!important}.salary-row-actions{justify-content:flex-start;flex-wrap:wrap}}

/* Phase 3.1.3 - Salary Slip settings */
.salary-slip-settings-card{margin-top:18px}
.salary-slip-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.salary-slip-settings-grid .span-2{grid-column:1/-1}
.salary-slip-settings-form small{display:block;margin-top:5px;color:#918c9e;font-weight:500}
@media(max-width:760px){.salary-slip-settings-grid{grid-template-columns:1fr!important}.salary-slip-settings-grid .span-2{grid-column:1}}

/* Phase 3.1.4 */
.employee-payroll-history{padding:24px!important}
.employee-payroll-history>.section-title-row{padding:0!important;margin-bottom:16px}
.employee-payroll-history>.table-wrap{margin:0!important}
.payroll-form label small{line-height:1.35}

/* Phase 3.2 - Salary Advance Ledger */
.advance-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}
.advance-record-card{padding:22px;margin-bottom:18px}.advance-form-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.advance-list-card{padding:0!important;overflow:hidden}.advance-list-card .table-wrap{margin:0}
.employee-advance-card{padding:24px!important;margin-top:18px}.employee-advance-card>.section-title-row{padding:0!important;margin-bottom:16px}.employee-advance-card>.table-wrap{margin:16px 0 0!important;border:1px solid #ece9f3;border-radius:12px;overflow:auto}
.advance-mini-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.advance-mini-kpis>div{padding:13px 15px;background:#faf9fd;border:1px solid #ece9f3;border-radius:11px}.advance-mini-kpis span{display:block;color:#8a8498;font-size:12px;font-weight:700;text-transform:uppercase}.advance-mini-kpis strong{display:block;margin-top:4px;font-size:18px}.advance-mini-kpis .warning{border-left:3px solid #f59e0b}
@media(max-width:1100px){.advance-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.advance-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.advance-form-grid{grid-template-columns:1fr!important}.advance-mini-kpis{grid-template-columns:1fr}.advance-kpi-grid{grid-template-columns:1fr 1fr}}

/* Phase 3.2.1 - Salary Advances employee display */
.advance-list-card .employee-cell{white-space:normal}
.advance-list-card .employee-name-link{display:block;font-weight:700;line-height:1.25}
.advance-list-card .employee-code{display:block;margin-top:3px;color:#918c9e;font-size:12px;line-height:1.2}

/* Phase 4.0 - Transactions */
.transactions-heading{align-items:flex-start}
.transaction-filter-card{padding:20px!important;margin-bottom:18px}
.transaction-filter-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:14px}
.transaction-filter-grid .transaction-search{grid-column:span 1}
.transaction-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}
.transaction-method-summary{padding:22px!important;margin-bottom:18px}
.transaction-list-card{padding:0!important;overflow:hidden}
.transaction-list-card .table-wrap{margin:0}
.transaction-list-card td strong+small,.transaction-list-card td small{display:block;margin-top:3px;color:#918c9e;font-size:12px}
.transaction-type{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.transaction-type.type-expense{background:#eef2ff;color:#4f46e5}
.transaction-type.type-salary{background:#ecfdf3;color:#15803d}
.transaction-type.type-advance{background:#fff7ed;color:#c2410c}
.advance-list-card td small{display:block;margin-top:3px;color:#918c9e;font-size:12px}
@media(max-width:1250px){
  .transaction-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .transaction-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .transaction-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .transaction-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
  .transaction-filter-grid{grid-template-columns:1fr!important}
  .transaction-kpi-grid{grid-template-columns:1fr}
}

/* Phase 4.0.1 - Responsive Transactions cards */
.transaction-mobile-list{display:none}
@media(max-width:980px){
  .transaction-desktop-table{display:none}
  .transaction-mobile-list{display:grid;gap:14px;padding:16px}
  .transaction-list-card{padding:0!important;background:transparent!important;box-shadow:none!important;border:0!important;overflow:visible}
  .transaction-mobile-card{background:#fff;border:1px solid #e8e4f0;border-radius:16px;padding:16px;box-shadow:0 7px 20px rgba(36,25,66,.06)}
  .transaction-mobile-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:13px}
  .transaction-mobile-date{margin-top:7px;color:#777185;font-size:13px;font-weight:600}
  .transaction-mobile-amount{font-size:19px;line-height:1.1;white-space:nowrap;color:#17142a}
  .transaction-mobile-main{display:flex;flex-direction:column;gap:3px;margin-bottom:5px}
  .transaction-mobile-main strong{font-size:16px;color:#18152b}
  .transaction-mobile-main span,.transaction-mobile-party{font-size:13px;color:#8d8799}
  .transaction-mobile-party{margin-bottom:14px}
  .transaction-mobile-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border-top:1px solid #eeeaf4;padding-top:13px}
  .transaction-mobile-meta div{min-width:0}
  .transaction-mobile-meta span{display:block;font-size:11px;color:#948ea1;font-weight:800;text-transform:uppercase;letter-spacing:.03em;margin-bottom:4px}
  .transaction-mobile-meta strong{display:block;font-size:13px;line-height:1.35;word-break:break-word;color:#2a2636}
  .transaction-mobile-view{display:block;width:100%;margin-top:14px;text-align:center}
  .transaction-list-card .sales-pagination{background:#fff;border:1px solid #e8e4f0;border-radius:14px;margin:0 16px 16px;padding:12px 14px}
}
@media(max-width:620px){
  .transaction-mobile-meta{grid-template-columns:1fr}
  .transaction-mobile-card{padding:15px}
  .transaction-mobile-amount{font-size:18px}
}

/* Phase 4.1 - Financial Reports */
.reports-heading{align-items:flex-start}
.report-period-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border:1px solid #e9e5ef;border-radius:14px;padding:12px 14px;margin-bottom:18px;box-shadow:0 5px 18px rgba(37,28,62,.04)}
.report-custom-period{display:flex;align-items:center;gap:9px}.report-custom-period input{min-width:145px}
.report-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.report-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px}
.report-section{padding:22px!important}.report-table-section{margin-bottom:18px}.report-table-section>.table-wrap{margin:14px 0 0;border:1px solid #ece9f2;border-radius:12px;overflow:auto}
.report-metric-list{display:grid;gap:0;border:1px solid #eeeaf3;border-radius:12px;overflow:hidden}.report-metric-list>div{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:13px 15px;border-bottom:1px solid #eeeaf3;background:#fff}.report-metric-list>div:last-child{border-bottom:0}.report-metric-list span{color:#5f596d}.report-metric-list span small{display:block;color:#9992a4;font-size:11px;margin-top:3px}.report-metric-list strong{white-space:nowrap;font-size:15px}.report-metric-list .report-emphasis{background:#faf8ff}
.report-note{font-size:12px;color:#8d8698;line-height:1.5;margin:12px 2px 0}
.report-ranking{display:grid;gap:14px}.ranking-row{display:grid;gap:7px}.ranking-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-end}.ranking-head span{font-weight:700}.ranking-head small{display:block;font-size:11px;font-weight:500;color:#9992a4;margin-top:2px}.ranking-bar{height:7px;background:#f0edf5;border-radius:999px;overflow:hidden}.ranking-bar span{display:block;height:100%;background:linear-gradient(90deg,#7c3aed,#9b71f5);border-radius:999px}
.negative-value{color:#c43b3b}.finance-kpi.danger{border-left-color:#ef4444!important}
@media(max-width:1150px){.report-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.report-two-col{grid-template-columns:1fr}}
@media(max-width:760px){.report-period-bar{align-items:stretch;flex-direction:column}.report-custom-period{display:grid;grid-template-columns:1fr auto 1fr auto}.report-custom-period input{min-width:0;width:100%}}
@media(max-width:520px){.report-kpi-grid{grid-template-columns:1fr}.report-custom-period{grid-template-columns:1fr}.report-custom-period span{display:none}.report-custom-period .btn{width:100%}.report-section{padding:18px!important}}

/* Phase 4.1.1 - Collapsible + Scrollable Sidebar */
.sidebar{overflow:hidden}
.sidebar .brand{flex:0 0 auto}
.sidebar-scroll-menu{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:0 2px 10px;
  margin:0 -2px;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.18) transparent;
}
.sidebar-scroll-menu::-webkit-scrollbar{width:5px}
.sidebar-scroll-menu::-webkit-scrollbar-track{background:transparent}
.sidebar-scroll-menu::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:999px}
.sidebar-scroll-menu::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.28)}
.sidebar-menu-group{margin:0 0 6px}
.sidebar-group-toggle{
  width:100%;
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 10px;
  border:0;
  border-radius:8px;
  background:transparent;
  box-shadow:none;
  color:#958dac;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:.11em;
  font-size:9px;
  font-weight:800;
  text-align:left;
}
.sidebar-group-toggle:hover{background:rgba(255,255,255,.055);color:#c9c2d9}
.sidebar-group-toggle svg{
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:transform .18s ease;
}
.sidebar-menu-group.open .sidebar-group-toggle svg{transform:rotate(90deg)}
.sidebar-group-links{
  display:grid;
  grid-template-rows:0fr;
  transition:grid-template-rows .2s ease;
}
.sidebar-group-links>.nav-link{
  overflow:hidden;
  min-height:0;
}
.sidebar-menu-group.open .sidebar-group-links{
  grid-template-rows:1fr;
}
.sidebar-menu-group:not(.open) .sidebar-group-links>.nav-link{
  display:none;
}
.sidebar-menu-group.open .sidebar-group-links>.nav-link{display:flex}
.sidebar-footer{
  flex:0 0 auto;
  margin-top:0!important;
  background:linear-gradient(180deg,rgba(43,36,72,.03),rgba(43,36,72,.22));
  position:relative;
  z-index:2;
}

/* When the sidebar is already in icon-only responsive mode, hide group headings
   and let the existing icon navigation behaviour remain compact. */
@media(max-width:980px){
  .sidebar-group-toggle span{display:none}
  .sidebar-group-toggle{justify-content:center;padding:6px 0;min-height:28px}
  .sidebar-group-toggle svg{width:12px;height:12px}
}

/* Phase 4.1.2 - Tablet Hover Sidebar + Mobile Off-Canvas Navigation */

/* Shared button inserted into brand area */
.sidebar-expand-btn{
  margin-left:auto;
  width:32px;height:32px;
  display:none;
  align-items:center;justify-content:center;
  border:0;border-radius:9px;
  background:rgba(255,255,255,.08);
  color:#fff;cursor:pointer;
}
.sidebar-expand-btn:hover{background:rgba(255,255,255,.14)}
.sidebar-expand-btn svg,.mobile-menu-btn svg{
  width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}

/* Mobile header hidden by default */
.mobile-app-header,.mobile-nav-backdrop{display:none}

/* Tablet / smaller laptop */
@media(min-width:761px) and (max-width:1180px){
  .sidebar{
    width:76px!important;
    overflow:visible!important;
    transition:width .2s ease,box-shadow .2s ease;
    z-index:80;
  }
  .sidebar .brand{
    padding-left:14px!important;padding-right:10px!important;
    min-height:66px;
  }
  .sidebar .brand img{
    width:42px!important;
    max-width:42px!important;
    object-fit:contain;
    object-position:left center;
  }
  .sidebar-expand-btn{display:flex}
  .sidebar-scroll-menu{overflow-y:auto;overflow-x:hidden}
  .sidebar-group-toggle{justify-content:center}
  .sidebar-group-toggle span{display:none}
  .sidebar-group-toggle svg{display:block}
  .sidebar .nav-link{
    justify-content:center;
    padding-left:0!important;padding-right:0!important;
    gap:0!important;
  }
  .sidebar .nav-link span{display:none}
  .sidebar-footer .user-info,
  .sidebar-footer .logout-text{display:none}
  .sidebar-footer{align-items:center}
  .sidebar.sidebar-hover-open,
  .sidebar.sidebar-pinned{
    width:226px!important;
    box-shadow:14px 0 34px rgba(21,15,42,.24);
  }
  .sidebar.sidebar-hover-open .brand img,
  .sidebar.sidebar-pinned .brand img{
    width:168px!important;
    max-width:168px!important;
  }
  .sidebar.sidebar-hover-open .sidebar-group-toggle,
  .sidebar.sidebar-pinned .sidebar-group-toggle{
    justify-content:space-between;
  }
  .sidebar.sidebar-hover-open .sidebar-group-toggle span,
  .sidebar.sidebar-pinned .sidebar-group-toggle span{display:inline}
  .sidebar.sidebar-hover-open .sidebar .nav-link,
  .sidebar.sidebar-pinned .sidebar .nav-link{justify-content:flex-start}
  .sidebar.sidebar-hover-open .nav-link,
  .sidebar.sidebar-pinned .nav-link{
    justify-content:flex-start;
    padding-left:14px!important;padding-right:14px!important;
    gap:12px!important;
  }
  .sidebar.sidebar-hover-open .nav-link span,
  .sidebar.sidebar-pinned .nav-link span{display:inline}
  .sidebar.sidebar-hover-open .sidebar-footer .user-info,
  .sidebar.sidebar-pinned .sidebar-footer .user-info,
  .sidebar.sidebar-hover-open .sidebar-footer .logout-text,
  .sidebar.sidebar-pinned .sidebar-footer .logout-text{display:block}
}

/* Mobile */
@media(max-width:760px){
  body{padding-top:64px}
  .mobile-app-header{
    display:flex;
    position:fixed;
    top:0;left:0;right:0;
    height:64px;
    z-index:120;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:0 14px;
    background:#fff;
    border-bottom:1px solid #ebe7f1;
    box-shadow:0 3px 15px rgba(30,22,54,.06);
  }
  .mobile-brand{display:flex;align-items:center;min-width:0}
  .mobile-brand-logo{
    display:block;
    width:auto;
    max-width:178px;
    height:38px;
    object-fit:contain;
    object-position:left center;
  }
  .mobile-menu-btn{
    flex:0 0 auto;
    width:42px;height:42px;
    display:flex;align-items:center;justify-content:center;
    border:1px solid #e6e1ee;border-radius:11px;
    background:#fff;color:#2e2742;cursor:pointer;
  }
  .mobile-menu-btn .menu-close-icon{display:none}
  body.mobile-nav-open .mobile-menu-btn .menu-open-icon{display:none}
  body.mobile-nav-open .mobile-menu-btn .menu-close-icon{display:block}

  .sidebar{
    display:flex!important;
    position:fixed!important;
    top:64px!important;
    left:0!important;
    bottom:0!important;
    width:min(88vw,320px)!important;
    height:auto!important;
    transform:translateX(-104%);
    transition:transform .22s ease;
    z-index:115!important;
    overflow:hidden!important;
    box-shadow:16px 0 36px rgba(20,14,40,.22);
  }
  .sidebar.mobile-sidebar-open{transform:translateX(0)}
  .sidebar .brand{display:none!important}
  .sidebar-scroll-menu{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto!important;
    padding:14px 10px 12px!important;
  }
  .sidebar-group-toggle{
    min-height:38px;
    justify-content:space-between!important;
    padding:9px 10px!important;
  }
  .sidebar-group-toggle span{display:inline!important}
  .sidebar-group-toggle svg{display:block!important}
  .sidebar .nav-link{
    justify-content:flex-start!important;
    gap:12px!important;
    padding:11px 13px!important;
  }
  .sidebar .nav-link span{display:inline!important}
  .sidebar-footer{
    flex:0 0 auto;
    padding-bottom:max(14px,env(safe-area-inset-bottom));
  }
  .sidebar-footer .user-info,
  .sidebar-footer .logout-text{display:block!important}

  .mobile-nav-backdrop{
    position:fixed;
    inset:64px 0 0 0;
    z-index:110;
    background:rgba(14,10,28,.46);
    backdrop-filter:blur(1px);
  }
  body.mobile-nav-open .mobile-nav-backdrop{display:block}
  body.mobile-nav-open{overflow:hidden}

  /* Prevent legacy responsive sidebar width from shifting page content. */
  .main-content,.content-wrap,main{margin-left:0!important}
}

/* Phase 4.1.3 - Responsive Navigation Corrections */

/* Group headings are navigation labels, so keep them readable. */
.sidebar-group-toggle{
  font-size:11px!important;
  letter-spacing:.075em!important;
  font-weight:800!important;
}

/* Reliable 3-line menu glyphs; avoids browser/SVG rendering issues. */
.sidebar-expand-glyph,
.mobile-menu-glyph{
  width:18px;
  height:14px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:stretch;
}
.sidebar-expand-glyph i,
.mobile-menu-glyph i{
  display:block;
  height:2px;
  width:100%;
  border-radius:999px;
  background:currentColor;
  transition:transform .18s ease,opacity .18s ease;
}

/* Pinned tablet sidebar shows a compact close/collapse symbol. */
.sidebar.sidebar-pinned .sidebar-expand-glyph i:nth-child(1){
  transform:translateY(6px) rotate(45deg);
}
.sidebar.sidebar-pinned .sidebar-expand-glyph i:nth-child(2){opacity:0}
.sidebar.sidebar-pinned .sidebar-expand-glyph i:nth-child(3){
  transform:translateY(-6px) rotate(-45deg);
}

/* Tablet / small laptop */
@media(min-width:761px) and (max-width:1180px){
  .sidebar .brand{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:4px!important;
    padding:12px 8px!important;
    min-height:66px!important;
  }

  /* Fit logo icon + navigation control in the slim 76px sidebar cleanly. */
  .sidebar .brand img{
    width:34px!important;
    height:38px!important;
    max-width:34px!important;
    flex:0 0 34px!important;
    object-fit:cover!important;
    object-position:left center!important;
  }
  .sidebar-expand-btn{
    display:flex!important;
    flex:0 0 27px!important;
    width:27px!important;
    height:30px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid rgba(255,255,255,.10)!important;
    border-radius:8px!important;
    background:rgba(255,255,255,.07)!important;
    box-shadow:none!important;
  }
  .sidebar-expand-btn:hover{
    background:rgba(255,255,255,.13)!important;
  }
  .sidebar-expand-glyph{
    width:14px;
    height:11px;
  }
  .sidebar-expand-glyph i{height:1.6px}

  /* Expanded/hovered state restores the normal full logo and desktop-style footer. */
  .sidebar.sidebar-hover-open .brand,
  .sidebar.sidebar-pinned .brand{
    padding:12px 12px!important;
    gap:8px!important;
  }
  .sidebar.sidebar-hover-open .brand img,
  .sidebar.sidebar-pinned .brand img{
    width:164px!important;
    height:42px!important;
    max-width:164px!important;
    flex:1 1 auto!important;
    object-fit:contain!important;
    object-position:left center!important;
  }
  .sidebar.sidebar-hover-open .sidebar-expand-btn,
  .sidebar.sidebar-pinned .sidebar-expand-btn{
    flex:0 0 30px!important;
    width:30px!important;
    height:30px!important;
  }

  /* Collapsed footer: neat icon state. */
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .user-card{
    justify-content:center!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .user-copy{
    display:none!important;
  }
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .logout-link{
    justify-content:center!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .logout-link span{
    display:none!important;
  }

  /* Expanded footer must look exactly like normal desktop footer. */
  .sidebar.sidebar-hover-open .sidebar-footer,
  .sidebar.sidebar-pinned .sidebar-footer{
    padding-top:16px!important;
  }
  .sidebar.sidebar-hover-open .user-card,
  .sidebar.sidebar-pinned .user-card{
    justify-content:flex-start!important;
    padding:4px 9px 12px!important;
    gap:10px!important;
  }
  .sidebar.sidebar-hover-open .user-copy,
  .sidebar.sidebar-pinned .user-copy{
    display:flex!important;
  }
  .sidebar.sidebar-hover-open .logout-link,
  .sidebar.sidebar-pinned .logout-link{
    justify-content:flex-start!important;
    padding:9px 11px!important;
    gap:10px!important;
  }
  .sidebar.sidebar-hover-open .logout-link span,
  .sidebar.sidebar-pinned .logout-link span{
    display:inline!important;
  }
}

/* Mobile header */
@media(max-width:760px){
  .mobile-app-header{
    height:64px!important;
    padding:0 15px!important;
  }
  .mobile-brand{
    flex:1 1 auto!important;
    overflow:hidden!important;
  }
  .mobile-brand-logo{
    display:block!important;
    width:auto!important;
    max-width:190px!important;
    height:40px!important;
    object-fit:contain!important;
    object-position:left center!important;
  }
  .mobile-menu-btn{
    width:43px!important;
    height:43px!important;
    border-radius:11px!important;
    color:#312a47!important;
    background:#fff!important;
    box-shadow:0 4px 12px rgba(34,25,57,.06)!important;
  }
  .mobile-menu-glyph{
    width:20px;
    height:15px;
  }
  .mobile-menu-glyph i{
    height:2px;
    background:#312a47;
  }

  /* Animate hamburger into a clear X when open. */
  body.mobile-nav-open .mobile-menu-glyph i:nth-child(1){
    transform:translateY(6.5px) rotate(45deg);
  }
  body.mobile-nav-open .mobile-menu-glyph i:nth-child(2){
    opacity:0;
  }
  body.mobile-nav-open .mobile-menu-glyph i:nth-child(3){
    transform:translateY(-6.5px) rotate(-45deg);
  }

  /* Full readable grouped menu in drawer. */
  .sidebar-group-toggle{
    font-size:11.5px!important;
    letter-spacing:.07em!important;
  }
  .sidebar.mobile-sidebar-open .user-copy{
    display:flex!important;
  }
  .sidebar.mobile-sidebar-open .logout-link span{
    display:inline!important;
  }
}

/* Phase 4.1.4 - Responsive Navigation Visual Redesign */

/* ---------- Shared group label sizing ---------- */
.sidebar-group-toggle{
  font-size:12px!important;
  letter-spacing:.06em!important;
}

/* ---------- Tablet / small laptop ---------- */
@media(min-width:761px) and (max-width:1180px){

  /* Collapsed rail */
  .sidebar{
    width:76px!important;
    overflow:visible!important;
  }

  .sidebar .brand{
    height:72px!important;
    min-height:72px!important;
    padding:12px 10px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    position:relative!important;
  }

  /* Show only the round S icon while collapsed */
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .brand img{
    width:42px!important;
    max-width:42px!important;
    height:42px!important;
    flex:0 0 42px!important;
    object-fit:cover!important;
    object-position:left center!important;
  }

  /* Hide the expand control in the collapsed rail.
     Hovering anywhere over the rail already expands it. */
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .sidebar-expand-btn{
    display:none!important;
  }

  /* Full expanded overlay */
  .sidebar.sidebar-hover-open,
  .sidebar.sidebar-pinned{
    width:238px!important;
    box-shadow:16px 0 36px rgba(25,18,48,.24)!important;
  }

  .sidebar.sidebar-hover-open .brand,
  .sidebar.sidebar-pinned .brand{
    justify-content:space-between!important;
    gap:10px!important;
    padding:12px 12px 12px 16px!important;
    height:72px!important;
    min-height:72px!important;
  }

  .sidebar.sidebar-hover-open .brand img,
  .sidebar.sidebar-pinned .brand img{
    width:168px!important;
    max-width:168px!important;
    height:42px!important;
    flex:0 1 168px!important;
    object-fit:contain!important;
    object-position:left center!important;
  }

  /* Clean collapse/pin control on same row as logo */
  .sidebar.sidebar-hover-open .sidebar-expand-btn,
  .sidebar.sidebar-pinned .sidebar-expand-btn{
    display:flex!important;
    width:32px!important;
    height:32px!important;
    flex:0 0 32px!important;
    margin:0!important;
    padding:0!important;
    align-items:center!important;
    justify-content:center!important;
    border:1px solid rgba(255,255,255,.13)!important;
    border-radius:9px!important;
    background:rgba(255,255,255,.075)!important;
    color:#fff!important;
    box-shadow:none!important;
  }

  .sidebar-expand-glyph{
    width:8px!important;
    height:8px!important;
    display:block!important;
    border-left:2px solid currentColor!important;
    border-bottom:2px solid currentColor!important;
    transform:rotate(45deg)!important;
    margin-left:3px!important;
  }

  .sidebar.sidebar-pinned .sidebar-expand-glyph{
    transform:rotate(45deg)!important;
  }

  /* More breathing room for group headings and links */
  .sidebar.sidebar-hover-open .sidebar-group-toggle,
  .sidebar.sidebar-pinned .sidebar-group-toggle{
    min-height:38px!important;
    padding:8px 10px!important;
  }

  .sidebar.sidebar-hover-open .nav-link,
  .sidebar.sidebar-pinned .nav-link{
    min-height:42px!important;
    padding:10px 13px!important;
    border-radius:8px!important;
    margin-bottom:2px!important;
  }

  /* Desktop-style footer when expanded */
  .sidebar.sidebar-hover-open .sidebar-footer,
  .sidebar.sidebar-pinned .sidebar-footer{
    padding:14px 10px 12px!important;
  }

  .sidebar.sidebar-hover-open .user-card,
  .sidebar.sidebar-pinned .user-card{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    padding:8px 6px 12px!important;
  }

  .sidebar.sidebar-hover-open .user-copy,
  .sidebar.sidebar-pinned .user-copy{
    display:flex!important;
    flex-direction:column!important;
    min-width:0!important;
  }

  .sidebar.sidebar-hover-open .logout-link,
  .sidebar.sidebar-pinned .logout-link{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    padding:10px 8px!important;
  }

  /* Collapsed footer stays minimal and centred */
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .sidebar-footer{
    padding:12px 8px!important;
  }
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .user-card{
    justify-content:center!important;
    padding:8px 0 12px!important;
  }
  .sidebar:not(.sidebar-hover-open):not(.sidebar-pinned) .logout-link{
    justify-content:center!important;
    padding:9px 0!important;
  }
}

/* ---------- Mobile ---------- */
@media(max-width:760px){

  body{padding-top:68px!important}

  .mobile-app-header{
    height:68px!important;
    padding:0 14px!important;
    background:#fff!important;
    border-bottom:1px solid #e8e4ef!important;
    box-shadow:0 3px 14px rgba(29,21,53,.06)!important;
  }

  .mobile-brand-logo{
    width:auto!important;
    max-width:205px!important;
    height:42px!important;
    object-fit:contain!important;
    object-position:left center!important;
  }

  .mobile-menu-btn{
    width:44px!important;
    height:44px!important;
    flex:0 0 44px!important;
    border:1px solid #e4deec!important;
    border-radius:12px!important;
    background:#fff!important;
    color:#2d2641!important;
    box-shadow:none!important;
  }

  /* Drawer */
  .sidebar{
    top:68px!important;
    width:min(86vw,320px)!important;
    background:#2d274d!important;
    border-right:0!important;
  }

  .sidebar-scroll-menu{
    padding:16px 12px 12px!important;
  }

  .sidebar-group-toggle{
    font-size:12px!important;
    min-height:40px!important;
    padding:9px 9px!important;
  }

  .sidebar .nav-link{
    min-height:44px!important;
    padding:11px 13px!important;
    border-radius:9px!important;
  }

  .sidebar-footer{
    padding:14px 12px max(14px,env(safe-area-inset-bottom))!important;
  }

  .sidebar.mobile-sidebar-open .user-card{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    padding:8px 6px 12px!important;
  }

  .sidebar.mobile-sidebar-open .logout-link{
    justify-content:flex-start!important;
    gap:10px!important;
    padding:10px 8px!important;
  }

  .mobile-nav-backdrop{
    inset:68px 0 0 0!important;
  }
}

/* Phase 4.1.5 - Compact Rail + Flyout Sidebar
   Replaces tablet hover-expansion with a stable icon rail and floating flyouts. */

/* Disable previous tablet expansion control entirely. */
.sidebar-expand-btn{display:none!important}

/* Flyout / tooltip hidden outside compact mode. */
.sidebar-flyout,
.sidebar-rail-tooltip{display:none}

/* ---------------- Tablet / small laptop ---------------- */
@media(min-width:761px) and (max-width:1180px){

  .sidebar{
    width:76px!important;
    overflow:hidden!important;
    box-shadow:none!important;
    transition:none!important;
  }

  .sidebar .brand{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:72px!important;
    height:72px!important;
    padding:12px 8px!important;
  }

  /* Only the round S mark in the rail. */
  .sidebar .brand img{
    width:42px!important;
    max-width:42px!important;
    height:42px!important;
    object-fit:cover!important;
    object-position:left center!important;
  }

  .sidebar-scroll-menu{
    padding:8px 8px 12px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }

  /* One compact button per section. */
  .sidebar-menu-group{
    margin:0 0 7px!important;
  }
  .sidebar-group-toggle{
    width:100%!important;
    height:44px!important;
    min-height:44px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:0!important;
    border-radius:10px!important;
    color:#c5bed7!important;
    background:transparent!important;
    font-size:0!important;
  }
  .sidebar-group-toggle span{display:none!important}
  .sidebar-group-toggle svg{
    display:block!important;
    width:17px!important;
    height:17px!important;
    transform:none!important;
  }

  /* Give section groups distinct, familiar rail glyphs via text symbols. */
  .sidebar-menu-group[data-group="accounts"] .sidebar-group-toggle::before{content:"▦"}
  .sidebar-menu-group[data-group="payroll"] .sidebar-group-toggle::before{content:"▣"}
  .sidebar-menu-group[data-group="reports"] .sidebar-group-toggle::before{content:"▤"}
  .sidebar-menu-group[data-group="tax"] .sidebar-group-toggle::before{content:"⌁"}
.sidebar-menu-group[data-group="admin"] .sidebar-group-toggle::before{content:"⚙"}
.sidebar-menu-group[data-group="support"] .sidebar-group-toggle::before{content:"?"}
  .sidebar-group-toggle::before{
    font-size:19px!important;
    line-height:1!important;
    color:currentColor!important;
  }
  .sidebar-group-toggle svg{display:none!important}

  .sidebar-menu-group .sidebar-group-links{display:none!important}

  /* Direct Dashboard item in the rail. */
  .compact-direct-dashboard{
    display:flex!important;
    width:100%!important;
    height:44px!important;
    min-height:44px!important;
    align-items:center!important;
    justify-content:center!important;
    padding:0!important;
    margin:0 0 7px!important;
    gap:0!important;
    border-radius:10px!important;
  }
  .compact-direct-dashboard span{display:none!important}
  .compact-direct-dashboard svg{margin:0!important}
  .compact-direct-dashboard.active{
    background:#7638e9!important;
    color:#fff!important;
  }

  /* If Dashboard is current, Accounts button is not highlighted just because group is active. */
  .sidebar-menu-group[data-group="accounts"]>.sidebar-group-toggle{
    background:transparent!important;
  }

  .sidebar-group-toggle:hover,
  .compact-direct-dashboard:hover{
    background:rgba(255,255,255,.075)!important;
    color:#fff!important;
  }

  /* Footer: clean avatar + logout icons only. */
  .sidebar-footer{
    padding:12px 8px 14px!important;
  }
  .sidebar-footer .user-card{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:7px 0 10px!important;
  }
  .sidebar-footer .user-copy{display:none!important}
  .sidebar-footer .logout-link{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:9px 0!important;
  }
  .sidebar-footer .logout-link span{display:none!important}

  /* Never expand the rail. */
  .sidebar.sidebar-hover-open,
  .sidebar.sidebar-pinned{
    width:76px!important;
    box-shadow:none!important;
  }

  /* Floating submenu */
  .sidebar-flyout{
    position:fixed;
    display:none;
    z-index:220;
    width:218px;
    padding:10px;
    background:#2c264a;
    color:#fff;
    border:1px solid rgba(255,255,255,.08);
    border-radius:12px;
    box-shadow:0 14px 34px rgba(18,12,35,.28);
  }
  .sidebar-flyout.open{display:block}
  .sidebar-flyout-title{
    padding:7px 9px 9px;
    color:#aea6c4;
    font-size:11px;
    line-height:1;
    text-transform:uppercase;
    letter-spacing:.08em;
    font-weight:800;
  }
  .sidebar-flyout-links{
    display:grid;
    gap:3px;
  }
  .sidebar-flyout .nav-link{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:10px!important;
    min-height:39px!important;
    padding:9px 10px!important;
    border-radius:8px!important;
    color:#e7e2f0!important;
    text-decoration:none!important;
  }
  .sidebar-flyout .nav-link span{display:inline!important}
  .sidebar-flyout .nav-link.active{
    background:#7638e9!important;
    color:#fff!important;
  }
  .sidebar-flyout .nav-link:hover{
    background:rgba(255,255,255,.08)!important;
    color:#fff!important;
  }

  .sidebar-rail-tooltip{
    position:fixed;
    display:none;
    z-index:225;
    transform:translateY(-50%);
    padding:7px 10px;
    background:#1f1a35;
    color:#fff;
    border-radius:7px;
    box-shadow:0 8px 20px rgba(17,12,31,.2);
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
  }
  .sidebar-rail-tooltip.open{display:block}

  /* Main content keeps compact rail offset; flyouts overlay and never push content. */
  .main-content,.content-wrap,main{
    margin-left:76px!important;
  }
}

/* ---------------- Mobile ---------------- */
@media(max-width:760px){
  body{padding-top:68px!important}

  .mobile-app-header{
    display:flex!important;
    position:fixed!important;
    top:0!important;left:0!important;right:0!important;
    height:68px!important;
    z-index:250!important;
    align-items:center!important;
    justify-content:space-between!important;
    padding:0 14px!important;
    background:#fff!important;
    border-bottom:1px solid #e7e3ed!important;
    box-shadow:0 3px 14px rgba(27,20,48,.06)!important;
  }
  .mobile-brand{display:flex!important;align-items:center!important;min-width:0!important}
  .mobile-brand-logo{
    display:block!important;
    width:auto!important;
    height:42px!important;
    max-width:205px!important;
    object-fit:contain!important;
    object-position:left center!important;
  }
  .mobile-menu-btn{
    width:44px!important;height:44px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    border:1px solid #e3dfea!important;
    border-radius:11px!important;
    background:#fff!important;
    color:#302943!important;
  }
  .mobile-menu-glyph{
    width:20px!important;height:15px!important;
    display:flex!important;flex-direction:column!important;justify-content:space-between!important;
  }
  .mobile-menu-glyph i{
    display:block!important;height:2px!important;width:100%!important;
    background:currentColor!important;border-radius:999px!important;
    transition:transform .18s ease,opacity .18s ease!important;
  }
  body.mobile-nav-open .mobile-menu-glyph i:nth-child(1){transform:translateY(6.5px) rotate(45deg)!important}
  body.mobile-nav-open .mobile-menu-glyph i:nth-child(2){opacity:0!important}
  body.mobile-nav-open .mobile-menu-glyph i:nth-child(3){transform:translateY(-6.5px) rotate(-45deg)!important}

  .sidebar{
    display:flex!important;
    position:fixed!important;
    top:68px!important;left:0!important;bottom:0!important;
    width:min(88vw,330px)!important;
    height:auto!important;
    transform:translateX(-104%)!important;
    transition:transform .22s ease!important;
    z-index:245!important;
    overflow:hidden!important;
    background:#2c264a!important;
    box-shadow:16px 0 36px rgba(18,12,35,.25)!important;
  }
  .sidebar.mobile-sidebar-open{transform:translateX(0)!important}
  .sidebar .brand{display:none!important}
  .sidebar-scroll-menu{
    flex:1 1 auto!important;min-height:0!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    padding:15px 12px 12px!important;
  }
  .sidebar-menu-group{margin-bottom:8px!important}
  .sidebar-group-toggle{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    width:100%!important;
    min-height:40px!important;
    padding:9px 10px!important;
    font-size:12px!important;
    letter-spacing:.07em!important;
  }
  .sidebar-group-toggle span{display:inline!important}
  .sidebar-group-toggle svg{display:block!important}
  .sidebar-menu-group.open .sidebar-group-links{display:grid!important}
  .sidebar-menu-group:not(.open) .sidebar-group-links{display:none!important}
  .sidebar .nav-link{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:11px!important;
    min-height:43px!important;
    padding:10px 12px!important;
  }
  .sidebar .nav-link span{display:inline!important}
  .compact-direct-dashboard{display:none!important}

  .sidebar-footer{
    flex:0 0 auto!important;
    padding:14px 12px max(14px,env(safe-area-inset-bottom))!important;
  }
  .sidebar-footer .user-card{
    display:flex!important;
    justify-content:flex-start!important;
    align-items:center!important;
    gap:10px!important;
    padding:8px 6px 12px!important;
  }
  .sidebar-footer .user-copy{display:flex!important}
  .sidebar-footer .logout-link{
    display:flex!important;
    justify-content:flex-start!important;
    gap:10px!important;
    padding:10px 8px!important;
  }
  .sidebar-footer .logout-link span{display:inline!important}

  .mobile-nav-backdrop{
    display:none;
    position:fixed!important;
    inset:68px 0 0 0!important;
    z-index:240!important;
    background:rgba(14,10,27,.48)!important;
  }
  body.mobile-nav-open .mobile-nav-backdrop{display:block!important}
  body.mobile-nav-open{overflow:hidden!important}

  .sidebar-flyout,.sidebar-rail-tooltip{display:none!important}
  .main-content,.content-wrap,main{margin-left:0!important}
}

/* Phase 4.1.6 - Navigation hotfix */

/* The compact Dashboard clone must NEVER be visible in normal desktop mode.
   It is only enabled inside the compact 761-1180px rail breakpoint below. */
.compact-direct-dashboard{display:none!important}

@media(min-width:761px) and (max-width:1180px){
  .compact-direct-dashboard{
    display:flex!important;
  }
}

/* Make sure desktop grouped menu stays exactly one copy of each item. */
@media(min-width:1181px){
  .sidebar .compact-direct-dashboard{display:none!important}
}

/* Phase 4.1.7 - Mobile navigation hotfix */

/* The compact Dashboard clone belongs ONLY to tablet rail mode.
   Use a more specific selector so the generic mobile .nav-link rule cannot
   force the clone visible with display:flex!important. */
.sidebar .compact-direct-dashboard{
  display:none!important;
}

@media(min-width:761px) and (max-width:1180px){
  .sidebar .compact-direct-dashboard{
    display:flex!important;
  }
}

/* Mobile header uses the same dark brand surface as the sidebar.
   softsprint-logo.png contains light wordmark text, so a white header made
   most of the logo visually disappear. */
@media(max-width:760px){
  .mobile-app-header{
    background:#2c264a!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 5px 18px rgba(19,13,36,.18)!important;
  }

  .mobile-brand-logo{
    height:40px!important;
    max-width:205px!important;
    object-fit:contain!important;
    object-position:left center!important;
  }

  .mobile-menu-btn{
    background:rgba(255,255,255,.07)!important;
    border:1px solid rgba(255,255,255,.16)!important;
    color:#fff!important;
    box-shadow:none!important;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active{
    background:rgba(255,255,255,.12)!important;
  }

  .mobile-menu-glyph i{
    background:#fff!important;
  }

  /* Keep the drawer visually continuous with the top header. */
  .sidebar{
    background:#2c264a!important;
  }

  /* Extra safeguard against duplicate compact-only links in mobile drawer. */
  .sidebar.mobile-sidebar-open .compact-direct-dashboard{
    display:none!important;
  }
}

/* Phase 4.1.8 - Compact responsive content alignment hotfix
   The app shell already reserves the 76px sidebar column at <=1050px.
   Phase 4.1.5 also added margin-left:76px to <main>, creating a second
   76px offset and pushing/clipping the page on the right. */
@media(min-width:761px) and (max-width:1180px){
  .app-main,
  main,
  .main-content,
  .content-wrap{
    margin-left:0!important;
    min-width:0!important;
    max-width:100%!important;
  }

  .app-shell{
    width:100%!important;
    max-width:100vw!important;
    overflow-x:hidden!important;
  }

  .content-area{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding-left:22px!important;
    padding-right:22px!important;
  }

  .topbar{
    width:100%!important;
    min-width:0!important;
  }

  /* Prevent dashboard/report grids from forcing the viewport wider. */
  .dashboard-kpi-grid,
  .report-kpi-grid,
  .transaction-kpi-grid,
  .finance-grid,
  .grid{
    min-width:0!important;
  }

  .card,
  .finance-kpi,
  .kpi{
    min-width:0!important;
  }
}

/* Phase 4.1.9 - Compact Rail uses module icons only */

/* The old compact Dashboard clone is retired entirely. */
.compact-direct-dashboard{
  display:none!important;
}

/* Small laptop / tablet: rail represents only top-level modules.
   The active page highlights its parent group icon. */
@media(min-width:761px) and (max-width:1180px){

  .sidebar-menu-group.compact-active-group>.sidebar-group-toggle{
    background:#7638e9!important;
    color:#fff!important;
    box-shadow:0 7px 18px rgba(118,56,233,.22)!important;
  }

  .sidebar-menu-group.compact-active-group>.sidebar-group-toggle:hover{
    background:#7638e9!important;
    color:#fff!important;
  }

  /* Keep rail spacing uniform now that no direct Dashboard icon exists. */
  .sidebar-menu-group{
    margin-bottom:9px!important;
  }

  .sidebar-group-toggle{
    margin:0!important;
  }

  /* Flyout shows the current child page as active.
     Parent module remains highlighted in the rail. */
  .sidebar-flyout .nav-link.active{
    background:#7638e9!important;
    color:#fff!important;
  }
}

/* Mobile and desktop should never render the retired clone. */
@media(max-width:760px), (min-width:1181px){
  .sidebar .compact-direct-dashboard{
    display:none!important;
  }
}

/* Phase 4.1.10 - Remove compact-sidebar blank gap
   The sidebar itself is 76px in compact mode, but the app grid was still
   reserving the desktop 226px sidebar column. That created the visible
   ~150px empty strip between the rail and the page content. */
@media(min-width:761px) and (max-width:1180px){
  .app-shell{
    grid-template-columns:76px minmax(0,1fr)!important;
  }

  .sidebar{
    width:76px!important;
    max-width:76px!important;
  }

  .app-main{
    width:100%!important;
    min-width:0!important;
    margin-left:0!important;
  }

  .topbar,
  .content-area,
  .app-footer{
    margin-left:0!important;
  }
}

/* Phase 4.2 - Receipts & Payments */
.cashflow-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.cashflow-info-note{margin:0 0 18px;padding:13px 15px;border:1px solid #e4ddf0;background:#fbf9ff;border-radius:12px;color:#756e81;font-size:12px;line-height:1.55}
.cashflow-info-note strong{color:#4e4760}
.cashflow-ledger-card{padding:22px!important}
.cashflow-ledger-card>.table-wrap{margin:14px -22px -22px}
.cash-direction{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.cash-direction.dir-in{background:#eafaf2;color:#118156}
.cash-direction.dir-out{background:#fff2ed;color:#c45128}
@media(max-width:900px){.cashflow-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.2.1 - Fix compact responsive sidebar to viewport
   Keep the 76px rail fixed while the page content scrolls. */
@media(min-width:761px) and (max-width:1180px){
  .sidebar{
    position:fixed!important;
    top:0!important;
    left:0!important;
    bottom:0!important;
    height:100vh!important;
    min-height:100vh!important;
    z-index:200!important;
  }

  /* The app grid no longer needs to reserve a physical sidebar column because
     the sidebar is fixed. Offset the main app once by the rail width. */
  .app-shell{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
  }

  .app-main{
    margin-left:76px!important;
    width:calc(100% - 76px)!important;
    max-width:calc(100% - 76px)!important;
    min-width:0!important;
  }

  .topbar{
    position:relative!important;
    left:0!important;
    width:100%!important;
  }

  .sidebar-scroll-menu{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }

  .sidebar-footer{
    flex:0 0 auto!important;
    margin-top:auto!important;
  }
}


/* Phase 4.4 - Management Profit & Loss */
.pnl-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.pnl-info-note{margin:18px 0 0;padding:14px 16px;border:1px solid #e5def0;background:#fbf9ff;border-radius:12px;color:#756d83;font-size:12px;line-height:1.6}
.pnl-info-note strong{color:#4c455d}
@media(max-width:1050px){.pnl-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.pnl-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.5 - GST & ITC Report */
.gst-itc-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.gst-register-card{padding:22px!important;margin-bottom:18px}
.gst-register-card>.table-wrap{margin:14px -22px 0}
.gst-itc-badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.gst-itc-badge.eligible{background:#e9f9f1;color:#187653}
.gst-itc-badge.ineligible{background:#fff1eb;color:#bd532b}
.gst-itc-info-note{margin:18px 0 0;padding:14px 16px;border:1px solid #e5def0;background:#fbf9ff;border-radius:12px;color:#756d83;font-size:12px;line-height:1.6}
.gst-itc-info-note strong{color:#4c455d}
@media(max-width:1050px){.gst-itc-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.gst-itc-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.6 - Payables */
.payables-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.payables-table-card{padding:22px!important;margin-bottom:18px}
.payables-table-card>.table-wrap{margin:14px -22px 0}
.due-status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap;background:#f1eef5;color:#635b70}
.due-status.overdue{background:#ffeceb;color:#b73f38}
.due-status.due-today{background:#fff0e5;color:#b75a18}
.due-status.due-in-7-days{background:#fff7df;color:#9a6a00}
.due-status.due-in-30-days{background:#eef4ff;color:#4265a8}
@media(max-width:1050px){.payables-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.payables-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.7 - Monthly Comparison */
.comparison-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.comparison-table-card{padding:22px!important;margin-bottom:18px}
.comparison-table-card>.table-wrap{margin:14px -22px 0}
.comparison-info-note{margin-top:18px;padding:14px 16px;border:1px solid #e5def0;background:#fbf9ff;border-radius:12px;color:#756d83;font-size:12px;line-height:1.6}
.comparison-info-note strong{color:#4c455d}
@media(max-width:1050px){.comparison-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.comparison-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.7.2 - Progressive Monthly Comparison loader */
.monthly-loader-card{margin:0 0 16px;padding:14px 16px;border:1px solid #dfd6f5;background:#fbf9ff;border-radius:12px}
.monthly-loader-card strong{display:block;color:#4c3b75;margin-bottom:3px}
.monthly-loader-card p{margin:0;color:#777084;font-size:12px}
.monthly-loader-progress{height:7px;background:#ece7f6;border-radius:999px;overflow:hidden;margin-top:10px}
.monthly-loader-progress i{display:block;height:100%;background:linear-gradient(90deg,#8f62f1,#6f3fe0);border-radius:999px;transition:width .2s ease}

/* Phase 4.7.3 - Reliable historical comparison loading */
.monthly-history-load-card{padding:20px!important;margin-bottom:16px}
.monthly-history-load-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0 6px}
.monthly-history-load-row strong{display:block;margin-bottom:4px}
.monthly-history-load-row small{display:block;color:#81798d}
.monthly-history-load-row form{margin:0;flex:0 0 auto}
.monthly-missing-list{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.monthly-missing-list span{display:inline-flex;padding:5px 8px;border-radius:999px;background:#f3effc;color:#6847b7;font-size:11px;font-weight:800}
.inline-form{display:inline-flex;margin:0}
.btn-disabled{opacity:.55;cursor:not-allowed;pointer-events:none}
@media(max-width:700px){.monthly-history-load-row{align-items:flex-start;flex-direction:column}.monthly-history-load-row form{width:100%}.monthly-history-load-row form .btn{width:100%}}

/* Phase 4.8 - Local Monthly Reporting Sync */
.comparison-mom-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:-2px 0 16px}
.comparison-mom-strip>div{padding:11px 13px;border:1px solid #e7e1ef;background:#fff;border-radius:10px}
.comparison-mom-strip span{display:block;color:#8a8196;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px}
.comparison-mom-strip strong{font-size:16px;color:#241b32}
.reporting-sync-modal{width:min(720px,calc(100vw - 30px))}
.sync-status-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px}
.sync-status-grid>div{padding:14px;border:1px solid #e8e2f0;border-radius:10px;background:#fcfbfe}
.sync-status-grid span{display:block;font-size:10px;font-weight:800;color:#8d8498;text-transform:uppercase;letter-spacing:.06em}
.sync-status-grid strong{display:block;margin-top:5px;font-size:15px;color:#251d31}
.sync-status-grid small{display:block;margin-top:3px;color:#82798f}
.sync-setup-panel{padding:16px;border:1px solid #e5def0;border-radius:10px;background:#fbf9ff}
.sync-setup-panel h4,.sync-action-panel h4{margin:0 0 4px}
.sync-setup-panel p,.sync-action-panel p{margin:0 0 12px;color:#81788d;font-size:12px;line-height:1.55}
.sync-setup-panel label{display:block;max-width:260px;margin-bottom:12px}
.sync-action-panel{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 0;border-top:1px solid #eee8f3}
.sync-action-panel:first-of-type{border-top:0}
.sync-complete-badge{display:inline-flex;padding:6px 10px;border-radius:999px;background:#eaf9f1;color:#1e7a56;font-size:11px;font-weight:800}
.reporting-sync-progress{margin-top:14px;padding:14px;border:1px solid #e5def0;border-radius:10px;background:#fbf9ff}
.sync-progress-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.reporting-sync-progress p{margin:8px 0 0;color:#786f84;font-size:12px}
.monthly-sync-warning{margin-bottom:16px}
@media(max-width:900px){.comparison-mom-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.comparison-mom-strip,.sync-status-grid{grid-template-columns:1fr}.sync-action-panel{align-items:flex-start;flex-direction:column}.sync-action-panel .btn{width:100%}}

/* Phase 4.9 - Reporting Data Sync Centre */
.report-sync-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.reporting-sync-controls-card,.reporting-sync-table-card{padding:22px!important;margin-bottom:18px}
.reporting-sync-table-card>.table-wrap{margin:14px -22px 0}
.sync-centre-setup{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px;border:1px solid #e6dff0;background:#fbf9ff;border-radius:10px}
.sync-centre-setup p,.sync-centre-action p{margin:4px 0 0;color:#81778d;font-size:12px}
.sync-centre-setup-form{display:flex;align-items:center;gap:8px}
.sync-centre-actions{display:grid;gap:0}
.sync-centre-action{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 0;border-top:1px solid #eee8f3}
.sync-centre-action:first-child{border-top:0}
.sync-table-status{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
.sync-table-status.synced{background:#eaf9f1;color:#1d7855}
.sync-table-status.current{background:#edf7ff;color:#30669a}
.sync-table-status.current-stale{background:#fff4df;color:#9a6500}
.sync-table-status.missing{background:#ffeceb;color:#b6413b}
.sync-table-status.finalise{background:#f3edff;color:#6c45b5}
@media(max-width:1050px){.report-sync-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.report-sync-kpi-grid{grid-template-columns:1fr}.sync-centre-setup,.sync-centre-action{align-items:flex-start;flex-direction:column}.sync-centre-setup-form{width:100%;flex-direction:column;align-items:stretch}.sync-centre-action .btn{width:100%}}

/* Phase 4.10 - Fast Local Dashboard */
.dashboard-period-label{margin-left:auto;padding:0 4px;color:#81788d;font-size:12px;white-space:nowrap}
.dashboard-local-status{margin-bottom:18px}
@media(max-width:850px){.dashboard-period-label{width:100%;margin:8px 0 0}}

/* Phase 4.11 - FY Performance */
.fy-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.fy-last-year-card,.fy-quarter-card,.fy-monthly-card{padding:22px!important;margin-bottom:18px}
.fy-full-year-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}
.fy-full-year-grid>div{padding:13px 14px;border:1px solid #e8e2ef;border-radius:10px;background:#fcfbfe}
.fy-full-year-grid span{display:block;color:#8a8196;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px}
.fy-full-year-grid strong{font-size:16px;color:#241b32}
.fy-quarter-card>.table-wrap,.fy-monthly-card>.table-wrap{margin:14px -22px 0}
@media(max-width:1050px){.fy-kpi-grid,.fy-full-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.fy-kpi-grid,.fy-full-year-grid{grid-template-columns:1fr}}

/* Phase 4.11.6 - Reporting Reconciliation */
.recon-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.recon-table-card{padding:22px!important;margin-bottom:18px}
.recon-table-card>.table-wrap{margin:14px -22px 0}
.recon-treatment{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:800}
.recon-treatment.included{background:#eaf9f1;color:#1e7855}
.recon-treatment.refund{background:#fff1ec;color:#b45031}
.recon-treatment.excluded{background:#ffeceb;color:#b53c36}
@media(max-width:950px){.recon-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.recon-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.11.7 - Reconciliation clarity */
.recon-explanation-card{padding:22px!important;margin-bottom:18px}
.recon-result-badge{display:inline-flex;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:800}
.recon-result-badge.good{background:#eaf9f1;color:#1d7855}
.recon-result-badge.warning{background:#fff4df;color:#9a6500}
.recon-equation{display:grid;grid-template-columns:minmax(0,1fr) 34px minmax(0,1fr) 34px minmax(0,1fr);align-items:stretch;gap:8px;margin-top:16px}
.recon-equation>div:not(.recon-operator){padding:14px;border:1px solid #e7e1ef;border-radius:10px;background:#fcfbfe}
.recon-equation .result{background:#f7f3ff!important;border-color:#dccff8!important}
.recon-equation span,.recon-local-check span{display:block;color:#8a8196;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;margin-bottom:5px}
.recon-equation strong{display:block;font-size:19px;color:#251d31}
.recon-equation small{display:block;margin-top:4px;color:#8a8196}
.recon-operator{display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:800;color:#7f758c}
.recon-local-check{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.recon-local-check>div{padding:12px 14px;border:1px solid #e7e1ef;border-radius:10px;background:#fff}
.recon-local-check strong{font-size:16px;color:#251d31}
.recon-success-note{margin:12px 0 0;padding:11px 13px;border-radius:9px;background:#edf9f3;color:#2b6f54;font-size:12px;line-height:1.55}
@media(max-width:800px){
  .recon-equation{grid-template-columns:1fr}
  .recon-operator{min-height:24px}
  .recon-local-check{grid-template-columns:1fr}
}

/* Phase 4.12 - Expense Analysis */
.expense-analysis-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.expense-analysis-table-card{padding:22px!important;margin-bottom:18px}
.expense-analysis-table-card>.table-wrap{margin:14px -22px 0}
@media(max-width:950px){.expense-analysis-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.expense-analysis-kpi-grid{grid-template-columns:1fr}}

/* Phase 4.14 - Business Performance Summary */
.business-performance-heading{margin-bottom:16px}
.business-performance-context{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin-bottom:16px;border:1px solid #e7e2eb;border-radius:14px;overflow:hidden;background:#e7e2eb;box-shadow:0 8px 26px rgba(35,28,61,.05)}
.business-performance-context>div{padding:14px 16px;background:linear-gradient(145deg,#fff,#faf8f4)}
.business-performance-context span{display:block;color:#8a8191;font-size:10px;font-weight:850;letter-spacing:.07em;text-transform:uppercase}
.business-performance-context strong{display:block;margin-top:5px;color:#282032;font-size:15px}
.business-performance-context small{display:block;margin-top:3px;color:#8a8191;font-size:11px}
.business-performance-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px;margin-bottom:18px}
.business-performance-kpis .finance-kpi{display:block;min-height:110px;text-decoration:none;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.business-performance-kpis .finance-kpi:hover{transform:translateY(-2px);border-color:#d8cfe1;box-shadow:0 13px 30px rgba(35,28,61,.09)}
.business-performance-kpis .finance-kpi.warning:before{background:linear-gradient(180deg,#d58b16,#f2bd4b)}
.business-comparison-card,.business-performance-table{padding:22px!important;margin-bottom:18px}
.business-comparison-card>.table-wrap,.business-performance-table>.table-wrap{margin:14px -22px 0}
.business-comparison-card tbody tr:last-child td,.business-performance-table tbody tr:last-child td{border-bottom:0}
.performance-change{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#eef8f2;color:#277456;font-size:11px;font-weight:800;white-space:nowrap}
.performance-change.down{background:#fff0ed;color:#b84a39}
.business-drilldowns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}
.business-drilldowns a{position:relative;display:block;padding:16px 42px 16px 16px;border:1px solid #e7e2eb;border-radius:12px;background:#fff;color:#292132;text-decoration:none;box-shadow:0 5px 18px rgba(37,28,62,.035);transition:border-color .18s ease,transform .18s ease}
.business-drilldowns a:after{content:'›';position:absolute;right:17px;top:50%;transform:translateY(-50%);color:#b0702a;font-size:25px;line-height:1}
.business-drilldowns a:hover{transform:translateY(-1px);border-color:#d5c7b5}
.business-drilldowns strong{display:block;font-size:13px}
.business-drilldowns span{display:block;margin-top:4px;color:#8a8191;font-size:11px;line-height:1.4}
@media(max-width:1250px){.business-performance-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.business-performance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.business-drilldowns{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.business-performance-context{grid-template-columns:1fr}.business-drilldowns{grid-template-columns:1fr}}
@media(max-width:520px){.business-performance-kpis{grid-template-columns:1fr}.business-performance-kpis .finance-kpi{min-height:0}}

/* Phase 5.0.2.1 - Sales Ledger definitions and filter alignment */
.app-authenticated .sales-filter-bar{grid-template-columns:minmax(118px,.78fr) minmax(118px,.78fr) minmax(130px,.9fr) minmax(155px,1.05fr) minmax(170px,1.25fr) auto;gap:10px}
.app-authenticated .sales-filter-bar .sales-filter-submit{min-width:106px;white-space:nowrap;line-height:1.15}
@media(max-width:1100px){.app-authenticated .sales-filter-bar{grid-template-columns:repeat(3,minmax(0,1fr))}.app-authenticated .sales-filter-bar>*{grid-column:auto}}
@media(max-width:760px){.app-authenticated .sales-filter-bar{grid-template-columns:1fr 1fr}.app-authenticated .sales-filter-bar .sales-filter-submit{grid-column:1/-1;width:100%}}
@media(max-width:520px){.app-authenticated .sales-filter-bar{grid-template-columns:1fr}.app-authenticated .sales-filter-bar>*{grid-column:1!important}}

/* Phase 4.17 - Final UI/UX and production-readiness polish */
.flash.warning,.flash.warn{background:var(--warning-soft);border-color:#ffd9af;color:#9b5918}
.flash.good,.flash.ok{background:var(--success-soft);border-color:#bcebd5;color:#11764f}
.flash a{color:inherit;font-weight:800;text-decoration:underline;text-underline-offset:2px}

.skip-link{position:fixed;top:10px;left:12px;z-index:1000;padding:10px 14px;border-radius:8px;background:#fff;color:#31294d;font-weight:800;box-shadow:0 8px 24px rgba(35,29,59,.22);transform:translateY(-160%);transition:transform .16s ease}
.skip-link:focus{transform:translateY(0)}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid rgba(111,54,217,.35);outline-offset:2px}
input:user-invalid,select:user-invalid,textarea:user-invalid{border-color:#e45b67!important;box-shadow:0 0 0 3px rgba(228,91,103,.10)!important}

.upload-panel{gap:8px}
.upload-panel input[type=file]{order:3;width:100%;padding:8px;border:1px solid #ded8ef;border-radius:10px;background:#fff;color:#625c70}
.upload-panel input[type=file]::file-selector-button{margin-right:12px;padding:9px 13px;border:0;border-radius:7px;background:#f0e9ff;color:#6038ae;font:inherit;font-weight:800;cursor:pointer}
.upload-panel input[type=file]::file-selector-button:hover{background:#e7dcff}
.upload-panel .upload-privacy-note{order:4;color:#8a8496;font-size:11px;line-height:1.5}

.protected-record-card{display:flex;align-items:center;gap:16px;margin-top:16px;padding:19px 20px!important;border-color:#dcd3f0;background:#fbf9ff}
.protected-record-card h3{margin:0 0 5px;color:#4d386d}
.protected-record-card p{margin:0;color:#756a80;font-size:12.5px;line-height:1.55}
.protected-record-icon{display:grid;place-items:center;flex:0 0 58px;min-height:34px;padding:0 8px;border-radius:8px;background:#eee8f8;color:#674a8c;font-size:9px;font-weight:900;letter-spacing:.08em}
.protected-action{display:inline-flex;align-items:center;min-height:31px;padding:6px 9px;border:1px solid #ded7eb;border-radius:7px;background:#f8f6fb;color:#766d81;font-size:10px;font-weight:800;white-space:nowrap}

@media(max-width:620px){
  .upload-panel{padding:17px}
  .upload-panel input[type=file]::file-selector-button{display:block;margin:0 0 8px;width:100%}
  .protected-record-card{align-items:flex-start}
  .protected-record-icon{flex-basis:52px}
  .employee-row-actions .protected-action{width:100%;justify-content:center}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* Phase 4.18 - Operational controls */
.operational-kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.operational-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px}
.operational-card,.operational-table{margin-bottom:18px}
.operational-form,.operational-unlock-form,.payment-reversal-form{display:grid;gap:12px}
.operational-form .btn{justify-self:start}
.operational-help{margin:14px 0 0;line-height:1.6}
.operational-unlock-form{min-width:260px;padding-top:12px}
.operational-table details>summary,.payment-reversal-details>summary{cursor:pointer;color:#6840b5;font-size:12px;font-weight:800}
.payment-reversal-form{min-width:270px;padding:12px 0 4px}
.payment-row-reversed{background:#fff8f5;color:#777081}
.payment-row-reversed td:nth-child(4) strong{text-decoration:line-through}
.type-reversal{background:#fff0eb;color:#bd4e2a}
@media(max-width:900px){.operational-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.operational-grid{grid-template-columns:1fr}}
@media(max-width:620px){.operational-kpi-grid{grid-template-columns:1fr}.operational-form .btn{width:100%}.operational-unlock-form,.payment-reversal-form{min-width:220px}}

/* Phase 4.18.1 - Preview-first test data cleanup */
.cleanup-entry-card{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:18px;padding:22px!important;border-color:#ead8bb;background:linear-gradient(135deg,#fffdf9 0%,#fff8ee 100%)}
.cleanup-entry-card h3{margin:5px 0 7px}.cleanup-entry-card p{max-width:760px;margin:0;line-height:1.6}
.cleanup-safety-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px}
.cleanup-safety-card{padding:20px!important;border-left:4px solid #8c5ddb}.cleanup-safety-card.ready{border-left-color:#22a06b}.cleanup-safety-card.blocked{border-left-color:#df4956}
.cleanup-safety-card>span{display:block;color:#8b8297;font-size:10px;font-weight:900;letter-spacing:.07em;text-transform:uppercase}.cleanup-safety-card>strong{display:block;margin-top:6px;font-size:21px}.cleanup-safety-card p{margin:7px 0 12px;color:#746b80;font-size:12px;line-height:1.55}
.cleanup-warning{margin-bottom:18px;border-color:#f0d6ae;background:#fffaf1}
.cleanup-filter{display:grid;grid-template-columns:180px 180px minmax(240px,1fr) auto auto;align-items:end;gap:12px;margin-bottom:18px;padding:18px!important}
.cleanup-selection-form{display:grid;gap:18px}.cleanup-section{padding:20px!important;margin:0}.cleanup-section>.table-wrap{margin:14px -20px -20px}
.cleanup-section table{min-width:720px}.cleanup-section td:first-child,.cleanup-section th:first-child{text-align:center;width:66px}
.cleanup-check{width:18px;height:18px;accent-color:#6e3bd4;cursor:pointer}
.cleanup-two-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.cleanup-two-column .cleanup-section table{min-width:520px}
.cleanup-preview-bar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px;border:1px solid #ded3f2;border-radius:13px;background:#f9f6ff}
.cleanup-preview-bar strong,.cleanup-preview-bar span{display:block}.cleanup-preview-bar span{margin-top:4px;color:#786f83;font-size:12px}
.cleanup-plan{margin-top:18px;padding:22px!important;border-width:2px}.cleanup-plan.ready{border-color:#bce9d3}.cleanup-plan.has-errors{border-color:#f3c1c5}
.cleanup-count-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0}
.cleanup-count-grid>div{padding:13px;border:1px solid #e7e0ef;border-radius:10px;background:#fcfbfe}.cleanup-count-grid span{display:block;color:#898092;font-size:10px;font-weight:800;text-transform:uppercase}.cleanup-count-grid strong{display:block;margin-top:4px;font-size:20px}
.cleanup-months{padding:12px 14px;border-radius:9px;background:#fff8e9;color:#805c1f}.cleanup-plan .flash ul{margin:9px 0 0;padding-left:20px}.cleanup-plan .flash li{margin:5px 0}
.cleanup-confirm{display:flex;align-items:end;gap:14px;margin-top:16px;padding:18px;border:1px solid #f1c1c5;border-radius:11px;background:#fff8f8}.cleanup-confirm label{flex:1}.cleanup-confirm code{color:#a72330;font-weight:900}
@media(max-width:1000px){.cleanup-filter{grid-template-columns:repeat(2,minmax(0,1fr))}.cleanup-filter label:nth-of-type(3){grid-column:1/-1}.cleanup-two-column{grid-template-columns:1fr}.cleanup-count-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.cleanup-entry-card,.cleanup-preview-bar,.cleanup-confirm{align-items:stretch;flex-direction:column}.cleanup-entry-card .btn,.cleanup-preview-bar .btn,.cleanup-confirm .btn{width:100%}.cleanup-safety-grid,.cleanup-filter,.cleanup-count-grid{grid-template-columns:1fr}.cleanup-filter label:nth-of-type(3){grid-column:auto}}

/* Phase 4.18.2 - CA access controls and login security */
.access-denied-card{max-width:680px;margin:48px auto;padding:34px!important;text-align:center;border-top:4px solid #7845dc}.access-denied-card h1{margin:12px 0 8px}.access-denied-card .btn{margin-top:14px}
.login-turnstile{display:flex;justify-content:center;min-height:65px;margin:4px 0 2px}.login-security-card{padding:24px!important}.login-security-card .settings-card-head{align-items:flex-start}
.turnstile-settings-form{display:grid;gap:16px;margin-top:18px}.turnstile-settings-form small{display:block;margin-top:6px;color:#837a8e;font-size:11px;line-height:1.45}.turnstile-enable-row{padding:14px 16px;border:1px solid #ded5ed;border-radius:10px;background:#faf8fd}.turnstile-enable-row span{display:block}.turnstile-test-form{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-top:16px;padding:17px;border:1px dashed #d7c9ee;border-radius:11px;background:#fbf9ff}.turnstile-test-form p{flex:1 1 260px;margin:0}.turnstile-test-form .cf-turnstile{flex:0 1 auto}
.ca-permissions-form{display:grid;gap:18px}.permission-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:16px 18px;border:1px solid #e1d8ef;border-radius:12px;background:#fbf9ff}.permission-toolbar>span{margin-left:auto;color:#756d80;font-size:12px}.permission-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.permission-group{padding:0!important;overflow:hidden}.permission-group-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid #eee8f4;background:linear-gradient(135deg,#fff 0%,#faf7ff 100%)}.permission-group-head h3{margin:0 0 4px}.permission-group-head p{margin:0;font-size:11px}.permission-group-all{display:flex;align-items:center;gap:7px;white-space:nowrap;color:#66429f;font-size:11px;font-weight:800}.permission-group-all input,.permission-check input{accent-color:#7040d3}.permission-check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:#eee8f4}.permission-check{display:flex;align-items:flex-start;gap:10px;min-height:72px;padding:14px 16px;background:#fff;cursor:pointer}.permission-check:hover{background:#fcfaff}.permission-check input{flex:0 0 auto;width:17px;height:17px;margin-top:2px}.permission-check span,.permission-check strong,.permission-check small{display:block}.permission-check strong{color:#262035;font-size:12px;line-height:1.4}.permission-check small{margin-top:4px;color:#91889b;font-size:9px;line-height:1.35;word-break:break-word}.permission-save-bar{position:sticky;bottom:14px;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border:1px solid #d9c9ef;border-radius:12px;background:rgba(255,255,255,.96);box-shadow:0 12px 32px rgba(42,31,70,.14);backdrop-filter:blur(10px)}.permission-save-bar strong,.permission-save-bar span{display:block}.permission-save-bar span{margin-top:3px;color:#786f83;font-size:11px}
@media(max-width:1050px){.permission-groups{grid-template-columns:1fr}}
@media(max-width:700px){.permission-check-grid{grid-template-columns:1fr}.permission-group-head,.permission-save-bar,.turnstile-test-form{align-items:stretch;flex-direction:column}.permission-toolbar>span{width:100%;margin-left:0}.permission-save-bar button,.turnstile-test-form button{width:100%}.login-security-card{padding:18px!important}}

/* Phase 4.18.2.1 - Modern secure login */
.page-login{background:#f5f3f8}
.page-login .guest-shell{position:relative;isolation:isolate;background:
  radial-gradient(circle at 12% 18%,rgba(111,54,217,.12),transparent 31%),
  radial-gradient(circle at 88% 82%,rgba(255,90,31,.09),transparent 30%),
  linear-gradient(135deg,#f8f7fb 0%,#f3f1f7 54%,#f8f7fa 100%);overflow:hidden}
.page-login .guest-shell:before,.page-login .guest-shell:after{content:"";position:fixed;z-index:-1;border:1px solid rgba(96,65,149,.09);border-radius:50%;pointer-events:none}
.page-login .guest-shell:before{width:420px;height:420px;left:-210px;bottom:-210px;box-shadow:0 0 0 70px rgba(111,54,217,.025)}
.page-login .guest-shell:after{width:300px;height:300px;right:-150px;top:-150px;box-shadow:0 0 0 55px rgba(255,90,31,.025)}
.page-login .guest-brand{display:none}
.page-login .guest-content{display:grid;place-items:center;padding:clamp(28px,5vw,68px)}
.page-login .guest-footer{padding:0 24px 22px;color:#9691a0;letter-spacing:.02em}
.login-stage{display:grid;grid-template-columns:minmax(330px,.88fr) minmax(440px,1.12fr);width:min(980px,100%);min-height:590px;border:1px solid rgba(57,44,87,.11);border-radius:26px;background:#fff;box-shadow:0 30px 80px rgba(45,35,70,.14);overflow:hidden;animation:login-reveal .5s cubic-bezier(.2,.75,.3,1) both}
@keyframes login-reveal{from{opacity:0;transform:translateY(14px) scale(.992)}to{opacity:1;transform:none}}
.login-brand-panel{position:relative;display:flex;flex-direction:column;padding:42px 40px 34px;color:#fff;background:
  radial-gradient(circle at 82% 14%,rgba(138,90,255,.38),transparent 33%),
  radial-gradient(circle at 15% 88%,rgba(255,90,31,.20),transparent 30%),
  linear-gradient(155deg,#352d58 0%,#28213f 72%,#211b34 100%);overflow:hidden}
.login-brand-panel:before{content:"";position:absolute;width:330px;height:330px;right:-205px;bottom:30px;border:1px solid rgba(255,255,255,.08);border-radius:50%;box-shadow:0 0 0 48px rgba(255,255,255,.025),0 0 0 96px rgba(255,255,255,.018)}
.login-brand-logo{position:relative;width:210px;height:auto;object-fit:contain}
.login-brand-copy{position:relative;margin:auto 0 34px}.login-brand-kicker,.login-form-kicker{display:block;margin-bottom:13px;font-size:9px;font-weight:900;letter-spacing:.14em;text-transform:uppercase}
.login-brand-kicker{color:#cbbcf2}.login-brand-copy h1{margin:0 0 17px;color:#fff;font-size:38px;line-height:1.08;letter-spacing:-.045em}.login-brand-copy p{max-width:310px;margin:0;color:#c9c3d8;font-size:13px;line-height:1.75}
.login-trust-list{position:relative;display:grid;gap:11px;margin-bottom:28px}.login-trust-list span{display:flex;align-items:center;gap:10px;color:#e1ddec;font-size:11px;font-weight:650}.login-trust-list i{display:grid;place-items:center;width:27px;height:27px;border:1px solid rgba(255,255,255,.13);border-radius:8px;background:rgba(255,255,255,.055);color:#bda9ef;font-size:8px;font-style:normal;font-weight:900;letter-spacing:.04em}
.login-brand-status{position:relative;display:flex;align-items:center;gap:8px;padding-top:19px;border-top:1px solid rgba(255,255,255,.1);color:#a9a2ba;font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.login-brand-status span{width:7px;height:7px;border-radius:50%;background:#2bd18b;box-shadow:0 0 0 4px rgba(43,209,139,.12)}
.page-login .login{display:flex;flex-direction:column;justify-content:center;width:auto;margin:0;padding:48px 54px;background:#fff;border:0;border-radius:0;box-shadow:none}
.login-form-header{display:flex;align-items:flex-start;gap:14px;margin-bottom:23px}.login-lock-icon{display:grid;place-items:center;flex:0 0 42px;height:42px;border:1px solid #e4daf6;border-radius:12px;background:linear-gradient(145deg,#f7f2ff,#eee6ff);color:#6c3ccc}.login-lock-icon svg,.login-submit svg,.login-help svg,.login-shield svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.login-form-kicker{margin:0 0 3px;color:#7949d2}.page-login .login h2{margin:0;color:#211c2f;font-size:29px;line-height:1.15;letter-spacing:-.035em}.page-login .login-intro{margin:6px 0 0;color:#807889;font-size:12px}.login-error{margin:0 0 16px}
.login-form{display:grid;gap:16px}.login-field{margin:0!important}.login-field>span{display:block;margin:0 0 7px;color:#4a4456;font-size:10px;font-weight:850;letter-spacing:.015em}.login-field input{min-height:48px;padding:11px 14px;border-color:#ddd8e6;border-radius:10px;background:#fcfbfd;font-size:13px}.login-field input::placeholder{color:#aaa4b2}.login-field input:focus{border-color:#8a64dc;background:#fff;box-shadow:0 0 0 4px rgba(111,54,217,.09)}.login-field input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #fcfbfd inset;-webkit-text-fill-color:#211c2f}
.login-verification{margin-top:1px;padding:13px;border:1px solid #e6e1eb;border-radius:13px;background:linear-gradient(145deg,#fbfafc,#f7f5fa)}.login-verification-head{display:flex;align-items:center;gap:10px;margin:0 2px 11px}.login-verification-head strong,.login-verification-head small{display:block}.login-verification-head strong{color:#40394c;font-size:10.5px}.login-verification-head small{margin-top:1px;color:#918a9a;font-size:9px}.login-shield{display:grid;place-items:center;width:29px;height:29px;border-radius:8px;background:#ede8f7;color:#6741ae}.login-shield svg{width:17px;height:17px}
.page-login .login-turnstile{display:block;min-height:65px;margin:0}.page-login .login-turnstile .cf-turnstile{width:100%}.page-login .login-turnstile iframe{display:block;max-width:100%;margin:0 auto}
.page-login .login-submit{margin:2px 0 0}.page-login .login-submit button{display:flex;width:100%;min-height:49px;margin:0;padding:10px 15px;border-radius:10px;background:linear-gradient(135deg,#ff642b,#ff4f1a);box-shadow:0 8px 20px rgba(255,82,26,.22)}.page-login .login-submit button:hover{background:linear-gradient(135deg,#f6571f,#eb4612);box-shadow:0 10px 24px rgba(255,82,26,.28)}.page-login .login-submit svg{width:17px;height:17px;margin-left:auto}
.page-login .login-help{display:flex;align-items:center;gap:8px;margin:19px 0 0;padding-top:17px;border-top:1px solid #efedf2;color:#8a8391;font-size:10px}.page-login .login-help svg{flex:0 0 auto;width:16px;height:16px;color:#776a88}
@media(max-width:850px){.login-stage{grid-template-columns:1fr;width:min(540px,100%)}.login-brand-panel{min-height:184px;padding:28px 32px}.login-brand-logo{width:180px}.login-brand-copy{margin:auto 0 0}.login-brand-copy h1{margin:0;font-size:28px}.login-brand-copy p,.login-trust-list,.login-brand-status{display:none}.page-login .login{padding:38px 42px 42px}}
@media(max-width:520px){.page-login .guest-content{align-items:start;padding:18px 12px}.login-stage{border-radius:19px}.login-brand-panel{justify-content:center;min-height:0;padding:19px 22px;background:linear-gradient(120deg,#352d58,#28213f 72%,#211b34)}.login-brand-panel:before{display:none}.login-brand-logo{width:150px}.login-brand-copy{display:none}.page-login .login{padding:29px 22px 30px}.login-form-header{margin-bottom:21px}.page-login .login h2{font-size:25px}.login-verification{padding:11px}.page-login .guest-footer{padding-bottom:16px}.login-lock-icon{flex-basis:39px;height:39px}}

/* Phase 4.18.4 - permission-aware user help guide */
.user-help-page{max-width:1220px;margin:0 auto}.help-heading{align-items:flex-start}.help-hero{position:relative;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:36px;padding:34px;overflow:hidden;background:linear-gradient(135deg,#30274c 0%,#3d2b65 62%,#56328f 100%);color:#fff}.help-hero:after{content:"";position:absolute;right:-90px;top:-110px;width:310px;height:310px;border:1px solid rgba(255,255,255,.09);border-radius:50%;box-shadow:0 0 0 48px rgba(255,255,255,.025),0 0 0 96px rgba(255,255,255,.018)}.help-hero-copy,.help-hero-steps{position:relative;z-index:1}.help-kicker{display:block;margin-bottom:9px;color:#cbb9f6;font-size:10px;font-weight:900;letter-spacing:.13em;text-transform:uppercase}.help-hero h2{margin:0 0 11px;color:#fff;font-size:30px;letter-spacing:-.035em}.help-hero p{max-width:650px;margin:0;color:#d9d2e8;line-height:1.7}.help-hero-steps{display:grid;gap:9px}.help-hero-steps>div{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.065)}.help-hero-steps strong{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:9px;background:#fff;color:#6f36d9;font-size:12px}.help-hero-steps span{color:#f0ecf7;font-size:12px;line-height:1.45}.help-section{padding:28px}.help-section+.help-section{margin-top:18px}.help-section .section-title-row{margin-bottom:18px}.help-section h2,.help-glossary h2,.help-security h2{margin:0;color:#171329;font-size:19px}.help-link-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.help-link-card{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:92px;padding:15px 17px;border:1px solid #e6e0ed;border-radius:12px;background:linear-gradient(145deg,#fff,#faf8fc);color:#1b1730!important;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}.help-link-card:hover{transform:translateY(-2px);border-color:#ccbaf0;box-shadow:0 10px 22px rgba(61,44,91,.09)}.help-link-card strong,.help-link-card small{display:block}.help-link-card small{margin-top:5px;color:#837b91;font-size:10px;line-height:1.45}.help-link-card b{color:#ff5a1f;font-size:19px}.help-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;margin-top:18px;align-items:start}.help-main{min-width:0}.help-side{display:grid;gap:18px;position:sticky;top:92px}.help-section-head{display:flex;gap:14px;margin-bottom:19px}.help-section-head h2{margin:1px 0 5px}.help-section-head p{margin:0;color:#736c82;font-size:12px;line-height:1.6}.help-number{display:grid;place-items:center;flex:0 0 38px;height:38px;border:1px solid #dfd2f5;border-radius:11px;background:#f4effd;color:#6f36d9;font-size:10px;font-weight:900;letter-spacing:.06em}.help-steps{display:grid;gap:10px;margin:0;padding:0;counter-reset:help-step;list-style:none}.help-steps li{position:relative;min-height:31px;padding:6px 0 6px 42px;color:#50495d;font-size:12px;line-height:1.6}.help-steps li:before{counter-increment:help-step;content:counter(help-step);position:absolute;left:0;top:3px;display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#f2edf8;color:#6840ac;font-size:10px;font-weight:900}.help-note,.help-warning{margin-top:18px;padding:13px 15px;border-radius:10px;font-size:11px;line-height:1.65}.help-note{border:1px solid #dcd0f3;background:#f8f4ff;color:#5d4b7f}.help-warning{border:1px solid #f1d59b;background:#fff9ed;color:#785318}.help-topic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.help-topic-grid.compact{margin-top:18px}.help-topic-grid article{padding:16px;border:1px solid #ebe6f0;border-radius:11px;background:#fcfbfd}.help-topic-grid h3{margin:0 0 6px;color:#282137;font-size:13px}.help-topic-grid p{margin:0;color:#777080;font-size:11px;line-height:1.6}.help-faq{display:grid;gap:8px}.help-faq details{border:1px solid #e8e2ee;border-radius:10px;background:#fcfbfd}.help-faq summary{padding:13px 15px;color:#312a40;font-size:12px;font-weight:750;cursor:pointer}.help-faq details p{margin:0;padding:0 15px 15px;color:#736c7e;font-size:11px;line-height:1.65}.help-glossary,.help-security{padding:23px}.help-glossary dl{display:grid;gap:0;margin:16px 0 0}.help-glossary dl>div{padding:11px 0;border-top:1px solid #eeeaf2}.help-glossary dt{color:#332c42;font-size:11px;font-weight:800}.help-glossary dd{margin:4px 0 0;color:#81798b;font-size:10px;line-height:1.5}.help-security{border-top:3px solid #2eaf78}.help-security ul{display:grid;gap:10px;margin:16px 0 19px;padding-left:18px;color:#696171;font-size:11px;line-height:1.55}.help-security .btn{width:100%;text-align:center}
@media(max-width:1040px){.help-layout{grid-template-columns:1fr}.help-side{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}.help-link-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.help-heading .btn{width:100%;text-align:center}.help-hero{grid-template-columns:1fr;padding:24px;gap:23px}.help-hero h2{font-size:25px}.help-link-grid,.help-topic-grid,.help-side{grid-template-columns:1fr}.help-section{padding:21px}.help-link-card{min-height:80px}.help-side{gap:14px}}

/* Phase 5.0.1 - application-wide UI foundation */
.app-authenticated{
  --ui-border:#e5e2ec;
  --ui-border-strong:#d8d2e2;
  --ui-ink:#1c1830;
  --ui-muted:#777184;
  --ui-soft:#f8f7fb;
  --ui-soft-purple:#f5f1fc;
  --ui-shadow:0 1px 2px rgba(35,27,58,.025),0 12px 32px rgba(35,27,58,.055);
  background:
    radial-gradient(circle at 93% 1%,rgba(111,54,217,.035),transparent 25rem),
    linear-gradient(180deg,#f8f8fb 0,#f5f6fa 100%);
  color:var(--ui-ink)
}
.app-authenticated .app-main{background:transparent}
.app-authenticated .content-area{padding-top:30px;padding-bottom:48px}
.app-authenticated .topbar{border-bottom-color:#e8e5ee;box-shadow:0 1px 0 rgba(45,35,70,.015)}
.app-authenticated .topbar-title{color:#242034;font-weight:800;letter-spacing:-.025em}
.app-authenticated .topbar-role{background:#fff;border-color:#e8e2ef;box-shadow:0 3px 12px rgba(41,32,66,.035)}
.app-authenticated .app-footer{padding-top:2px;color:#a09baa}

.app-authenticated .page-heading{align-items:center;margin-bottom:22px}
.app-authenticated .page-heading>div:first-child{min-width:0}
.app-authenticated .page-heading h1{margin:5px 0 5px;color:#161228;font-size:30px;line-height:1.14;letter-spacing:-.045em}
.app-authenticated .page-subtitle{max-width:790px;color:#736c82;font-size:13px;line-height:1.65}
.app-authenticated .eyebrow-pill{display:inline-flex;align-items:center;min-height:23px;padding:4px 9px;border:1px solid #e5dafa;border-radius:999px;background:#f5efff;color:#6c36cf;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.app-authenticated .header-actions{justify-content:flex-end;gap:9px}

.app-authenticated .card{border-color:var(--ui-border);border-radius:15px;box-shadow:var(--ui-shadow)}
.app-authenticated .kpi,
.app-authenticated .summary-card,
.app-authenticated .metric-card{border-color:#e6e2ec;box-shadow:0 8px 24px rgba(38,29,63,.045)}
.app-authenticated .kpi{min-height:108px;padding:18px 19px}
.app-authenticated .kpi:before{width:3px}
.app-authenticated .kpi strong{color:#18142a;font-size:26px}
.app-authenticated .section-title-row h2,
.app-authenticated .section-title-row h3{color:#201a34;font-weight:820;letter-spacing:-.025em}
.app-authenticated .section-title-row .muted{color:#81798d;line-height:1.55}

.app-authenticated label{color:#514a60;font-size:10.5px;font-weight:800;letter-spacing:.005em}
.app-authenticated input,
.app-authenticated select,
.app-authenticated textarea{border-color:#dcd7e4;border-radius:9px;background:#fff;color:#252033;box-shadow:0 1px 1px rgba(38,30,62,.015)}
.app-authenticated input:hover,
.app-authenticated select:hover,
.app-authenticated textarea:hover{border-color:#c8c0d2}
.app-authenticated input:focus,
.app-authenticated select:focus,
.app-authenticated textarea:focus{border-color:#8b68d4;box-shadow:0 0 0 4px rgba(111,54,217,.09)}
.app-authenticated input::placeholder,
.app-authenticated textarea::placeholder{color:#aaa3b2}
.app-authenticated input[type="checkbox"],
.app-authenticated input[type="radio"]{width:17px;min-height:17px;height:17px;padding:0;accent-color:var(--primary);box-shadow:none}
.app-authenticated input[type="date"],
.app-authenticated input[type="month"],
.app-authenticated select{cursor:pointer}
.app-authenticated input:disabled,
.app-authenticated select:disabled,
.app-authenticated textarea:disabled{background:#f4f2f7;color:#96909f}

.app-authenticated button:not(.sidebar-group-toggle):not(.mobile-menu-btn):not(.ss-modal-close),
.app-authenticated .btn{min-height:40px;border-radius:9px;padding:9px 15px;font-size:11.5px;font-weight:800;box-shadow:0 6px 16px rgba(255,83,25,.17);transition:background .16s,border-color .16s,box-shadow .16s,transform .16s}
.app-authenticated button:not(.sidebar-group-toggle):not(.mobile-menu-btn):not(.ss-modal-close):hover,
.app-authenticated .btn:hover{transform:translateY(-1px)}
.app-authenticated button:not(.sidebar-group-toggle):not(.mobile-menu-btn):not(.ss-modal-close):active,
.app-authenticated .btn:active{transform:translateY(0)}
.app-authenticated .btn-secondary{border-color:#d8d2e1;background:#fff!important;box-shadow:0 2px 8px rgba(37,28,61,.03)}
.app-authenticated .btn-secondary:hover{border-color:#bdb2cb;background:#faf9fc!important;box-shadow:0 5px 14px rgba(37,28,61,.06)}
.app-authenticated .btn-danger{box-shadow:none}
.app-authenticated .btn-compact,
.app-authenticated .btn-sm{min-height:34px;padding:7px 11px;font-size:10.5px}

.app-authenticated :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid rgba(111,54,217,.28);outline-offset:2px}
.app-authenticated .nav-link:focus-visible,
.app-authenticated .sidebar-group-toggle:focus-visible,
.app-authenticated .logout-link:focus-visible{outline-color:rgba(255,255,255,.55)}

.app-authenticated .flash{padding:14px 16px;border-radius:11px;font-size:12px;line-height:1.55;box-shadow:0 5px 16px rgba(43,34,68,.035)}
.app-authenticated .flash.ok{border-left:4px solid #24ad77}
.app-authenticated .flash.warn{border-left:4px solid #e89236}
.app-authenticated .flash.bad{border-left:4px solid #e84b58}
.app-authenticated .comparison-info-note,
.app-authenticated .reporting-note{border-radius:11px;line-height:1.65}

.app-authenticated .table-wrap{max-width:100%;overflow:auto;overscroll-behavior-inline:contain;scrollbar-color:#c9c1d5 transparent;scrollbar-width:thin}
.app-authenticated table{color:#2a2438}
.app-authenticated th{height:42px;padding:11px 14px;background:#f8f7fb;color:#858092;font-size:9px;font-weight:900;letter-spacing:.075em}
.app-authenticated td{padding:12px 14px;border-bottom-color:#ece9f1;font-size:11.5px;line-height:1.5}
.app-authenticated tbody tr{transition:background .14s ease}
.app-authenticated tbody tr:hover td{background:#fbf9fe}
.app-authenticated .empty-cell{padding:38px 22px!important;background:linear-gradient(180deg,#fff,#fbfafd);color:#9690a2!important;font-size:12px;line-height:1.6}
.app-authenticated .badge,
.app-authenticated .status-pill,
.app-authenticated .count-pill{font-weight:850;letter-spacing:.03em}

.app-authenticated details>summary{border-radius:8px;transition:background .15s,color .15s}
.app-authenticated details>summary:hover{background:#f8f5fc;color:#5e31b9}
.app-authenticated .pagination,
.app-authenticated .standard-pagination{border-color:#e6e1ec;background:#fbfafd}

@media(max-width:900px){
  .app-authenticated .content-area{padding:25px 21px 40px}
  .app-authenticated .page-heading{align-items:flex-start}
  .app-authenticated .page-heading h1{font-size:27px}
}
@media(max-width:760px){
  .app-authenticated .content-area{padding:22px 14px 35px}
  .app-authenticated .page-heading{display:flex;flex-direction:column;gap:14px;margin-bottom:18px}
  .app-authenticated .page-heading h1{font-size:25px}
  .app-authenticated .page-heading .header-actions,
  .app-authenticated .page-heading>a.btn{width:100%}
  .app-authenticated .page-heading .header-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}
  .app-authenticated .page-heading .header-actions .btn,
  .app-authenticated .page-heading .header-actions form,
  .app-authenticated .page-heading .header-actions form .btn{width:100%}
  .app-authenticated .card{border-radius:13px;box-shadow:0 8px 23px rgba(36,28,59,.05)}
  .app-authenticated .kpi{min-height:96px;padding:15px}
  .app-authenticated .kpi strong{font-size:23px}
  .app-authenticated button:not(.sidebar-group-toggle):not(.mobile-menu-btn):not(.ss-modal-close),
  .app-authenticated .btn{min-height:42px}
  .app-authenticated th{height:40px}
  .app-authenticated td{padding-top:11px;padding-bottom:11px}
}
@media(max-width:480px){
  .app-authenticated .content-area{padding-left:11px;padding-right:11px}
  .app-authenticated .page-heading .header-actions{grid-template-columns:1fr}
  .app-authenticated .page-subtitle{font-size:12px}
  .app-authenticated .card{padding:17px}
}

/* Phase 5.0.2.2 - Sales Ledger laptop layout without horizontal scrolling */
@media(min-width:761px) and (max-width:1440px){
  .app-authenticated .sales-ledger-card .table-wrap{overflow:visible}
  .app-authenticated .sales-ledger-table{display:block;min-width:0;width:100%;border-collapse:separate}
  .app-authenticated .sales-ledger-table thead{display:none}
  .app-authenticated .sales-ledger-table tbody{display:block;width:100%}
  .app-authenticated .sales-ledger-table tr{display:grid;grid-template-columns:.72fr 1fr .72fr 1.2fr 1.15fr .7fr;column-gap:14px;row-gap:13px;align-items:start;padding:15px 16px;border-bottom:1px solid #ece9f1}
  .app-authenticated .sales-ledger-table tr:last-child{border-bottom:0}
  .app-authenticated .sales-ledger-table td{display:block;min-width:0;padding:0!important;border:0!important;text-align:left!important;white-space:normal;overflow-wrap:anywhere;background:transparent!important}
  .app-authenticated .sales-ledger-table td::before{content:attr(data-label);display:block;margin-bottom:5px;color:#918b9d;font-size:8px;font-weight:900;letter-spacing:.07em;line-height:1.2;text-transform:uppercase}
  .app-authenticated .sales-ledger-table td:last-child::before{content:"Action"}
  .app-authenticated .sales-ledger-table .empty-cell{grid-column:1/-1}
  .app-authenticated .sales-ledger-table td.num{text-align:left!important}
  .app-authenticated .sales-ledger-table .sales-total-cell strong{color:#241f33;font-size:13px}
  .app-authenticated .sales-ledger-table .row-view-link{display:inline-flex;align-items:center;min-height:28px;padding:4px 10px;border:1px solid #ddd5e8;border-radius:7px;background:#fff;text-decoration:none}
  .app-authenticated .sales-ledger-table tbody tr:hover{background:#fbf9fe}
}

/* Phase 5.0.2.3 - Keep Sales Ledger mobile actions compact */
@media(max-width:760px){
  .app-authenticated.page-sales .sales-heading-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:center!important;gap:10px!important;margin-top:0!important}
  .app-authenticated.page-sales .sales-heading-actions .btn,
  .app-authenticated.page-sales .sales-heading-actions .btn+.btn{flex:0 0 auto!important;width:100%!important;height:auto!important;min-height:44px!important;padding:10px 12px!important;line-height:1.25!important}
}
@media(max-width:480px){
  .app-authenticated.page-sales .sales-heading-actions{grid-template-columns:1fr!important}
}

/* Phase 5.0.3 - Balanced Add/Edit Expense forms */
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form{padding:26px}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-details-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 16px;align-items:end}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-details-grid label{min-width:0;margin:0}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-details-grid input,
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-details-grid select{min-height:44px}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .gst-entry-panel>.form-grid{align-items:end}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .gst-tax-fields{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .payment-grid{align-items:end}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .upload-panel{margin-bottom:20px}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .form-actions{align-items:center;padding-top:2px}
@media(max-width:1100px){
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-details-grid,
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .payment-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .gst-tax-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form{padding:18px}
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-details-grid,
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .payment-grid,
  .app-authenticated:is(.page-expense-new,.page-expense-edit) .gst-tax-fields{grid-template-columns:1fr}
}

/* Phase 5.0.3.1 - Lighter Expense form typography */
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form label{color:#4c4558;font-weight:600!important}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form input:not([type="checkbox"]):not([type="file"]),
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form select,
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form textarea{color:#262130;font-weight:500!important}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form input::placeholder,
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form textarea::placeholder{font-weight:450!important}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form .form-section-title{font-weight:750}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form .check-label{font-weight:600!important}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form .upload-panel strong{font-weight:650}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form .gst-total-summary span{font-weight:750}
.app-authenticated:is(.page-expense-new,.page-expense-edit) .expense-form .gst-total-summary strong{font-weight:750}

/* Phase 5.0.4 - Expenses filter alignment and mobile overflow containment */
.app-authenticated.page-expenses .expense-filter{align-items:end}
.app-authenticated.page-expenses .expense-filter label{margin:0}
.app-authenticated.page-expenses .expense-filter input,
.app-authenticated.page-expenses .expense-filter select,
.app-authenticated.page-expenses .expense-filter>button{height:46px;min-height:46px;box-sizing:border-box}
.app-authenticated.page-expenses .expense-filter>button{align-self:end;justify-self:stretch;margin:0;white-space:nowrap}
@media(max-width:1180px){
  .app-authenticated.page-expenses .expense-filter>button{width:100%}
}
@media(max-width:900px){
  .app-authenticated.page-expenses{overflow-x:hidden}
  .app-authenticated.page-expenses .content-area,
  .app-authenticated.page-expenses .expense-list-card,
  .app-authenticated.page-expenses .expense-list-card .table-wrap,
  .app-authenticated.page-expenses .expense-table,
  .app-authenticated.page-expenses .expense-table tbody{min-width:0;max-width:100%;width:100%;box-sizing:border-box}
  .app-authenticated.page-expenses .expense-list-card .table-wrap{overflow:visible!important}
  .app-authenticated.page-expenses .expense-table tr{min-width:0;max-width:100%;width:100%;box-sizing:border-box}
  .app-authenticated.page-expenses .expense-table td{min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
  .app-authenticated.page-expenses .expense-table td:nth-child(10) .btn{max-width:100%;box-sizing:border-box}
  .app-authenticated.page-expenses .expense-list-card{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important;overflow:visible!important}
  .app-authenticated.page-expenses .expense-list-card .table-wrap,
  .app-authenticated.page-expenses .expense-table,
  .app-authenticated.page-expenses .expense-table tbody{background:transparent!important}
  .app-authenticated.page-expenses .expense-table tbody tr:hover td{background:transparent!important}
}
@media(max-width:760px){
  .app-authenticated.page-expenses .app-shell{display:block!important;width:100%!important;max-width:100%!important}
  .app-authenticated.page-expenses .app-main{margin-left:0!important;width:100%!important;max-width:100%!important;min-width:0!important}
}
@media(max-width:620px){
  .app-authenticated.page-expenses .expense-filter>button{align-self:stretch;margin-top:0}
}

/* Phase 5.1 - Lighter Vendors form typography */
.app-authenticated:is(.page-vendors,.page-vendor-edit) :is(.vendor-add-form,.vendor-edit-form) label,
.app-authenticated.page-vendors .vendor-search-form label{color:#4c4558;font-weight:600!important}
.app-authenticated:is(.page-vendors,.page-vendor-edit) :is(.vendor-add-form,.vendor-edit-form) input,
.app-authenticated:is(.page-vendors,.page-vendor-edit) :is(.vendor-add-form,.vendor-edit-form) select,
.app-authenticated:is(.page-vendors,.page-vendor-edit) :is(.vendor-add-form,.vendor-edit-form) textarea,
.app-authenticated.page-vendors .vendor-search-form input,
.app-authenticated.page-vendors .vendor-search-form select{color:#262130;font-weight:500!important}
.app-authenticated:is(.page-vendors,.page-vendor-edit) :is(.vendor-add-form,.vendor-edit-form) input::placeholder,
.app-authenticated:is(.page-vendors,.page-vendor-edit) :is(.vendor-add-form,.vendor-edit-form) textarea::placeholder,
.app-authenticated.page-vendors .vendor-search-form input::placeholder{font-weight:450!important}

/* Phase 5.1.1 - Vendors directory actions and responsive containment */
@media(min-width:1181px){
  .app-authenticated.page-vendors .vendor-directory-head,
  .app-authenticated.page-vendors .vendor-directory-table .managed-vendor-row{
    grid-template-columns:minmax(175px,1.15fr) minmax(165px,1fr) minmax(125px,.82fr) 100px 78px minmax(230px,auto)
  }
  .app-authenticated.page-vendors .vendor-directory-table .vendor-status-cell{justify-content:flex-start}
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions{min-width:230px}
}
@media(min-width:641px) and (max-width:1180px){
  .app-authenticated.page-vendors .vendor-directory-table .managed-vendor-row{
    grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(180px,.85fr)
  }
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    min-width:180px
  }
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions>*{width:100%}
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions :is(.btn,.btn-danger){width:100%;text-align:center}
}
@media(max-width:760px){
  .app-authenticated.page-vendors{overflow-x:hidden}
  .app-authenticated.page-vendors .app-shell{display:block!important;width:100%!important;max-width:100%!important}
  .app-authenticated.page-vendors .app-main{margin-left:0!important;width:100%!important;max-width:100%!important;min-width:0!important}
  .app-authenticated.page-vendors .content-area,
  .app-authenticated.page-vendors .vendor-add-form,
  .app-authenticated.page-vendors .vendor-directory-card,
  .app-authenticated.page-vendors .vendor-directory-table,
  .app-authenticated.page-vendors .managed-vendor-list,
  .app-authenticated.page-vendors .managed-vendor-row{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
}
@media(max-width:640px){
  .app-authenticated.page-vendors .vendor-directory-table .managed-vendor-row{overflow:hidden}
  .app-authenticated.page-vendors .vendor-directory-table .managed-vendor-row>*{min-width:0}
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important
  }
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions>*{display:block;width:100%!important;min-width:0}
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions :is(.btn,.btn-danger){width:100%!important;min-width:0!important;text-align:center}
}

/* Phase 5.1.2 - Keep every Vendor action visible on laptop screens */
@media(min-width:1181px) and (max-width:1440px){
  .app-authenticated.page-vendors .vendor-directory-head,
  .app-authenticated.page-vendors .vendor-directory-table .managed-vendor-row{
    grid-template-columns:minmax(155px,1.1fr) minmax(150px,1fr) minmax(115px,.8fr) 82px 66px 156px
  }
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:5px;
    width:156px;
    min-width:156px
  }
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions>*{display:block;width:100%;min-width:0}
  .app-authenticated.page-vendors .vendor-directory-table .vendor-actions :is(.btn,.btn-danger){width:100%;min-width:0;padding-left:6px;padding-right:6px;text-align:center}
}

/* Phase 5.2 - Lighter Recurring Bills form typography */
.app-authenticated.page-recurring-bills .recurring-add-form label,
.app-authenticated.page-recurring-bills .recurring-filter-toolbar label,
.app-authenticated.page-recurring-bill-edit .expense-form label{color:#4c4558;font-weight:600!important}
.app-authenticated.page-recurring-bills .recurring-add-form :is(input,select,textarea),
.app-authenticated.page-recurring-bills .recurring-filter-toolbar :is(input,select),
.app-authenticated.page-recurring-bill-edit .expense-form :is(input,select,textarea){color:#262130;font-weight:500!important}
.app-authenticated.page-recurring-bills .recurring-add-form :is(input,textarea)::placeholder,
.app-authenticated.page-recurring-bills .recurring-filter-toolbar input::placeholder,
.app-authenticated.page-recurring-bill-edit .expense-form :is(input,textarea)::placeholder{font-weight:450!important}

/* Phase 5.2.1 - Recurring Bills SaaS-style layout and responsive schedule */
.app-authenticated.page-recurring-bills .recurring-stat-grid{gap:14px;margin-bottom:24px}
.app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat{min-height:112px;padding:19px 20px!important}
.app-authenticated.page-recurring-bills .recurring-add-form{margin-bottom:20px;padding:26px 28px 24px!important;overflow:hidden}
.app-authenticated.page-recurring-bills .recurring-add-form>.section-title-row{margin:0;padding:0 0 18px;border-bottom:1px solid #eeeaf3}
.app-authenticated.page-recurring-bills .recurring-add-form>.section-title-row .muted{margin-top:5px}
.app-authenticated.page-recurring-bills .recurring-form-grid{margin:22px 0 20px!important;column-gap:18px!important;row-gap:20px!important}
.app-authenticated.page-recurring-bills .recurring-add-form label,
.app-authenticated.page-recurring-bills .recurring-filter-toolbar label{display:flex;min-width:0;flex-direction:column;gap:8px;margin:0!important;line-height:1.3}
.app-authenticated.page-recurring-bills .recurring-add-form :is(input,select){height:46px;min-height:46px;padding:10px 13px}
.app-authenticated.page-recurring-bills .recurring-add-form textarea{min-height:102px;padding:12px 13px;line-height:1.5}
.app-authenticated.page-recurring-bills .recurring-form-actions{display:flex;justify-content:flex-end;padding-top:18px;border-top:1px solid #eeeaf3}
.app-authenticated.page-recurring-bills .recurring-form-actions .btn{min-width:168px}
.app-authenticated.page-recurring-bills .recurring-directory-card{padding:26px 28px!important}
.app-authenticated.page-recurring-bills .recurring-directory-card>.section-title-row{align-items:center;margin:0!important;padding:0 0 18px!important}
.app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:minmax(210px,1.5fr) repeat(4,minmax(125px,1fr)) minmax(150px,auto);gap:12px;margin:18px 0!important;padding:16px;border:1px solid #ece7f1;border-radius:13px;background:#faf9fc}
.app-authenticated.page-recurring-bills .recurring-filter-toolbar :is(input,select){height:46px;min-height:46px;padding:10px 12px;background:#fff}
.app-authenticated.page-recurring-bills .recurring-filter-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-self:end}
.app-authenticated.page-recurring-bills .recurring-filter-actions .btn{width:100%;height:46px;min-height:46px;padding-left:12px;padding-right:12px}
.app-authenticated.page-recurring-bills .recurring-directory-card .table-wrap{box-shadow:0 4px 14px rgba(38,29,63,.025)}
.app-authenticated.page-recurring-bills .recurring-table tbody tr:last-child td{border-bottom:0}

@media(max-width:1400px){
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .app-authenticated.page-recurring-bills .recurring-add-form,
  .app-authenticated.page-recurring-bills .recurring-directory-card{padding:22px!important}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app-authenticated.page-recurring-bills .recurring-filter-actions{grid-column:1/-1}
  .app-authenticated.page-recurring-bills .recurring-directory-card .table-wrap{overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none}
  .app-authenticated.page-recurring-bills .recurring-table{display:block;width:100%;min-width:0!important;background:transparent}
  .app-authenticated.page-recurring-bills .recurring-table thead{display:none}
  .app-authenticated.page-recurring-bills .recurring-table tbody{display:grid;gap:12px}
  .app-authenticated.page-recurring-bills .recurring-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px;padding:18px;border:1px solid #e8e3ed;border-radius:13px;background:#fff;box-shadow:0 7px 20px rgba(38,29,63,.045)}
  .app-authenticated.page-recurring-bills .recurring-table td{display:block;min-width:0;padding:0;border:0;font-size:13px;overflow-wrap:anywhere}
  .app-authenticated.page-recurring-bills .recurring-table td:before{display:block;margin-bottom:5px;color:#91899c;font-size:9px;font-weight:850;letter-spacing:.06em;text-transform:uppercase}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(1):before{content:"Due"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(2):before{content:"Recurring Bill"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(3):before{content:"Vendor / Category"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(4):before{content:"Frequency"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(5):before{content:"Expected"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(6):before{content:"History"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(7):before{content:"Status"}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(8){grid-column:1/-1;padding-top:13px;border-top:1px solid #eeeaf3}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(8):before{content:"Actions"}
  .app-authenticated.page-recurring-bills .recurring-table .compact-action-group{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  .app-authenticated.page-recurring-bills .recurring-table .compact-action-group .btn{width:100%;text-align:center}
  .app-authenticated.page-recurring-bills .recurring-table .empty-cell{grid-column:1/-1;padding:26px!important;text-align:center}
  .app-authenticated.page-recurring-bills .recurring-table .empty-cell:before{display:none}
}
@media(max-width:640px){
  .app-authenticated.page-recurring-bills .recurring-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:last-child{grid-column:1/-1}
  .app-authenticated.page-recurring-bills .recurring-add-form,
  .app-authenticated.page-recurring-bills .recurring-directory-card{padding:18px!important}
  .app-authenticated.page-recurring-bills .recurring-form-grid{margin:20px 0!important}
  .app-authenticated.page-recurring-bills .recurring-form-actions .btn{width:100%}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:1fr;padding:14px}
  .app-authenticated.page-recurring-bills .recurring-filter-actions{grid-column:auto}
  .app-authenticated.page-recurring-bills .recurring-table tr{grid-template-columns:1fr;padding:16px}
  .app-authenticated.page-recurring-bills .recurring-table td:nth-child(8){grid-column:auto}
}
@media(max-width:420px){
  .app-authenticated.page-recurring-bills .recurring-stat-grid{grid-template-columns:1fr}
  .app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:last-child{grid-column:auto}
  .app-authenticated.page-recurring-bills .recurring-table .compact-action-group{grid-template-columns:1fr}
}

/* Phase 5.2.2 - Professional Recurring Bills filter composition */
.app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:nth-child(1):before{background:#ef6a67}
.app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:nth-child(2):before{background:#f2a93b}
.app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:nth-child(3):before{background:#8b68d4}
.app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:nth-child(4):before,
.app-authenticated.page-recurring-bills .recurring-stat-grid .account-stat:nth-child(5):before{background:#35b986}
.app-authenticated.page-recurring-bills .recurring-directory-card>.section-title-row{border-bottom:0!important}
.app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:minmax(220px,1.45fr) repeat(4,minmax(130px,1fr)) minmax(190px,auto);padding:18px;background:linear-gradient(145deg,#faf9fc,#f8f7fb);box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.app-authenticated.page-recurring-bills .recurring-filter-actions{min-width:190px}
.app-authenticated.page-recurring-bills .recurring-filter-actions .recurring-filter-apply,
.app-authenticated.page-recurring-bills .recurring-filter-toolbar>button.btn{border-color:#ff5a1f;background:#ff5a1f!important;color:#fff!important;box-shadow:0 7px 16px rgba(255,90,31,.19)}
.app-authenticated.page-recurring-bills .recurring-filter-actions .recurring-filter-apply:hover,
.app-authenticated.page-recurring-bills .recurring-filter-toolbar>button.btn:hover{border-color:#e94711;background:#e94711!important}
.app-authenticated.page-recurring-bills .recurring-filter-actions .recurring-filter-clear{background:#fff!important;border-color:#d8d1e2!important;color:#51485f!important;font-weight:700;box-shadow:0 3px 10px rgba(43,34,63,.06)}
.app-authenticated.page-recurring-bills .recurring-filter-actions .recurring-filter-clear:hover{border-color:#8b68d4!important;background:#f8f5ff!important;color:#5431a8!important;box-shadow:0 5px 14px rgba(84,49,168,.1)}
.app-authenticated.page-recurring-bills .recurring-filter-actions .recurring-filter-clear:focus-visible{outline:3px solid rgba(139,104,212,.2);outline-offset:2px}

@media(max-width:1400px){
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:repeat(4,minmax(0,1fr))}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>label:first-of-type{grid-column:span 2}
  .app-authenticated.page-recurring-bills .recurring-filter-actions{grid-column:span 2;min-width:0}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>button.btn{grid-column:3}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>a.btn{grid-column:4}
}
@media(max-width:1100px){
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>label:first-of-type,
  .app-authenticated.page-recurring-bills .recurring-filter-actions{grid-column:1/-1}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>button.btn{grid-column:1}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>a.btn{grid-column:2}
}
@media(max-width:640px){
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>label:first-of-type{grid-column:1/-1}
  .app-authenticated.page-recurring-bills .recurring-filter-actions{grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .app-authenticated.page-recurring-bills .recurring-filter-actions .btn{width:100%;min-width:0}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>button.btn{grid-column:1}
  .app-authenticated.page-recurring-bills .recurring-filter-toolbar>a.btn{grid-column:2}
}

/* Phase 5.3 - Add/Edit Employee form and responsive shell refinement */
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form,
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-section,
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form .app-responsive-grid{min-width:0;max-width:100%;box-sizing:border-box}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form{gap:20px}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-section{padding:24px!important;overflow:hidden}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-section-heading{margin-bottom:20px;padding-bottom:16px}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-section-heading h3{font-weight:750;letter-spacing:-.015em}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-section-heading p{color:#81798d;font-weight:400;line-height:1.55}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form .app-responsive-grid{gap:19px 16px}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form label{min-width:0;margin:0;color:#4c4558;font-weight:600!important;line-height:1.35}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){width:100%;min-width:0;color:#262130;font-weight:500!important;box-sizing:border-box}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form :is(input:not([type="checkbox"]):not([type="radio"]),select){height:46px;min-height:46px;margin-top:8px;padding:10px 13px}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form textarea{margin-top:8px;padding:12px 13px;line-height:1.5}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form :is(input,textarea)::placeholder{font-weight:400!important}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form :is(.field-optional,.field-hint){color:#918a9c;font-weight:500!important}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:2px!important}
.app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-actions .btn{min-width:126px;text-align:center}

@media(max-width:760px){
  .app-authenticated:is(.page-employee-add,.page-employee-edit){overflow-x:hidden}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .app-shell{display:block!important;width:100%!important;max-width:100%!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .app-main{margin-left:0!important;width:100%!important;max-width:100%!important;min-width:0!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) :is(.content-area,.page-heading,.employee-form,.employee-form-section,.employee-form .app-responsive-grid){width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-section{padding:19px!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form .app-responsive-grid{grid-template-columns:1fr!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form :is(.span-2,.employee-full-address,.notes-full){grid-column:1!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-actions{display:grid;grid-template-columns:minmax(0,2fr) minmax(108px,1fr);gap:10px;width:100%;padding-top:0!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-actions .btn{width:100%;min-width:0;min-height:46px;margin:0}
}

@media(max-width:480px){
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form{gap:14px}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-form-section{padding:17px!important}
  .app-authenticated:is(.page-employee-add,.page-employee-edit) .employee-section-heading{margin-bottom:18px}
}

/* Phase 5.4 - application-wide responsive form and layout hardening */
.app-authenticated,
.app-authenticated .app-shell,
.app-authenticated .app-main,
.app-authenticated .content-area,
.app-authenticated .content-area > *{min-width:0}
.app-authenticated form,
.app-authenticated form :is(.form-grid,.filter-grid,.filter-bar,.app-responsive-grid),
.app-authenticated form :is(input,select,textarea,button){box-sizing:border-box;min-width:0;max-width:100%}
.app-authenticated form label{min-width:0;max-width:100%;color:#4f475b;font-weight:600!important;line-height:1.35}
.app-authenticated form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]),select,textarea){color:#272231;font-weight:500!important}
.app-authenticated form :is(input,textarea)::placeholder{color:#aba3b8;font-weight:400!important}
.app-authenticated form label small,
.app-authenticated form .field-hint,
.app-authenticated form .help-text{font-weight:400!important;line-height:1.45}
.app-authenticated .employee-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;width:100%}
.app-authenticated .employee-form-actions :is(.btn,button){min-height:42px;min-width:126px;margin:0}

/* Process Salary uses the shared form language with clearer rhythm and density. */
.app-authenticated.page-payroll-add .payroll-form{overflow:hidden;padding:26px}
.app-authenticated.page-payroll-add .payroll-grid{align-items:start;gap:20px 16px}
.app-authenticated.page-payroll-add .payroll-form label{margin:0}
.app-authenticated.page-payroll-add .payroll-form label>:is(input,select,textarea){margin-top:8px}
.app-authenticated.page-payroll-add .payroll-form label>:is(input,select){min-height:46px}
.app-authenticated.page-payroll-add .form-section-title{margin:0 0 22px;padding:0 0 14px;border-bottom:1px solid #e8e3ef;color:#171225;font-size:17px;font-weight:750}
.app-authenticated.page-payroll-add .form-section-title:not(:first-child){margin-top:28px}
.app-authenticated.page-payroll-add .notes-full{display:block;margin-top:20px}
.app-authenticated.page-payroll-add .notes-full textarea{min-height:110px;resize:vertical}
.app-authenticated.page-payroll-add .payroll-posting-note{margin-top:20px;padding:15px 16px;border:1px solid #ddd0ff;border-radius:12px;background:#f8f5ff;color:#5c477b;line-height:1.55}
.app-authenticated.page-payroll-add .employee-form-actions{margin-top:16px}

@media(min-width:641px) and (max-width:1100px){
  .app-authenticated form .form-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(min-width:641px) and (max-width:900px){
  .app-authenticated form .form-grid.cols-3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  body.app-authenticated{overflow-x:hidden}
  body.app-authenticated .app-shell{display:block!important;grid-template-columns:none!important;width:100%!important;max-width:100%!important;min-width:0!important}
  body.app-authenticated .app-main{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important}
  body.app-authenticated :is(.content-area,.page-heading,form,.card,.form-grid,.table-wrap){min-width:0!important;max-width:100%!important;box-sizing:border-box}
  .app-authenticated.page-payroll-add .payroll-form{padding:20px}
  .app-authenticated.page-payroll-add .payroll-grid{grid-template-columns:minmax(0,1fr)!important;gap:19px}
}
@media(max-width:640px){
  .app-authenticated form :is(.form-grid.cols-2,.form-grid.cols-3,.form-grid.cols-4,.app-responsive-grid){grid-template-columns:minmax(0,1fr)!important}
  .app-authenticated form :is(.span-2,.span-3,.span-4){grid-column:1!important}
  .app-authenticated .employee-form-actions{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:10px}
  .app-authenticated .employee-form-actions :is(.btn,button){width:100%;min-width:0}
}
@media(max-width:480px){
  .app-authenticated.page-payroll-add .payroll-form{padding:17px}
  .app-authenticated.page-payroll-add .form-section-title{margin-bottom:19px}
}

/* Phase 5.4.1 - Employees directory responsive refinement */
@media(min-width:761px) and (max-width:1180px){
  .app-authenticated.page-employees .employee-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
  .app-authenticated.page-employees .employee-table{width:100%;min-width:0;table-layout:auto}
  .app-authenticated.page-employees .employee-table th,
  .app-authenticated.page-employees .employee-table td{padding-left:11px;padding-right:11px}
  .app-authenticated.page-employees .employee-row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;min-width:142px}
  .app-authenticated.page-employees .employee-row-actions :is(a.btn,form,form .btn){width:100%;min-width:0;margin:0;box-sizing:border-box}
  .app-authenticated.page-employees .employee-row-actions .protected-action{grid-column:1/-1}
}

@media(max-width:760px){
  .app-authenticated.page-employees{overflow-x:hidden}
  .app-authenticated.page-employees .page-heading>a.btn{display:flex;align-items:center;justify-content:center;width:100%}

  .app-authenticated.page-employees .employee-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:13px}
  .app-authenticated.page-employees .employee-filter-bar .employee-search,
  .app-authenticated.page-employees .employee-filter-bar label:not(.employee-search){grid-column:1/-1;width:100%;min-width:0}
  .app-authenticated.page-employees .employee-filter-bar input,
  .app-authenticated.page-employees .employee-filter-bar select{width:100%;min-width:0;max-width:100%;height:44px;box-sizing:border-box}
  .app-authenticated.page-employees .employee-filter-bar>.btn{width:100%;min-width:0;margin:0;justify-content:center;text-align:center}

  .app-authenticated.page-employees .employee-directory-card{padding:0!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}
  .app-authenticated.page-employees .employee-directory-card .table-wrap{margin:0!important;overflow:visible!important;max-width:100%!important}
  .app-authenticated.page-employees .employee-table{display:block!important;width:100%!important;min-width:0!important;border-collapse:separate!important;border-spacing:0!important;background:transparent!important}
  .app-authenticated.page-employees .employee-table thead{display:none!important}
  .app-authenticated.page-employees .employee-table tbody{display:block!important;width:100%!important}
  .app-authenticated.page-employees .employee-table tbody tr{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;margin:0 0 12px;padding:14px 15px;background:#fff;border:1px solid #e8e4ef;border-radius:14px;box-shadow:0 7px 22px rgba(36,28,59,.05);box-sizing:border-box;overflow:hidden}
  .app-authenticated.page-employees .employee-table tbody tr:last-child{margin-bottom:0}
  .app-authenticated.page-employees .employee-table tbody td{display:grid!important;grid-template-columns:108px minmax(0,1fr);gap:11px;align-items:start;width:100%!important;min-width:0!important;max-width:100%!important;padding:7px 0!important;border:0!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere;box-sizing:border-box;background:transparent!important}
  .app-authenticated.page-employees .employee-table tbody td::before{display:block;padding-top:2px;color:#918a9d;font-size:8.5px;font-weight:850;letter-spacing:.06em;line-height:1.25;text-transform:uppercase}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(1)::before{content:"Employee"}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(2)::before{content:"Contact"}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(3)::before{content:"Role / Dept"}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(4)::before{content:"Joined"}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(5)::before{content:"Salary"}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(6)::before{content:"Status"}
  .app-authenticated.page-employees .employee-table tbody td:nth-child(7)::before{content:"Actions"}
  .app-authenticated.page-employees .employee-table tbody td:first-child{padding-top:1px!important;padding-bottom:10px!important}
  .app-authenticated.page-employees .employee-table tbody td:first-child strong{font-size:13px}
  .app-authenticated.page-employees .employee-table tbody td small{min-width:0;overflow-wrap:anywhere}
  .app-authenticated.page-employees .employee-table tbody td:last-child{margin-top:5px;padding-top:12px!important;border-top:1px solid #eeeaf3!important}
  .app-authenticated.page-employees .employee-table .empty-cell{display:block!important;padding:26px 14px!important;text-align:center!important}
  .app-authenticated.page-employees .employee-table .empty-cell::before{display:none!important;content:none!important}

  .app-authenticated.page-employees .employee-row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;min-width:0;justify-content:stretch}
  .app-authenticated.page-employees .employee-row-actions :is(a.btn,form,form .btn){width:100%;min-width:0;max-width:100%;margin:0;box-sizing:border-box;text-align:center;justify-content:center}
  .app-authenticated.page-employees .employee-row-actions .protected-action{grid-column:1/-1;justify-self:start}

  .app-authenticated.page-employees .employee-directory-card .sales-pagination{margin-top:10px;background:#fff;border:1px solid #e8e4ef;border-radius:13px}
}

@media(max-width:430px){
  .app-authenticated.page-employees .employee-filter-bar{padding:12px}
  .app-authenticated.page-employees .employee-table tbody tr{padding:13px}
  .app-authenticated.page-employees .employee-table tbody td{grid-template-columns:92px minmax(0,1fr);gap:9px}
}

/* Phase 5.4.2 - Salary Payments responsive refinement */
@media(min-width:761px) and (max-width:1180px){
  .app-authenticated.page-payroll .payroll-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  .app-authenticated.page-payroll .payroll-filter-bar{grid-template-columns:160px minmax(210px,1fr) 150px auto auto;gap:10px;padding:16px}
  .app-authenticated.page-payroll .payroll-filter-bar label{min-width:0}
  .app-authenticated.page-payroll .payroll-filter-bar :is(input,select){width:100%;min-width:0;max-width:100%}
  .app-authenticated.page-payroll .payroll-list-card{max-width:100%;overflow:hidden}
  .app-authenticated.page-payroll .payroll-list-card .table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
  .app-authenticated.page-payroll .payroll-table{min-width:1180px}
}

@media(max-width:760px){
  .app-authenticated.page-payroll{overflow-x:hidden}
  .app-authenticated.page-payroll .page-heading>a.btn{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;margin:0}
  .app-authenticated.page-payroll .payroll-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}

  .app-authenticated.page-payroll .payroll-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:13px}
  .app-authenticated.page-payroll .payroll-filter-bar label{width:100%;min-width:0}
  .app-authenticated.page-payroll .payroll-filter-bar label:nth-of-type(1),
  .app-authenticated.page-payroll .payroll-filter-bar label:nth-of-type(2){grid-column:1/-1}
  .app-authenticated.page-payroll .payroll-filter-bar label:nth-of-type(3){grid-column:1/-1}
  .app-authenticated.page-payroll .payroll-filter-bar :is(input,select){width:100%;min-width:0;max-width:100%;height:44px;box-sizing:border-box}
  .app-authenticated.page-payroll .payroll-filter-bar>.btn{width:100%;min-width:0;max-width:100%;margin:0;justify-content:center;text-align:center}

  .app-authenticated.page-payroll .payroll-list-card{padding:0!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}
  .app-authenticated.page-payroll .payroll-list-card>.table-wrap{margin:0!important;overflow:visible!important;max-width:100%!important;border:0!important}
  .app-authenticated.page-payroll .payroll-table{display:block!important;width:100%!important;min-width:0!important;border-collapse:separate!important;border-spacing:0!important;background:transparent!important}
  .app-authenticated.page-payroll .payroll-table thead{display:none!important}
  .app-authenticated.page-payroll .payroll-table tbody{display:block!important;width:100%!important}
  .app-authenticated.page-payroll .payroll-table tbody tr{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;margin:0 0 12px;padding:14px 15px;background:#fff;border:1px solid #e8e4ef;border-radius:14px;box-shadow:0 7px 22px rgba(36,28,59,.05);box-sizing:border-box;overflow:hidden}
  .app-authenticated.page-payroll .payroll-table tbody tr:last-child{margin-bottom:0}
  .app-authenticated.page-payroll .payroll-table tbody td{display:grid!important;grid-template-columns:118px minmax(0,1fr);gap:10px;align-items:start;width:100%!important;min-width:0!important;max-width:100%!important;padding:7px 0!important;border:0!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere;box-sizing:border-box;background:transparent!important}
  .app-authenticated.page-payroll .payroll-table tbody td::before{display:block;padding-top:2px;color:#918a9d;font-size:8.5px;font-weight:850;letter-spacing:.055em;line-height:1.25;text-transform:uppercase}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(1)::before{content:"Month"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(2)::before{content:"Employee"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(3)::before{content:"Base Salary"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(4)::before{content:"Transport"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(5)::before{content:"Bonus"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(6)::before{content:"Reimbursement"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(7)::before{content:"Advance Recovery"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(8)::before{content:"Deductions"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(9)::before{content:"Salary Due"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(10)::before{content:"Payable Now"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(11)::before{content:"Paid"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(12)::before{content:"Pending"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(13)::before{content:"Status"}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(14)::before{content:"Action"}
  .app-authenticated.page-payroll .payroll-table tbody td:first-child{padding-top:1px!important;padding-bottom:10px!important}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(9),
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(10),
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(12){font-weight:700}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(14){margin-top:5px;padding-top:12px!important;border-top:1px solid #eeeaf3!important}
  .app-authenticated.page-payroll .payroll-table tbody td:nth-child(14) .btn{display:flex;width:100%;min-width:0;justify-content:center;margin:0}
  .app-authenticated.page-payroll .payroll-table .empty-cell{display:block!important;padding:28px 15px!important;text-align:center!important;background:#fff!important;border:1px solid #e8e4ef!important;border-radius:14px!important;color:#8e899e!important}
  .app-authenticated.page-payroll .payroll-table .empty-cell::before{display:none!important;content:none!important}
  .app-authenticated.page-payroll .payroll-list-card>.sales-pagination{margin-top:10px;background:#fff;border:1px solid #e8e4ef;border-radius:13px}
}

@media(max-width:430px){
  .app-authenticated.page-payroll .payroll-kpi-grid{gap:10px}
  .app-authenticated.page-payroll .payroll-kpi-grid .finance-kpi{padding:16px 14px}
  .app-authenticated.page-payroll .payroll-filter-bar{padding:12px}
  .app-authenticated.page-payroll .payroll-table tbody tr{padding:13px}
  .app-authenticated.page-payroll .payroll-table tbody td{grid-template-columns:104px minmax(0,1fr);gap:9px}
}

/* Phase 5.4.3 - Salary Advances modern responsive refinement */
.app-authenticated.page-salary-advances .advance-kpi-grid{
  gap:16px;
  margin-bottom:20px;
}
.app-authenticated.page-salary-advances .advance-record-card{
  padding:24px;
  border-radius:18px;
  border:1px solid #e7e2ef;
  box-shadow:0 14px 34px rgba(35,24,67,.055);
  margin-bottom:20px;
}
.app-authenticated.page-salary-advances .advance-record-card .section-title-row{
  margin-bottom:20px;
}
.app-authenticated.page-salary-advances .advance-record-card .section-title-row h3{
  margin-bottom:5px;
}
.app-authenticated.page-salary-advances .advance-form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px;
  margin-bottom:16px;
}
.app-authenticated.page-salary-advances .advance-record-card label{
  min-width:0;
  margin:0;
  font-weight:500;
  color:#3f3651;
}
.app-authenticated.page-salary-advances .advance-record-card :is(input,select,textarea){
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  border-color:#ddd6e8;
  background:#fff;
}
.app-authenticated.page-salary-advances .advance-record-card :is(input,select){
  min-height:44px;
}
.app-authenticated.page-salary-advances .advance-record-card textarea{
  min-height:112px;
  resize:vertical;
}
.app-authenticated.page-salary-advances .advance-record-card .notes-full{
  display:block;
  margin-top:2px;
  margin-bottom:14px;
}
.app-authenticated.page-salary-advances .advance-record-card > form > .btn{
  min-height:44px;
  padding-inline:18px;
  box-shadow:0 8px 18px rgba(255,94,35,.16);
}

/* Native hidden fields must stay hidden despite shared form/grid rules. */
.app-authenticated.page-salary-advances #advance_provider_wrap[hidden],
.app-authenticated.page-salary-advances #advance_other_wrap[hidden],
.app-authenticated.page-salary-advances #advance_ref_wrap[hidden]{
  display:none!important;
}

.app-authenticated.page-salary-advances .payroll-filter-bar{
  border-radius:16px;
  padding:16px 18px;
  gap:12px;
  box-shadow:0 10px 26px rgba(35,24,67,.045);
}
.app-authenticated.page-salary-advances .payroll-filter-bar :is(input,select){
  min-height:44px;
}
.app-authenticated.page-salary-advances .advance-list-card{
  border-radius:16px;
  border:1px solid #e7e2ef;
  box-shadow:0 12px 30px rgba(35,24,67,.045);
}
.app-authenticated.page-salary-advances .advance-list-card table th{
  background:#faf8fc;
  color:#777087;
  font-size:11px;
  letter-spacing:.04em;
}
.app-authenticated.page-salary-advances .advance-list-card table td{
  vertical-align:middle;
}

@media (max-width:1180px){
  .app-authenticated.page-salary-advances .advance-record-card{padding:22px}
  .app-authenticated.page-salary-advances .advance-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .app-authenticated.page-salary-advances .payroll-filter-bar{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(1),
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(2),
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(3){
    grid-column:auto;
  }
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(3){grid-column:1/-1}
  .app-authenticated.page-salary-advances .payroll-filter-bar>.btn,
  .app-authenticated.page-salary-advances .payroll-filter-bar>a.btn{
    width:100%;
    justify-content:center;
    text-align:center;
  }
}

@media (max-width:760px){
  .app-authenticated.page-salary-advances .page-heading{margin-bottom:16px}
  .app-authenticated.page-salary-advances .advance-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-bottom:18px;
  }
  .app-authenticated.page-salary-advances .advance-kpi-grid .finance-kpi{
    min-height:0;
    padding:18px 16px;
  }
  .app-authenticated.page-salary-advances .advance-record-card{
    padding:20px 16px;
    border-radius:16px;
  }
  .app-authenticated.page-salary-advances .advance-record-card .section-title-row{
    margin-bottom:18px;
  }
  .app-authenticated.page-salary-advances .advance-form-grid{
    grid-template-columns:1fr!important;
    gap:14px;
  }
  .app-authenticated.page-salary-advances .advance-record-card > form > .btn{
    width:100%;
    justify-content:center;
  }
  .app-authenticated.page-salary-advances .payroll-filter-bar{
    grid-template-columns:repeat(2,minmax(0,1fr));
    padding:14px 12px;
    gap:10px;
    border-radius:15px;
  }
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(1),
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(2),
  .app-authenticated.page-salary-advances .payroll-filter-bar label:nth-of-type(3){
    grid-column:1/-1;
  }
  .app-authenticated.page-salary-advances .payroll-filter-bar>.btn,
  .app-authenticated.page-salary-advances .payroll-filter-bar>a.btn{
    grid-column:auto;
    min-height:44px;
  }

  /* Salary advances become readable cards instead of a wide scrolling table. */
  .app-authenticated.page-salary-advances .advance-list-card{
    padding:0!important;
    overflow:visible;
    background:transparent;
    border:0;
    box-shadow:none;
  }
  .app-authenticated.page-salary-advances .advance-list-card .table-wrap{
    overflow:visible;
    background:transparent;
  }
  .app-authenticated.page-salary-advances .advance-list-card table,
  .app-authenticated.page-salary-advances .advance-list-card tbody{
    display:block;
    width:100%;
  }
  .app-authenticated.page-salary-advances .advance-list-card thead{display:none}
  .app-authenticated.page-salary-advances .advance-list-card tbody tr{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0;
    width:100%;
    margin-bottom:12px;
    background:#fff;
    border:1px solid #e7e2ef;
    border-radius:16px;
    box-shadow:0 10px 24px rgba(35,24,67,.045);
    overflow:hidden;
  }
  .app-authenticated.page-salary-advances .advance-list-card tbody td{
    display:block;
    min-width:0;
    padding:13px 14px;
    border:0;
    border-bottom:1px solid #f0edf4;
    color:#211a31;
    overflow-wrap:anywhere;
  }
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(odd){
    border-right:1px solid #f0edf4;
  }
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-last-child(-n+2){border-bottom:0}
  .app-authenticated.page-salary-advances .advance-list-card tbody td::before{
    display:block;
    margin-bottom:5px;
    color:#858095;
    font-size:10px;
    font-weight:800;
    letter-spacing:.05em;
    text-transform:uppercase;
  }
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(1)::before{content:'Date'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(2)::before{content:'Employee'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(3)::before{content:'Advance'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(4)::before{content:'Recovered'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(5)::before{content:'Outstanding'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(6)::before{content:'Method'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(7)::before{content:'Reference'}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(8)::before{content:'Status'}
  .app-authenticated.page-salary-advances .advance-list-card tbody tr:has(.empty-cell){display:block}
  .app-authenticated.page-salary-advances .advance-list-card tbody tr:has(.empty-cell) td{
    min-height:110px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    text-align:center;
  }
  .app-authenticated.page-salary-advances .advance-list-card tbody tr:has(.empty-cell) td::before{display:none}
}

@media (max-width:420px){
  .app-authenticated.page-salary-advances .advance-kpi-grid{gap:10px}
  .app-authenticated.page-salary-advances .advance-kpi-grid .finance-kpi{padding:16px 14px}
  .app-authenticated.page-salary-advances .advance-record-card{padding:18px 14px}
  .app-authenticated.page-salary-advances .advance-list-card tbody tr{grid-template-columns:1fr}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:nth-child(odd){border-right:0}
  .app-authenticated.page-salary-advances .advance-list-card tbody td{border-bottom:1px solid #f0edf4!important}
  .app-authenticated.page-salary-advances .advance-list-card tbody td:last-child{border-bottom:0!important}
}

/* Phase 5.4.4 - Operational Controls visual refinement */
.operational-kpi-grid{gap:16px;margin-bottom:20px}
.operational-kpi-grid .finance-kpi{min-height:122px;padding:20px 22px;border-radius:14px;box-shadow:0 8px 24px rgba(37,28,67,.045)}
.operational-kpi-grid .finance-kpi span{letter-spacing:.075em}
.operational-kpi-grid .finance-kpi strong{margin-top:8px;font-size:25px;line-height:1.05}
.operational-kpi-grid .finance-kpi small{margin-top:8px;line-height:1.45}
.operational-grid{gap:20px;margin-bottom:20px}
.operational-card{padding:24px!important;border-radius:15px;box-shadow:0 10px 28px rgba(37,28,67,.05)}
.operational-card .section-title-row{margin-bottom:22px}
.operational-card .section-title-row h3{font-size:17px}
.operational-card .section-title-row p{max-width:620px;margin-top:6px;line-height:1.65}
.operational-form{gap:16px}
.operational-form label{gap:7px}
.operational-form textarea{min-height:96px;resize:vertical}
.operational-form .btn{margin-top:2px;min-height:42px;padding-inline:18px}
.operational-grid .operational-card:nth-child(2){position:relative;overflow:hidden}
.operational-grid .operational-card:nth-child(2)::before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:linear-gradient(90deg,#8d57eb,#ff6f45)}
.operational-grid .operational-card:nth-child(2) form{margin-top:6px}
.operational-help{padding:13px 14px;border:1px solid #e7e0ef;border-radius:10px;background:#faf8fd;color:#746c80;font-size:12px}
.operational-help code,.comparison-info-note code{padding:2px 6px;border:1px solid #e1d9ed;border-radius:6px;background:#f7f4fb;color:#5f477d;font-size:.94em;white-space:normal;overflow-wrap:anywhere}
.cleanup-entry-card{padding:24px!important;border-radius:15px;box-shadow:0 8px 22px rgba(121,83,25,.045)}
.cleanup-entry-card .detail-label{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#fff3d7;color:#8b641b}
.cleanup-entry-card h3{font-size:17px}
.cleanup-entry-card .btn{flex:0 0 auto;min-width:132px}
.operational-table{overflow:hidden;padding:0!important;border-radius:15px;box-shadow:0 9px 26px rgba(37,28,67,.045)}
.operational-table>.section-title-row{margin:0;padding:20px 22px 17px;border-bottom:1px solid #eee9f4;background:linear-gradient(180deg,#fff 0%,#fdfcff 100%)}
.operational-table>.section-title-row h3{font-size:17px}
.operational-table>.section-title-row p{margin-top:5px;line-height:1.55}
.operational-table>.table-wrap{margin:0;border:0;border-radius:0;box-shadow:none}
.operational-table table{margin:0}
.operational-table thead th{padding-top:13px;padding-bottom:13px;background:#f8f6fb;color:#7d7489;font-size:9px;letter-spacing:.075em}
.operational-table tbody td{padding-top:14px;padding-bottom:14px;vertical-align:middle}
.operational-table tbody tr:last-child td{border-bottom:0}
.operational-table td small{display:block;margin-top:4px;color:#8a8393;font-size:10px;line-height:1.4}
.operational-table td strong{line-height:1.35;overflow-wrap:anywhere}
.operational-table td code{display:inline-block;max-width:150px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;padding:4px 7px;border:1px solid #e1d9ed;border-radius:7px;background:#f7f4fb;color:#645675;font-size:10px;white-space:nowrap}
.operational-table .btn-sm{min-height:32px;padding:7px 12px}
.comparison-info-note{margin-top:20px;padding:17px 19px;border-radius:12px;line-height:1.65;background:#fbf9fe}

@media(max-width:900px){
  .operational-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .operational-kpi-grid .finance-kpi:last-child{grid-column:1/-1}
  .operational-card{padding:21px!important}
  .cleanup-entry-card{align-items:flex-start}
}

@media(max-width:620px){
  .operational-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .operational-kpi-grid .finance-kpi:last-child{grid-column:auto}
  .operational-kpi-grid .finance-kpi{min-height:0;padding:17px 16px}
  .operational-kpi-grid .finance-kpi strong{font-size:21px}
  .operational-kpi-grid .finance-kpi small{font-size:10px}
  .operational-card{padding:19px!important;border-radius:13px}
  .operational-card .section-title-row{margin-bottom:18px}
  .operational-form textarea{min-height:88px}
  .operational-grid .operational-card:nth-child(2) form .btn{width:100%}
  .operational-help{margin-top:13px}
  .cleanup-entry-card{gap:16px;padding:19px!important}
  .cleanup-entry-card .btn{width:100%}
  .operational-table{border-radius:13px}
  .operational-table>.section-title-row{align-items:flex-start;padding:17px 16px 14px}
  .operational-table>.section-title-row .count-pill{flex:0 0 auto;margin-left:8px}
  .operational-table>.table-wrap{overflow:visible}
  .operational-table table,.operational-table tbody,.operational-table tr,.operational-table td{display:block;width:100%}
  .operational-table table{min-width:0!important}
  .operational-table thead{display:none}
  .operational-table tbody{padding:10px}
  .operational-table tbody tr{margin-bottom:10px;padding:12px 13px;border:1px solid #e9e3f0;border-radius:11px;background:#fff;box-shadow:0 3px 10px rgba(37,28,67,.025)}
  .operational-table tbody tr:last-child{margin-bottom:0}
  .operational-table tbody td{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:start;gap:10px;padding:7px 0!important;border:0!important;text-align:right;overflow-wrap:anywhere}
  .operational-table tbody td::before{align-self:start;color:#898191;font-size:9px;font-weight:900;letter-spacing:.065em;text-align:left;text-transform:uppercase}
  .operational-table tbody td>*{justify-self:end;max-width:100%}
  .operational-table tbody td small{justify-self:end;text-align:right}
  .operational-table tbody td code{max-width:170px}
  .operational-table tbody td .btn{width:auto}
  .operational-table tbody tr:has(.empty-cell){padding:18px}
  .operational-table tbody td.empty-cell{display:block;padding:10px!important;text-align:center}
  .operational-table tbody td.empty-cell::before{content:none}
  /* Accounting Period History column labels */
  .operational-period-history tbody td:nth-child(1)::before{content:"Period"}
  .operational-period-history tbody td:nth-child(2)::before{content:"Status"}
  .operational-period-history tbody td:nth-child(3)::before{content:"Reason"}
  .operational-period-history tbody td:nth-child(4)::before{content:"Locked By"}
  .operational-period-history tbody td:nth-child(5)::before{content:"Locked At"}
  .operational-period-history tbody td:nth-child(6)::before{content:"Unlock"}
  /* Backup History column labels */
  .operational-backup-history tbody td:nth-child(1)::before{content:"Created"}
  .operational-backup-history tbody td:nth-child(2)::before{content:"Backup"}
  .operational-backup-history tbody td:nth-child(3)::before{content:"Contents"}
  .operational-backup-history tbody td:nth-child(4)::before{content:"Size"}
  .operational-backup-history tbody td:nth-child(5)::before{content:"SHA-256"}
  .operational-backup-history tbody td:nth-child(6)::before{content:"Action"}
  .comparison-info-note{padding:15px 16px;font-size:11px}
}

@media(max-width:420px){
  .operational-kpi-grid{grid-template-columns:1fr}
  .operational-table tbody td{grid-template-columns:92px minmax(0,1fr)}
}
