:root{--brand:#2457d6;--ink:#17243a;--muted:#64748b;--line:#dce4ef;--surface:#fff;--bg:#f4f7fb}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 Inter,Segoe UI,Arial,sans-serif}a{color:var(--brand);text-decoration:none}a:hover{text-decoration:underline}header{background:#fff;border-bottom:1px solid var(--line)}.wrap{width:min(1160px,94%);margin:0 auto}.nav{min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:24px}.brand{display:flex;align-items:center;gap:11px;color:#14243c;font-size:22px;font-weight:800;letter-spacing:-.5px}.brand:hover{text-decoration:none}.brand-logo{max-width:140px;max-height:42px;object-fit:contain}.nav nav{display:flex;align-items:center;gap:18px;flex-wrap:wrap}.nav nav a{font-size:14px}.nav-user{font-size:12px;color:var(--muted)}main{padding:34px 0 76px;min-height:calc(100vh - 150px)}h1{font-size:30px;line-height:1.2;letter-spacing:-.8px;margin:5px 0 9px}h2{font-size:19px;letter-spacing:-.25px;margin:0 0 15px}.muted{color:var(--muted)}.small{font-size:13px}.eyebrow{font-size:11px;letter-spacing:1.2px;font-weight:800;color:var(--brand);margin-bottom:6px}.heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:22px}.heading p{margin:5px 0}.panel,.cards article{background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:23px;box-shadow:0 3px 14px rgba(30,51,80,.035)}.panel{margin:18px 0;overflow:hidden}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:14px;margin:22px 0}.cards article span{display:block;color:var(--muted);font-size:13px}.cards article strong{display:block;font-size:30px;line-height:1.2;margin-top:8px;letter-spacing:-.8px}.narrow{max-width:560px;margin:28px auto}.login-panel{margin-top:7vh}.login-panel h1{font-size:32px}.full{width:100%;margin-top:8px}label{display:block;margin:14px 0;font-size:13px;font-weight:650}input,textarea,select{display:block;width:100%;margin-top:6px;padding:11px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:var(--ink);font:inherit;min-height:44px}textarea{resize:vertical}input:focus,textarea:focus,select:focus{outline:3px solid color-mix(in srgb,var(--brand) 16%,transparent);border-color:var(--brand)}input[type=color]{height:48px;padding:5px}input[type=file]{padding:8px}.hint{display:block;font-size:12px;color:var(--muted);font-weight:400;margin-top:5px}button,.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:var(--brand);color:#fff;border:0;border-radius:9px;padding:11px 17px;font:inherit;font-weight:700;cursor:pointer;min-height:42px}button:hover,.button:hover{filter:brightness(.94);color:#fff;text-decoration:none}.text-link{font-size:14px;font-weight:600}.notice,.error{padding:13px 16px;border-radius:9px;margin-bottom:16px}.notice{background:#e7f7ed;color:#17613a;border:1px solid #c8ecd5}.error{background:#fff0eb;color:#9b351c;border:1px solid #f6d3c6}.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{text-align:left;padding:13px 11px;border-bottom:1px solid #edf0f5}th{font-size:12px;text-transform:uppercase;letter-spacing:.45px;color:var(--muted);font-weight:700}td{font-size:14px}tbody tr:last-child td{border-bottom:0}.status{display:inline-flex;padding:4px 9px;border-radius:30px;font-size:11px;font-weight:750;text-transform:capitalize}.status.active{background:#e8f7ee;color:#187044}.status.suspended{background:#fff0e9;color:#a33d20}.empty{text-align:center;color:var(--muted);padding:30px 12px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:10px}.section-head h2{margin:0}.form-panel{padding:27px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:35px}.form-actions{display:flex;align-items:center;gap:18px;border-top:1px solid #edf0f5;margin-top:22px;padding-top:20px}.info-box{background:#f5f8fc;border:1px solid #e4eaf2;border-radius:10px;padding:15px;margin-top:20px;font-size:13px}.info-box p{color:var(--muted);margin:6px 0 0}.logo-preview{display:block;max-width:170px;max-height:95px;object-fit:contain;padding:8px;border:1px solid var(--line);border-radius:8px;margin:8px 0 15px;background:#fff}.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:22px}.feature-grid>div{padding:16px;border:1px solid #e8edf4;border-radius:10px}.feature-grid p{color:var(--muted);font-size:13px;min-height:40px}.feature-grid a{font-size:13px;font-weight:700}.plan-cards article p{margin:7px 0;color:var(--muted);font-size:13px}footer{text-align:center;padding:28px 12px;color:#8490a2;font-size:12px;border-top:1px solid var(--line);background:#fff}@media(max-width:800px){.nav{align-items:flex-start;flex-direction:column;padding:14px 0}.nav nav{gap:12px}.heading{align-items:flex-start;flex-direction:column}.form-grid,.feature-grid{grid-template-columns:1fr}.form-grid{gap:12px}.form-panel{padding:18px}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:460px){.cards{grid-template-columns:1fr}h1{font-size:25px}}

/* Phase 2 invoice workflow */
.upload-form{display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap}.upload-form label{flex:1;min-width:260px;margin:0}.invoice-detail-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr);gap:18px;align-items:start}.invoice-detail-grid .panel{margin:0}.pdf-preview iframe{display:block;width:100%;height:690px;border:1px solid var(--line);border-radius:8px;background:#fff}.extracted-text{max-height:420px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.5 Consolas,monospace;background:#f7f9fc;padding:14px;border-radius:8px}.agent-steps{padding-left:22px}.agent-steps li{margin:9px 0}.retry-form{margin:0 0 16px}.retry-form button{background:#a33d20}@media(max-width:900px){.invoice-detail-grid{grid-template-columns:1fr}.pdf-preview iframe{height:520px}}@media(max-width:520px){.upload-form{display:block}.upload-form button{margin-top:10px;width:100%}}

/* Phase 3 — Dashboard and reminder center */
.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.dashboard-stats article{min-height:108px}
.dashboard-stats .stat-danger strong{color:#b42318}
.dashboard-stats .stat-warning strong{color:#a15c00}
.reminder-center{padding:25px}
.reminder-center>.muted{margin:8px 0 18px}
.reminder-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}
.reminder-panel{min-width:0;border:1px solid var(--line);border-radius:12px;padding:16px;background:#fff}
.reminder-panel h3{font-size:15px;margin:0;font-weight:800}
.reminder-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.reminder-count{display:inline-flex;align-items:center;justify-content:center;min-width:27px;height:27px;padding:0 8px;border-radius:30px;background:#edf2f8;color:#24364f;font-size:12px;font-weight:800}
.reminder-overdue{border-left:4px solid #c24136}
.reminder-overdue .reminder-count{background:#fff0ed;color:#a62e24}
.reminder-today{border-left:4px solid #c47a16}
.reminder-today .reminder-count{background:#fff5e5;color:#8c5100}
.reminder-upcoming{border-left:4px solid #3268cf}
.reminder-upcoming .reminder-count{background:#edf3ff;color:#234fa8}
.reminder-missing{border-left:4px solid #8b6a20}
.reminder-missing .reminder-count{background:#f8f2e4;color:#735314}
.reminder-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-top:1px solid #edf0f5}
.reminder-main{min-width:0}
.reminder-main a{display:flex;flex-direction:column;min-width:0;gap:2px;color:var(--ink)}
.reminder-main strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reminder-main span{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reminder-meta{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap;text-align:right}
.reminder-meta strong{font-size:12px;color:var(--ink)}
.reminder-meta span{font-size:12px;color:var(--muted)}
.reminder-empty{font-size:13px;color:var(--muted);padding:12px 0 4px;margin:0}
.attention-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.attention-card{border:1px solid var(--line);border-radius:11px;padding:16px;min-width:0}
.attention-failed{border-left:4px solid #c24136}
.attention-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.attention-heading strong{font-size:14px}
.attention-heading span{font-size:12px;font-weight:800;color:var(--muted)}
.attention-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #edf0f5;font-size:13px}
.attention-row>a:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attention-action{font-size:12px;font-weight:750;white-space:nowrap;color:#a33d20}
@media(max-width:900px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.reminder-grid,.attention-grid{grid-template-columns:1fr}}
@media(max-width:460px){.dashboard-stats{grid-template-columns:1fr}.reminder-center{padding:17px}.reminder-item{align-items:flex-start}.reminder-meta{max-width:42%;white-space:normal}}
.reminder-review-tag{font-size:10px;font-weight:750;color:#8a5700;background:#fff5df;border-radius:20px;padding:2px 6px}
.dashboard-retry-form{margin:0;flex:0 0 auto}
.dashboard-retry-form button{min-height:30px;padding:6px 9px;font-size:11px;background:#a33d20}


/* Phase 3.1 — payment terms, duplicate warnings and cache refresh */
.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.dashboard-stats .stat-terms strong{color:#0f766e}
.dashboard-stats .stat-terms{border-top:3px solid #0f766e}
.reminder-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.reminder-terms{border-left:4px solid #0f766e}
.reminder-terms .reminder-count{background:#e8f7f4;color:#0f766e}
.attention-grid{grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}
.attention-duplicate{border-left:4px solid #8b6a20}
.duplicate-row{align-items:flex-start}
.duplicate-row>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.duplicate-row strong{font-size:12px;overflow-wrap:anywhere}
.duplicate-row small{font-size:11px;color:var(--muted)}
.duplicate-notice{padding:14px 16px;margin:0 0 18px;border:1px solid #f0d6a7;border-left:4px solid #b7791f;border-radius:10px;background:#fff9eb;color:#704b13;font-size:13px;line-height:1.6}
.duplicate-links{margin-top:5px;font-weight:700}
.duplicate-links a{margin-right:6px}
@media(max-width:1100px){.reminder-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.reminder-grid{grid-template-columns:1fr}}
@media(max-width:460px){.dashboard-stats{grid-template-columns:1fr}}

/* InvoiceLog 2.3.0 — Modern SaaS UI system */
:root{
  --ink:#14243b;
  --muted:#66758b;
  --line:#e3e9f2;
  --surface:#ffffff;
  --bg:#f5f7fb;
  --brand-soft:color-mix(in srgb,var(--brand) 9%,#fff);
  --brand-border:color-mix(in srgb,var(--brand) 22%,#fff);
  --shadow-sm:0 2px 8px rgba(20,36,59,.035);
  --shadow-md:0 10px 28px rgba(20,36,59,.065);
  --radius-lg:18px;
  --radius-md:13px;
}
html{scroll-behavior:smooth;scroll-padding-top:100px}
body{background:var(--bg);color:var(--ink);font-family:Inter,"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,Arial,sans-serif;font-size:15px;line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:var(--brand);transition:color .16s ease,background .16s ease,border-color .16s ease}
a:hover{color:color-mix(in srgb,var(--brand) 78%,#14243b);text-decoration:none}
.app-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.94);border-bottom:1px solid rgba(220,228,239,.9);box-shadow:0 3px 18px rgba(20,36,59,.035);backdrop-filter:blur(14px)}
.wrap{width:min(1360px,calc(100% - 56px));margin-inline:auto}
.nav{min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:28px;padding:10px 0}
.brand{display:flex;align-items:center;gap:12px;min-width:0;color:#14243b;font-size:21px;font-weight:800;letter-spacing:-.65px;white-space:nowrap}
.brand:hover{color:#14243b}
.brand-logo{max-width:150px;max-height:44px;object-fit:contain;border-radius:7px}
.primary-nav{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap}
.primary-nav a{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 11px;border-radius:9px;color:#53637a;font-size:13px;font-weight:650;white-space:nowrap}
.primary-nav a:hover,.primary-nav a.is-active{background:var(--brand-soft);color:var(--brand)}
.primary-nav a.nav-upload{padding-inline:14px;background:var(--brand);color:#fff;box-shadow:0 4px 10px color-mix(in srgb,var(--brand) 20%,transparent)}
.primary-nav a.nav-upload:hover{filter:brightness(.96);color:#fff}
.nav-user{display:inline-flex;align-items:center;min-height:34px;margin-right:5px;padding:6px 10px;border:1px solid var(--line);border-radius:999px;background:#f8fafc;color:#65748a;font-size:12px;font-weight:650;white-space:nowrap}
.app-main{min-height:calc(100vh - 150px);padding-top:36px;padding-bottom:84px}
h1{margin:3px 0 8px;color:#14243b;font-size:clamp(27px,3vw,35px);font-weight:800;line-height:1.17;letter-spacing:-1.15px}
h2{margin:0 0 15px;color:#1b2b43;font-size:19px;font-weight:780;line-height:1.35;letter-spacing:-.4px}
h3{color:#23334a}
p{margin-top:0}
.muted{color:var(--muted)}
.small{font-size:13px}
.eyebrow{margin-bottom:7px;color:var(--brand);font-size:10px;font-weight:850;letter-spacing:1.45px;line-height:1.4}
.heading{align-items:center;margin-bottom:25px;gap:22px}
.heading p{margin:7px 0 0;font-size:14px}
.panel,.cards article{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-sm)}
.panel{margin:18px 0;padding:25px;overflow:hidden}
.panel:hover{box-shadow:var(--shadow-md)}
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin:22px 0}
.cards article{position:relative;min-width:0;min-height:112px;padding:19px 20px;overflow:hidden;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.cards article:hover{transform:translateY(-2px);border-color:var(--brand-border);box-shadow:var(--shadow-md)}
.cards article span{color:#718096;font-size:12px;font-weight:600;line-height:1.45}
.cards article strong{margin-top:10px;color:#172840;font-size:31px;font-weight:800;line-height:1.1;letter-spacing:-1px;font-variant-numeric:tabular-nums}
.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.dashboard-stats article{min-height:105px}
.dashboard-stats article:before{position:absolute;top:0;left:0;width:100%;height:3px;background:color-mix(in srgb,var(--brand) 72%,#fff);content:""}
.dashboard-stats .stat-danger:before{background:#dc6259}
.dashboard-stats .stat-warning:before{background:#d89a36}
.dashboard-stats .stat-terms:before{background:#159b8a}
.dashboard-stats .stat-danger strong{color:#bd3934}
.dashboard-stats .stat-warning strong{color:#a96812}
.dashboard-stats .stat-terms strong{color:#087f73}
.narrow{max-width:590px;margin:36px auto}
.login-panel{margin-top:7vh;padding:34px}
.login-panel h1{font-size:34px}
label{display:block;margin:16px 0;color:#26364d;font-size:13px;font-weight:700}
input,textarea,select{width:100%;min-height:47px;margin-top:7px;padding:11px 13px;border:1px solid #d5deea;border-radius:10px;background:#fff;color:#1b2b43;font:inherit;font-size:14px;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}
textarea{min-height:100px;resize:vertical}
input::placeholder,textarea::placeholder{color:#9aa6b6}
input:hover,textarea:hover,select:hover{border-color:#b9c7d8}
input:focus,textarea:focus,select:focus{outline:0;border-color:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 12%,transparent)}
input[type=color]{height:49px;padding:5px}
input[type=file]{padding:7px;background:#fbfcfe}
input[type=file]::file-selector-button{margin-right:12px;padding:8px 12px;border:1px solid #dce4ef;border-radius:7px;background:#f0f4f9;color:#31435c;font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.hint{display:block;margin-top:6px;color:#8290a3;font-size:12px;font-weight:450}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:11px 17px;border:1px solid transparent;border-radius:10px;background:var(--brand);color:#fff;font:inherit;font-size:13px;font-weight:750;letter-spacing:.05px;cursor:pointer;box-shadow:0 3px 8px color-mix(in srgb,var(--brand) 15%,transparent);transition:transform .15s ease,filter .15s ease,box-shadow .15s ease}
button:hover,.button:hover{transform:translateY(-1px);filter:brightness(.97);box-shadow:0 6px 14px color-mix(in srgb,var(--brand) 18%,transparent);color:#fff;text-decoration:none}
button:active,.button:active{transform:translateY(0)}
button:focus-visible,.button:focus-visible,a:focus-visible{outline:3px solid color-mix(in srgb,var(--brand) 35%,transparent);outline-offset:2px}
.button-secondary{border:1px solid #dbe3ee;background:#fff;color:#34445c;box-shadow:none}
.button-secondary:hover{border-color:var(--brand-border);background:var(--brand-soft);color:var(--brand);box-shadow:none}
.text-link{font-size:13px;font-weight:700}
.notice,.error{margin-bottom:17px;padding:14px 17px;border-radius:12px;font-size:13px;font-weight:550}
.notice{border:1px solid #c9ead6;background:#effaf3;color:#17633d}
.error{border:1px solid #f3d0ca;background:#fff4f1;color:#a43e2f}
.info-box{margin-top:18px;padding:17px 18px;border:1px solid #dce7f4;border-radius:13px;background:#f7faff;font-size:13px}
.info-box p{margin:5px 0 0;color:var(--muted)}
.table-scroll{overflow-x:auto;border:1px solid #edf1f6;border-radius:11px}
table{width:100%;border-collapse:separate;border-spacing:0;white-space:nowrap}
th,td{padding:14px 14px;border-bottom:1px solid #edf1f6;text-align:left}
th{background:#f8fafc;color:#718096;font-size:10px;font-weight:800;letter-spacing:.7px;text-transform:uppercase}
td{background:#fff;color:#34445a;font-size:13px}
tbody tr{transition:background .14s ease}
tbody tr:hover td{background:#f8faff}
tbody tr:last-child td{border-bottom:0}
td a{font-weight:650}
.status{display:inline-flex;align-items:center;gap:5px;min-height:24px;padding:4px 9px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.1px;text-transform:capitalize}
.status.active{background:#e8f7ee;color:#187044}
.status.suspended{background:#fff0eb;color:#a33d20}
.empty{text-align:center;color:#8794a6;padding:35px 14px!important}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:15px}
.section-head h2{margin:0}
.section-head>a{font-size:12px;font-weight:700;white-space:nowrap}
.form-panel{padding:30px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:38px}
.form-actions{display:flex;align-items:center;gap:14px;margin-top:25px;padding-top:22px;border-top:1px solid #edf1f6}
.logo-preview{max-width:175px;max-height:100px;margin:10px 0 16px;padding:9px;border:1px solid var(--line);border-radius:11px;background:#fff;object-fit:contain}
.feature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:20px}
.feature-grid>div{min-width:0;padding:19px;border:1px solid #e6ecf4;border-radius:13px;background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%);transition:border-color .15s ease,transform .15s ease}
.feature-grid>div:hover{transform:translateY(-2px);border-color:var(--brand-border)}
.feature-grid>div strong{font-size:14px;font-weight:750}
.feature-grid p{min-height:42px;margin:8px 0 13px;color:var(--muted);font-size:12px;line-height:1.6}
.feature-grid a{font-size:12px;font-weight:800}
.plan-cards article p{margin:8px 0;color:var(--muted);font-size:13px}
footer{padding:27px 14px;border-top:1px solid var(--line);background:#fff;color:#8a97a9;font-size:11px;text-align:center}

/* Dashboard modules */
.reminder-center{padding:25px}
.reminder-center>.muted{margin:7px 0 17px;font-size:12px}
.reminder-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:17px}
.reminder-panel{min-width:0;padding:17px;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 1px 3px rgba(20,36,59,.025)}
.reminder-panel h3{margin:0;font-size:14px;font-weight:800}
.reminder-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.reminder-count{display:inline-flex;align-items:center;justify-content:center;min-width:27px;height:27px;padding:0 8px;border-radius:999px;background:#edf2f8;color:#34445c;font-size:11px;font-weight:850;font-variant-numeric:tabular-nums}
.reminder-overdue{border-left:3px solid #dc6259}
.reminder-overdue .reminder-count{background:#fff0ed;color:#a62e24}
.reminder-today{border-left:3px solid #d89a36}
.reminder-today .reminder-count{background:#fff5e5;color:#8c5100}
.reminder-upcoming{border-left:3px solid #4e7ee0}
.reminder-upcoming .reminder-count{background:#edf3ff;color:#234fa8}
.reminder-terms{border-left:3px solid #159b8a}
.reminder-terms .reminder-count{background:#e8f7f4;color:#0f766e}
.reminder-missing{border-left:3px solid #ad8732}
.reminder-missing .reminder-count{background:#f8f2e4;color:#735314}
.reminder-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid #eff2f6}
.reminder-main{min-width:0}
.reminder-main a{display:flex;flex-direction:column;min-width:0;gap:3px;color:var(--ink)}
.reminder-main strong{overflow:hidden;color:#25364d;font-size:12px;text-overflow:ellipsis;white-space:nowrap}
.reminder-main span{overflow:hidden;color:#8491a3;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.reminder-meta{display:flex;flex-direction:column;align-items:flex-end;gap:3px;text-align:right;white-space:nowrap}
.reminder-meta strong{color:#34445c;font-size:11px}
.reminder-meta span{color:#8794a6;font-size:11px}
.reminder-empty{margin:0;padding:13px 0 4px;color:#8491a3;font-size:12px}
.attention-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.attention-card{min-width:0;padding:17px;border:1px solid var(--line);border-radius:13px;background:#fff}
.attention-failed{border-left:3px solid #dc6259}
.attention-duplicate{border-left:3px solid #ad8732}
.attention-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.attention-heading strong{font-size:13px;font-weight:800}
.attention-heading span{color:#748399;font-size:11px;font-weight:800}
.attention-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #eff2f6;font-size:12px}
.attention-row>a:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attention-action{color:#a33d20;font-size:11px;font-weight:800;white-space:nowrap}
.duplicate-row{align-items:flex-start}
.duplicate-row>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.duplicate-row strong{overflow-wrap:anywhere;font-size:12px}
.duplicate-row small{color:var(--muted);font-size:11px}
.duplicate-notice{margin:0 0 18px;padding:15px 17px;border:1px solid #f0d6a7;border-left:4px solid #b7791f;border-radius:12px;background:#fff9eb;color:#704b13;font-size:13px;line-height:1.65}
.duplicate-links{margin-top:5px;font-weight:750}
.duplicate-links a{margin-right:6px}
.reminder-review-tag{padding:3px 7px;border-radius:999px;background:#fff5df;color:#8a5700;font-size:10px;font-weight:750}
.dashboard-retry-form{flex:0 0 auto;margin:0}
.dashboard-retry-form button{min-height:31px;padding:6px 10px;border-radius:8px;background:#a33d20;font-size:11px;box-shadow:none}

/* Invoice upload and review */
.upload-form{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.upload-form label{flex:1;min-width:260px;margin:0}
.upload-form button{min-height:47px;white-space:nowrap}
.invoice-detail-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);align-items:start;gap:20px}
.invoice-detail-grid .panel{margin:0;padding:24px}
.pdf-preview iframe{display:block;width:100%;height:760px;border:1px solid #e2e8f0;border-radius:11px;background:#f8fafc}
.extracted-text{max-height:440px;overflow:auto;padding:17px;border:1px solid #edf1f6;border-radius:11px;background:#f8fafc;color:#35445a;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.65 "SFMono-Regular",Consolas,monospace}
details summary{padding:4px 0;color:#34445c;cursor:pointer;font-size:13px}
details[open] summary{margin-bottom:14px}
.agent-steps{padding-left:23px}
.agent-steps li{margin:10px 0;color:#526278}
.retry-form{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 17px}
.retry-form .hint{margin:0}

@media(max-width:1100px){
  .wrap{width:min(100% - 40px,1360px)}
  .nav{align-items:flex-start;flex-direction:column;gap:10px;padding:14px 0}
  .primary-nav{justify-content:flex-start}
  .dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .reminder-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .invoice-detail-grid{grid-template-columns:minmax(0,1fr) minmax(320px,.95fr)}
}
@media(max-width:820px){
  .app-main{padding-top:27px}
  .heading{align-items:flex-start;flex-direction:column}
  .form-grid{grid-template-columns:1fr;gap:12px}
  .feature-grid,.attention-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .invoice-detail-grid{grid-template-columns:1fr}
  .pdf-preview iframe{height:620px}
  .dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .wrap{width:calc(100% - 28px)}
  .nav{min-height:0}
  .brand{font-size:18px}
  .brand-logo{max-width:110px;max-height:38px}
  .primary-nav{gap:3px}
  .primary-nav a{min-height:34px;padding:7px 9px;font-size:11px}
  .nav-user{font-size:11px}
  .app-main{padding-top:22px;padding-bottom:55px}
  h1{font-size:27px}
  h2{font-size:17px}
  .panel{margin:14px 0;padding:18px;border-radius:15px}
  .cards,.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .cards article{min-height:95px;padding:15px}
  .cards article strong{font-size:26px}
  .reminder-center{padding:18px}
  .reminder-grid,.attention-grid,.feature-grid{grid-template-columns:1fr}
  .section-head{align-items:flex-start}
  .section-head>a{font-size:11px}
  .form-panel{padding:19px}
  .form-actions{align-items:flex-start;flex-direction:column}
  .upload-form{display:block}
  .upload-form button{width:100%;margin-top:12px}
  .invoice-detail-grid .panel{padding:17px}
  .pdf-preview iframe{height:520px}
  .login-panel{padding:23px}
  .login-panel h1{font-size:29px}
  .table-scroll{border-radius:9px}
  th,td{padding:11px 10px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}


/* Phase 5.1 — Focused dashboard: fewer panels, one prioritized work queue. */
.dashboard-heading{margin-bottom:18px}
.dashboard-heading h1{font-size:32px;letter-spacing:-1.1px}
.dashboard-heading .muted{font-size:13px}
.dashboard-upload{box-shadow:0 5px 14px rgba(18,94,48,.14)}
.dashboard-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin:18px 0 20px}
.dashboard-summary article{position:relative;min-height:94px;padding:17px 19px;border-radius:13px;box-shadow:0 2px 9px rgba(30,51,80,.035)}
.dashboard-summary article:before{display:none!important}
.dashboard-summary article span{font-size:12px;color:#718096}
.dashboard-summary article strong{font-size:27px;margin-top:6px;color:#17243a}
.dashboard-summary .stat-danger strong{color:#c43e36}
.dashboard-summary .stat-warning strong{color:#a96812}
.dashboard-queue-panel,.dashboard-recent-panel{padding:23px 24px;margin:18px 0}
.dashboard-queue-panel .section-head,.dashboard-recent-panel .section-head{align-items:center;margin-bottom:17px}
.dashboard-queue-panel .section-head h2,.dashboard-recent-panel .section-head h2{margin:0;font-size:19px}
.dashboard-queue-panel .section-head p,.dashboard-recent-panel .section-head p{margin:4px 0 0}
.dashboard-queue-panel .section-head>a,.dashboard-recent-panel .section-head>a{font-size:12px;font-weight:750}
.dashboard-queue-table{border:0;border-radius:0;overflow-x:auto}
.dashboard-queue-table table{white-space:normal}
.dashboard-queue-table th{background:#f8fafc;padding:12px 13px;font-size:10px}
.dashboard-queue-table td{padding:14px 13px;font-size:12px;vertical-align:middle}
.dashboard-queue-table td:first-child{min-width:190px}
.dashboard-queue-table td:nth-child(2){min-width:135px}
.dashboard-queue-table td:nth-child(3){min-width:130px}
.dashboard-queue-table td:nth-child(4),.dashboard-queue-table td:nth-child(5){white-space:nowrap}
.dashboard-action-tags{display:flex;flex-wrap:wrap;gap:5px}
.dashboard-action-tag{display:inline-flex;align-items:center;min-height:22px;padding:3px 8px;border-radius:999px;background:#eef2f7;color:#4b5d73;font-size:10px;font-weight:750;white-space:nowrap}
.dashboard-action-tag.overdue,.dashboard-action-tag.extraction-failed{background:#fff0ed;color:#b13c31}
.dashboard-action-tag.needs-review,.dashboard-action-tag.missing-due-date{background:#fff6e7;color:#94600c}
.dashboard-action-tag.due-today{background:#fff3e2;color:#a45d08}
.dashboard-action-tag.due-soon{background:#edf3ff;color:#315eb3}
.dashboard-action-tag.payment-terms{background:#eaf7f4;color:#147768}
.dashboard-duplicate-note{display:flex;align-items:center;flex-wrap:wrap;gap:8px 13px;margin:0 0 14px;padding:11px 13px;border:1px solid #f0dfb9;border-left:3px solid #b7791f;border-radius:9px;background:#fffbf2;color:#76551b;font-size:11px}
.dashboard-duplicate-note>strong{font-size:12px;color:#6b4c16}
.dashboard-duplicate-note>span{color:#8b6b31}
.dashboard-duplicate-note .duplicate-summary-item{padding-left:11px;border-left:1px solid #ead8b0}
.dashboard-duplicate-note a{font-weight:800;color:#805914}
.dashboard-state{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#eef2f7;color:#536277;font-size:10px;font-weight:750;text-transform:capitalize}
.dashboard-state.is-verified{background:#e8f7ee;color:#187044}
.dashboard-state.is-pending{background:#fff5e5;color:#8c5b0a}
.dashboard-recent-panel .table-scroll{border:0;border-radius:0}
.dashboard-recent-panel table{white-space:normal}
.dashboard-recent-panel th{padding:12px 13px}
.dashboard-recent-panel td{padding:13px;font-size:12px}
.dashboard-recent-panel td:first-child{min-width:190px}
@media(max-width:900px){
  .dashboard-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-queue-panel,.dashboard-recent-panel{padding:19px}
}
@media(max-width:560px){
  .dashboard-heading{align-items:flex-start}
  .dashboard-heading .dashboard-upload{width:100%}
  .dashboard-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .dashboard-summary article{min-height:82px;padding:14px}
  .dashboard-summary article strong{font-size:24px}
  .dashboard-queue-panel,.dashboard-recent-panel{padding:16px}
  .dashboard-queue-panel .section-head,.dashboard-recent-panel .section-head{align-items:flex-start;flex-direction:column}
  .dashboard-duplicate-note{align-items:flex-start;flex-direction:column}
  .dashboard-duplicate-note .duplicate-summary-item{padding-left:0;border-left:0}
}

/* Phase 5.2 — Focused invoice review workspace. */
.invoice-review-layout{grid-template-columns:minmax(0,1.04fr) minmax(390px,.96fr);gap:20px;align-items:stretch}
.invoice-review-layout .panel{padding:24px;border-radius:16px}
.invoice-document-panel .section-head{align-items:center;margin-bottom:14px}
.invoice-document-panel .section-head h2{margin:0 0 3px}
.invoice-document-panel .section-head p{margin:0}
.invoice-document-panel .button-secondary{display:inline-flex;align-items:center;justify-content:center;min-height:37px;padding:8px 12px;border:1px solid #dce5ef;border-radius:9px;background:#fff;color:#29415e;font-size:12px;font-weight:750;white-space:nowrap}
.invoice-document-panel .button-secondary:hover{background:#f5f8fc;text-decoration:none}
.invoice-document-panel .pdf-preview iframe,.invoice-document-panel iframe{height:760px;border:1px solid #e3eaf2;border-radius:11px;background:#f8fafc}
.invoice-review-panel{background:#fff}
.review-panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid #edf1f6}
.review-panel-heading .eyebrow{font-size:10px;margin-bottom:4px}
.review-panel-heading h2{margin:0 0 4px;font-size:20px}
.review-panel-heading p{margin:0}
.review-state{display:inline-flex;align-items:center;min-height:27px;padding:5px 10px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.review-state.is-verified{background:#e8f7ee;color:#187044}
.review-state.is-pending{background:#fff5e5;color:#8c5b0a}
.review-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px;row-gap:0}
.review-fields-grid label{min-width:0;margin:0 0 14px;font-size:12px;font-weight:750;color:#35445a}
.review-fields-grid input{min-width:0;margin-top:6px;min-height:43px;padding:10px 11px;border-color:#d5deea;border-radius:9px;background:#fbfcfe;font-size:13px;font-weight:600}
.review-fields-grid input:focus{background:#fff}
.review-fields-grid input:disabled{background:#f5f7fa;color:#64748b;opacity:1}
.review-field-wide{grid-column:1/-1}
.review-terms-note{display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px;margin:0 0 16px;padding:11px 13px;border:1px solid #dcebe7;border-radius:10px;background:#f3faf8;color:#41655f;font-size:11px}
.review-terms-note span{font-weight:650}
.review-terms-note strong{color:#126b5e;font-size:12px}
.review-terms-note small{width:100%;color:#6b817d;font-size:10px}
.review-form-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding-top:15px;border-top:1px solid #edf1f6}
.review-form-actions button{min-height:45px;padding:11px 17px;background:#075b26;box-shadow:0 3px 8px rgba(7,91,38,.12)}
.review-form-actions .small{font-size:11px}
.review-readonly-note{margin:0 0 15px;padding:10px 12px;border-radius:9px;background:#f5f8fc;color:#586b82;font-size:12px}
@media(max-width:1050px){
  .invoice-review-layout{grid-template-columns:minmax(0,1fr) minmax(360px,.95fr)}
  .invoice-review-layout .panel{padding:19px}
  .invoice-document-panel iframe{height:690px}
}
@media(max-width:850px){
  .invoice-review-layout{grid-template-columns:1fr}
  .invoice-document-panel iframe{height:650px}
}
@media(max-width:560px){
  .invoice-review-layout .panel{padding:16px}
  .invoice-document-panel iframe{height:520px}
  .review-panel-heading{flex-direction:column;align-items:flex-start}
  .review-fields-grid{grid-template-columns:1fr}
  .review-field-wide{grid-column:auto}
  .review-form-actions{align-items:flex-start;flex-direction:column}
  .review-form-actions button{width:100%}
}

/* Phase 5.3 — focused invoice register: search-first, compact workflow table. */
.invoice-register-heading{margin-bottom:17px}
.invoice-register-heading h1{font-size:32px;letter-spacing:-1px}
.invoice-register-upload-link{min-width:150px;box-shadow:0 5px 14px rgba(18,94,48,.13)}
.invoice-upload-panel{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 18px;padding:18px 21px;border:1px solid #dce7df;border-radius:14px;background:linear-gradient(105deg,#f7fbf8 0%,#fff 72%)}
.invoice-upload-copy{display:flex;align-items:center;gap:13px;min-width:220px}
.invoice-upload-copy h2{margin:0 0 3px;font-size:16px}
.invoice-upload-copy p{margin:0;color:#6b7788;font-size:12px}
.upload-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border-radius:12px;background:#e7f3eb;color:#176b3c;font-size:25px;font-weight:500}
.invoice-upload-form{display:flex;align-items:center;justify-content:flex-end;gap:13px;flex:1;min-width:0}
.invoice-file-control{display:flex;align-items:center;gap:10px;min-width:0;margin:0;color:#34465c;font-size:12px;font-weight:700}
.invoice-file-control input[type=file]{width:min(310px,34vw);min-width:180px;min-height:38px;margin:0;padding:5px 7px;border:1px solid #dce4ed;border-radius:8px;background:#fff;font-size:11px}
.file-control-label{white-space:nowrap}
.file-control-hint{color:#8390a0;font-size:10px;font-weight:500;white-space:nowrap}
.invoice-upload-form button{min-height:40px;padding:9px 15px;white-space:nowrap;background:#176b3c}
.invoice-register-panel{padding:22px 23px 15px}
.invoice-register-titlebar{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:17px}
.invoice-register-titlebar h2{margin:0 0 3px;font-size:19px}
.invoice-register-titlebar p{margin:0}
.register-summary{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:7px 14px;color:#778397;font-size:11px}
.register-summary span{white-space:nowrap}
.register-summary strong{color:#24364d;font-size:13px}
.register-summary .summary-duplicate,.register-summary .summary-duplicate strong{color:#a15d13}
.invoice-register-toolbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0 0 14px;padding:12px;border:1px solid #e9eef4;border-radius:11px;background:#fafbfd}
.register-search{position:relative;display:block;flex:1 1 260px;min-width:210px;margin:0}
.register-search .search-symbol{position:absolute;left:12px;top:8px;color:#8391a3;font-size:22px;line-height:1;pointer-events:none}
.register-search input{height:38px;min-height:38px;margin:0;padding:8px 12px 8px 36px;border-color:#dfe6ee;border-radius:8px;background:#fff;font-size:12px}
.register-filter{margin:0;min-width:145px}
.register-filter select{height:38px;min-height:38px;margin:0;padding:7px 28px 7px 10px;border-color:#dfe6ee;border-radius:8px;background:#fff;font-size:11px;color:#43546a}
.register-reset{min-height:36px;padding:7px 10px;border:1px solid #dce4ed;background:#fff;color:#5a687a;font-size:11px;font-weight:700}
.register-reset:hover{background:#f2f5f8;color:#25364b}
.invoice-register-table-wrap{border-top:1px solid #edf1f5}
.invoice-register-table-scroll{overflow-x:auto}
.invoice-register-table{white-space:normal;min-width:850px}
.invoice-register-table th{padding:12px 12px;background:#fbfcfd;color:#7a8797;font-size:10px;letter-spacing:.65px}
.invoice-register-table td{padding:13px 12px;vertical-align:middle;font-size:12px}
.invoice-register-table tbody tr{transition:background .15s ease}
.invoice-register-table tbody tr:hover{background:#fbfdfb}
.invoice-register-table tbody tr[hidden]{display:none}
.register-invoice-cell{min-width:175px}
.register-invoice-link{display:block;color:#1d3d62;font-size:12px;font-weight:800}
.register-file-name{display:block;max-width:220px;margin-top:3px;overflow:hidden;color:#8490a0;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.register-duplicate-flag{display:inline-flex;margin-top:5px;padding:3px 7px;border-radius:5px;background:#fff5e8;color:#9a5a12;font-size:9px;font-weight:800}
.register-supplier-cell{min-width:140px;max-width:220px;color:#34445a;font-weight:650}
.register-due{display:inline-block;color:#485a70;font-size:11px;white-space:nowrap}
.register-due.overdue{color:#b83c35;font-weight:800}
.register-due.due-today{color:#a45f0a;font-weight:800}
.register-due.due-soon{color:#315da8;font-weight:750}
.register-due.payment-terms{color:#147768;font-weight:750}
.register-due.missing{color:#9a6b26}
.register-amount{color:#263950;font-weight:750;white-space:nowrap}
.register-status{display:inline-flex;align-items:center;min-height:23px;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:750;white-space:nowrap}
.register-status.extraction-ready{background:#edf6f0;color:#277247}
.register-status.extraction-needs_review{background:#fff5e5;color:#94600c}
.register-status.extraction-queued,.register-status.extraction-processing{background:#edf3ff;color:#365e9e}
.register-status.extraction-failed{background:#fff0ed;color:#b13c31}
.register-status.review-verified{background:#e8f7ee;color:#187044}
.register-status.review-pending{background:#fff5e5;color:#8c5b0a}
.register-open-link{display:inline-flex;align-items:center;justify-content:center;padding:6px 9px;border:1px solid #e0e7ef;border-radius:7px;color:#315a83;font-size:10px;font-weight:800;white-space:nowrap}
.register-open-link:hover{border-color:#b9c9dc;background:#f6f9fc;text-decoration:none}
.register-no-results{padding:24px 12px;text-align:center;color:#7b8796;font-size:12px}
.register-no-results[hidden]{display:none}
.register-table-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 2px 0;color:#8a95a3;font-size:10px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:900px){
  .invoice-upload-panel{align-items:flex-start;flex-direction:column;gap:13px}
  .invoice-upload-form{width:100%;justify-content:flex-start}
  .invoice-file-control{flex:1}
  .invoice-file-control input[type=file]{width:100%;min-width:120px}
  .invoice-register-titlebar{flex-direction:column}
  .register-summary{justify-content:flex-start}
}
@media(max-width:620px){
  .invoice-register-heading{align-items:flex-start}
  .invoice-register-upload-link{width:100%}
  .invoice-upload-panel{padding:16px}
  .invoice-upload-form{align-items:stretch;flex-direction:column}
  .invoice-file-control{align-items:flex-start;flex-direction:column;gap:6px}
  .invoice-file-control input[type=file]{width:100%}
  .invoice-upload-form button{width:100%}
  .invoice-register-panel{padding:16px}
  .invoice-register-toolbar{align-items:stretch;flex-direction:column}
  .register-search,.register-filter{width:100%;min-width:0;flex:auto}
  .register-filter select{width:100%}
  .register-reset{width:100%}
  .register-table-footer{align-items:flex-start;flex-direction:column}
}


/* Phase 5D — compact user access and permissions management. */
.users-page-heading{align-items:center;margin-bottom:18px}
.users-page-heading h1{font-size:32px;letter-spacing:-.9px}
.users-seat-summary{min-width:148px;padding:12px 16px;border:1px solid #e3e9e5;border-radius:11px;background:#fbfdfb;text-align:right}
.users-seat-summary strong{display:block;color:#1c3a2b;font-size:22px;letter-spacing:-.6px}
.users-seat-summary strong span{color:#9aa6a0;font-size:15px;font-weight:600}
.users-seat-summary small{display:block;margin-top:2px;color:#78877e;font-size:10px}
.users-role-guide{margin:0 0 17px;padding:18px 20px;border:1px solid #e7ece8;border-radius:13px;background:#fff}
.users-role-guide-head h2,.users-section-head h2{margin:0 0 3px;color:#20352a;font-size:16px;letter-spacing:-.2px}
.users-role-guide-head p{margin:0;color:#7a877f;font-size:11px}
.users-role-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:16px}
.users-role-grid article{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:12px 10px;border:1px solid #edf1ee;border-radius:9px;background:#fcfdfc}
.users-role-grid article strong{display:block;margin:1px 0 4px;color:#304338;font-size:11px}
.users-role-grid article p{margin:0;color:#7b8980;font-size:10px;line-height:1.5}
.users-role-icon{display:grid;place-items:center;flex:0 0 27px;width:27px;height:27px;border-radius:8px;background:#eef3ef;color:#466252;font-size:11px;font-weight:800}
.users-role-icon.admin{background:#eaf1ff;color:#315b9b}
.users-role-icon.manager{background:#eaf5ed;color:#267247}
.users-role-icon.accountant{background:#fff4e5;color:#a56a18}
.users-role-icon.uploader{background:#f0efff;color:#6554a6}
.users-table-panel{padding:19px 20px 12px}
.users-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.users-section-head p{margin:0}
.users-seat-label{padding:5px 9px;border-radius:6px;background:#f2f7f3;color:#557362;font-size:10px;font-weight:700}
.users-table{min-width:720px}
.users-table th{padding:11px 12px;background:#fafcfb;color:#829087;font-size:9px;letter-spacing:.65px;text-transform:uppercase}
.users-table td{padding:12px;vertical-align:middle;border-bottom:1px solid #eff2ef;font-size:11px}
.users-person{display:flex;align-items:center;gap:10px;min-width:180px}
.users-avatar{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;border-radius:10px;background:#eaf2ec;color:#286340;font-size:12px;font-weight:800}
.users-person strong{display:block;color:#2d4034;font-size:11px}
.users-person small{display:block;margin-top:3px;color:#89958d;font-size:10px}
.users-role-pill{display:inline-flex;padding:5px 8px;border-radius:6px;background:#edf3ef;color:#42614e;font-size:10px;font-weight:750}
.users-role-pill.admin{background:#eaf1ff;color:#315b9b}
.users-protected-note{display:block;margin-top:4px;color:#a0aaa3;font-size:9px}
.users-inline-form{display:flex;align-items:center;gap:6px;margin:0}
.users-inline-form select{width:112px;min-height:30px;height:30px;margin:0;padding:4px 23px 4px 7px;border:1px solid #dfe7e1;border-radius:6px;background:#fff;color:#425449;font-size:10px}
.users-save-role{min-height:29px;padding:5px 8px;border:1px solid #dfe8df;border-radius:6px;background:#f8fbf8;color:#42644d;font-size:9px;font-weight:750}
.users-status{display:inline-flex;align-items:center;gap:6px;color:#39734d;font-size:10px;font-weight:700;white-space:nowrap}
.users-status i{width:6px;height:6px;border-radius:50%;background:#35a265}
.users-status.inactive{color:#a35a4e}
.users-status.inactive i{background:#d16b5d}
.users-date{color:#87938a;font-size:10px!important;white-space:nowrap}
.users-actions form{margin:0}
.users-toggle-button{min-height:29px;padding:5px 9px;border:1px solid #e7eae7;border-radius:6px;background:#fff;color:#9a625b;font-size:9px;font-weight:750;white-space:nowrap}
.users-toggle-button:hover{background:#fff7f5;border-color:#efd5d1}
.users-toggle-button.reactivate{border-color:#d8e9dd;background:#f7fbf8;color:#39724d}
.users-add-panel{margin-top:16px;border:1px solid #e4ebe5;border-radius:12px;background:#fff;overflow:hidden}
.users-add-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;cursor:pointer;list-style:none}
.users-add-panel>summary::-webkit-details-marker{display:none}
.users-add-panel>summary strong{display:block;color:#294334;font-size:12px}
.users-add-panel>summary small{display:block;margin-top:3px;color:#859188;font-size:10px}
.users-add-summary-action{padding:7px 11px;border-radius:7px;background:#176b3c;color:#fff;font-size:10px;font-weight:750}
.users-add-panel[open]>summary{border-bottom:1px solid #edf1ed;background:#fbfdfb}
.users-add-form{padding:17px 18px 15px}
.users-add-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 15px}
.users-add-grid label{margin:0;color:#4a5a50;font-size:10px;font-weight:750}
.users-add-grid input,.users-add-grid select{min-height:39px;margin-top:5px;padding:8px 10px;border:1px solid #dfe7e1;border-radius:7px;background:#fff;font-size:11px}
.users-add-grid label small{display:block;margin-top:4px;color:#8b978e;font-size:9px;font-weight:500}
.users-add-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:15px;padding-top:13px;border-top:1px solid #edf1ed}
.users-add-footer>span{color:#859188;font-size:10px}
.users-add-footer button{min-height:37px;padding:8px 14px;background:#176b3c;font-size:10px}
.users-add-footer button:disabled{cursor:not-allowed;opacity:.45}
@media(max-width:900px){.users-role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){
  .users-page-heading{align-items:flex-start;flex-direction:column}
  .users-seat-summary{width:100%;text-align:left}
  .users-role-guide,.users-table-panel{padding:15px}
  .users-role-grid{grid-template-columns:1fr}
  .users-section-head{align-items:flex-start;flex-direction:column}
  .users-add-grid{grid-template-columns:1fr}
  .users-add-footer{align-items:stretch;flex-direction:column}
  .users-add-footer button{width:100%}
}


/* Phase 5E — focused company settings and live workspace identity preview. */
.settings-heading{align-items:center;margin-bottom:20px}
.settings-heading h1{font-size:32px;letter-spacing:-.9px}
.settings-secure-label{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid #e4ebe5;border-radius:7px;background:#fff;color:#62746a;font-size:10px;font-weight:700;white-space:nowrap}
.settings-secure-label i,.settings-preview-dot{width:7px;height:7px;border-radius:50%;background:#35a36b}
.settings-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(270px,.75fr);gap:18px;align-items:start}
.settings-form{min-width:0;margin:0;padding:0;border:1px solid #e5ebe6;border-radius:13px;background:#fff;overflow:hidden}
.settings-form-head{padding:19px 21px 15px;border-bottom:1px solid #edf1ed}
.settings-form-head h2{margin:0 0 4px;color:#263c2e;font-size:16px}
.settings-form-head p{margin:0;color:#849087;font-size:11px}
.settings-fields{padding:8px 21px 12px}
.settings-fields label{margin:14px 0 16px;color:#435449;font-size:11px;font-weight:750}
.settings-fields input:not([type=color]):not([type=file]),.settings-fields textarea{min-height:40px;margin-top:6px;padding:9px 11px;border:1px solid #dfe7e1;border-radius:7px;font-size:11px}
.settings-fields textarea{min-height:78px;resize:vertical}
.settings-fields input[type=file]{min-height:39px;margin-top:6px;padding:7px;border:1px dashed #cfdad1;border-radius:7px;background:#fbfdfb;font-size:10px}
.settings-field-divider{height:1px;margin:5px 0 13px;background:#edf1ed}
.settings-subhead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:2px}
.settings-subhead strong{color:#34483a;font-size:12px}
.settings-subhead span{color:#9aa49d;font-size:9px}
.settings-color-control{display:flex;align-items:center;gap:10px;margin-top:6px;flex-wrap:wrap}
.settings-color-control input[type=color]{width:43px;height:37px;min-height:37px;margin:0;padding:3px;border:1px solid #dfe7e1;border-radius:7px;background:#fff}
.settings-color-control>span{color:#4d6253;font-size:10px;font-weight:800;letter-spacing:.4px}
.settings-color-control small{color:#8a968d;font-size:9px;font-weight:500}
.settings-form-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 21px;border-top:1px solid #edf1ed;background:#fbfdfb}
.settings-form-footer>span{color:#89958c;font-size:9px}
.settings-form-footer button{min-height:37px;padding:8px 13px;border-radius:7px;background:#176b3c;font-size:10px}
.settings-preview{position:sticky;top:18px;padding:0;border:1px solid #e5ebe6;border-radius:13px;background:#fff;overflow:hidden}
.settings-preview-top{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #edf1ed;color:#819087;font-size:9px;font-weight:800;letter-spacing:1px}
.settings-preview-body{margin:15px;padding:17px;border:1px solid #edf1ed;border-radius:10px;background:#fbfcfb}
.settings-preview-logo-wrap{display:flex;align-items:center;justify-content:center;width:100%;height:84px;margin-bottom:13px;border:1px dashed #dce5dd;border-radius:8px;background:#fff;overflow:hidden}
.settings-preview-logo-wrap img{max-width:78%;max-height:68px;object-fit:contain}
#settings-preview-monogram{display:grid;place-items:center;width:46px;height:46px;border-radius:13px;background:#eaf2ec;color:#2d7047;font-size:20px;font-weight:800}
.settings-preview-name{color:#263c2e;font-size:16px;font-weight:800;letter-spacing:-.3px;overflow-wrap:anywhere}
.settings-preview-address{min-height:31px;margin-top:4px;color:#859188;font-size:10px;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere}
.settings-preview-divider{height:1px;margin:15px 0 12px;background:#e9efea}
.settings-preview-brand-row{display:flex;align-items:center;justify-content:space-between;color:#7e8c82;font-size:9px}
.settings-preview-brand-row strong{width:34px;height:18px;border:1px solid rgba(0,0,0,.08);border-radius:5px}
.settings-preview-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:17px;padding-top:11px;border-top:1px solid #e9efea}
.settings-preview-footer span{color:#607267;font-size:9px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.settings-preview-footer small{color:#a0aaa3;font-size:8px;white-space:nowrap}
.settings-preview-note{margin:0;padding:0 16px 15px;color:#89958d;font-size:9px;line-height:1.55}
.settings-readonly{max-width:620px;padding:18px 20px;border:1px solid #e5ebe6;border-radius:10px;background:#fff}
.settings-readonly strong{color:#314b39;font-size:13px}
.settings-readonly p{margin:5px 0 0;color:#7c8a80;font-size:11px}
@media(max-width:760px){.settings-layout{grid-template-columns:1fr}.settings-preview{position:static}.settings-heading{align-items:flex-start;flex-direction:column}.settings-form-footer{align-items:flex-start;flex-direction:column}.settings-form-footer button{width:100%}}


/* Phase 5F — streamlined platform master portal. */
.master-welcome{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:5px 0 20px}
.master-welcome h1{margin:5px 0 5px;color:#20372a;font-size:30px;letter-spacing:-.9px}
.master-welcome p{margin:0;color:#7e8c82;font-size:11px}
.master-primary-action{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:9px 14px;border-radius:8px;background:#176b3c;color:#fff;text-decoration:none;font-size:11px;font-weight:750;white-space:nowrap;box-shadow:0 3px 8px rgba(23,107,60,.12)}
.master-primary-action:hover{background:#125a32;color:#fff}
.master-primary-action span{font-size:18px;line-height:10px;font-weight:400}
.master-overview-strip{display:flex;align-items:center;gap:0;margin-bottom:19px;padding:15px 19px;border:1px solid #e5ebe6;border-radius:11px;background:#fff}
.master-overview-strip>div{flex:1;min-width:0;padding:0 16px}
.master-overview-strip>div:first-child{padding-left:0}
.master-overview-strip>div:last-child{padding-right:0}
.master-overview-strip>div span{display:block;margin-bottom:4px;color:#839087;font-size:9px;font-weight:700;letter-spacing:.3px}
.master-overview-strip>div strong{display:block;color:#263d2e;font-size:21px;font-weight:800;letter-spacing:-.5px}
.master-overview-strip>i{width:1px;height:31px;background:#e9efea}
.master-companies-panel{border:1px solid #e5ebe6;border-radius:12px;background:#fff;overflow:hidden}
.master-companies-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 19px 13px}
.master-companies-head h2{margin:0 0 3px;color:#263c2e;font-size:16px}
.master-companies-head p{margin:0;color:#859188;font-size:10px}
.master-count{padding:5px 9px;border-radius:6px;background:#f1f6f2;color:#55715e;font-size:9px;font-weight:750;white-space:nowrap}
.master-table-tools{display:flex;align-items:center;gap:9px;padding:0 19px 14px}
.master-search{display:flex;align-items:center;gap:8px;flex:1;min-width:180px;height:36px;margin:0;padding:0 10px;border:1px solid #e1e8e2;border-radius:7px;background:#fff}
.master-search>span{color:#829087;font-size:18px;line-height:1}
.master-search input{width:100%;height:32px;min-height:32px;margin:0;padding:0;border:0!important;outline:0;background:transparent;font-size:10px;box-shadow:none!important}
.master-table-tools select{width:auto;min-width:120px;height:36px;min-height:36px;margin:0;padding:6px 26px 6px 9px;border:1px solid #e1e8e2;border-radius:7px;background:#fff;color:#596a5f;font-size:10px}
.master-table-wrap{overflow-x:auto}
.master-company-table{width:100%;min-width:720px;border-collapse:collapse}
.master-company-table thead th{padding:10px 14px;background:#fafcfb;color:#87938a;font-size:8px;font-weight:800;letter-spacing:.7px;text-align:left;text-transform:uppercase}
.master-company-table thead th:first-child,.master-company-table tbody td:first-child{padding-left:19px}
.master-company-table tbody td{padding:12px 14px;border-bottom:1px solid #eff2ef;color:#5d6d62;font-size:10px;vertical-align:middle}
.master-company-table tbody tr:last-child td{border-bottom:0}
.master-company-identity{display:flex;align-items:center;gap:10px;min-width:185px}
.master-company-monogram{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;border-radius:9px;background:#edf4ee;color:#2e7048;font-size:12px;font-weight:800}
.master-company-identity strong{display:block;color:#2c4033;font-size:10px}
.master-company-identity small{display:block;margin-top:3px;color:#929d95;font-size:9px}
.master-plan-label{display:inline-block;padding:5px 7px;border:1px solid #e9eee9;border-radius:5px;background:#fbfcfb;color:#65766a;font-size:9px;font-weight:700}
.master-seat-value{color:#334b3a;font-size:11px;font-weight:800}
.master-seat-caption{color:#95a098;font-size:9px}
.master-status{display:inline-flex;align-items:center;gap:6px;color:#3f7952;font-size:9px;font-weight:750}
.master-status i{width:6px;height:6px;border-radius:50%;background:#36a266}
.master-status.suspended{color:#a45f55}
.master-status.suspended i{background:#d06e61}
.master-date{color:#8b978e!important;font-size:9px!important;white-space:nowrap}
.master-manage-link{display:inline-flex;align-items:center;gap:6px;color:#246a40;font-size:9px;font-weight:800;text-decoration:none;white-space:nowrap}
.master-manage-link span{font-size:13px;transition:transform .15s ease}
.master-manage-link:hover span{transform:translateX(2px)}
.master-empty{padding:24px 18px!important;color:#89958d;text-align:center;font-size:10px}
.master-companies-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 19px;border-top:1px solid #edf1ed;background:#fcfdfc;color:#8a968e;font-size:9px}
.master-company-table tr[hidden]{display:none}
@media(max-width:700px){
 .master-welcome{align-items:flex-start;flex-direction:column}
 .master-welcome h1{font-size:26px}
 .master-primary-action{width:100%;justify-content:center}
 .master-overview-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;padding:14px}
 .master-overview-strip>div,.master-overview-strip>div:first-child,.master-overview-strip>div:last-child{padding:0}
 .master-overview-strip>i{display:none}
 .master-table-tools{flex-wrap:wrap}
 .master-search{flex-basis:100%}
 .master-table-tools select{flex:1;min-width:0}
 .master-companies-footer{align-items:flex-start;flex-direction:column;gap:4px}
}


/* =========================================================
   InvoiceLog — readability, responsive layout and button fix
   Added as a safe override; existing application styles retained.
   ========================================================= */

/* Dashboard typography: improve readability without changing its design. */
.dashboard-heading h1 {
  font-size: clamp(30px, 2.6vw, 36px);
  line-height: 1.18;
}
.dashboard-heading .muted {
  font-size: 15px;
  line-height: 1.6;
}
.dashboard-summary article {
  min-height: 104px;
  padding: 19px 20px;
}
.dashboard-summary article span {
  color: #5f6f84;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}
.dashboard-summary article strong {
  font-size: clamp(29px, 2.2vw, 34px);
  line-height: 1.15;
}
.dashboard-queue-panel,
.dashboard-recent-panel {
  padding: 25px 26px;
}
.dashboard-queue-panel .section-head h2,
.dashboard-recent-panel .section-head h2 {
  font-size: 21px;
  line-height: 1.35;
}
.dashboard-queue-panel .section-head p,
.dashboard-recent-panel .section-head p {
  font-size: 14px;
  line-height: 1.55;
}
.dashboard-queue-panel .section-head > a,
.dashboard-recent-panel .section-head > a {
  font-size: 13px;
}
.dashboard-queue-table th,
.dashboard-recent-panel th {
  padding: 14px 13px;
  font-size: 11px;
  letter-spacing: .65px;
}
.dashboard-queue-table td,
.dashboard-recent-panel td {
  padding: 15px 13px;
  font-size: 14px;
  line-height: 1.5;
}
.dashboard-queue-table .empty,
.dashboard-recent-panel .empty {
  padding: 30px 14px !important;
  font-size: 14px;
}
.dashboard-action-tag,
.dashboard-state {
  min-height: 25px;
  padding: 5px 9px;
  font-size: 11px;
}
.dashboard-duplicate-note {
  font-size: 13px;
  line-height: 1.55;
}
.dashboard-duplicate-note > strong {
  font-size: 13px;
}

/* Ensure the extraction/retry button always has readable white text. */
.retry-form button,
.retry-form .button,
.dashboard-retry-form button {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}
.retry-form button:hover,
.retry-form .button:hover,
.dashboard-retry-form button:hover,
.retry-form button:focus,
.retry-form .button:focus,
.dashboard-retry-form button:focus {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

/* General responsive safeguards for all application pages. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
.wrap {
  width: min(1360px, calc(100% - clamp(24px, 4vw, 56px)));
}
img,
video,
iframe {
  max-width: 100%;
}
.panel,
.cards article,
.settings-layout > *,
.invoice-detail-grid > *,
.invoice-review-layout > * {
  min-width: 0;
}
.primary-nav {
  min-width: 0;
  row-gap: 5px;
}
.primary-nav a {
  font-size: 14px;
}
.nav-user {
  font-size: 13px;
}
.table-scroll,
.dashboard-queue-table,
.dashboard-recent-panel .table-scroll,
.master-table-wrap,
.invoice-register-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dashboard-queue-table table {
  min-width: 700px;
}
.dashboard-recent-panel table {
  min-width: 650px;
}
button,
.button,
input,
select,
textarea {
  max-width: 100%;
}

/* Large tablets and compact laptops. */
@media (max-width: 1100px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-queue-panel,
  .dashboard-recent-panel {
    padding: 21px;
  }
}

/* Tablets and smaller screens. */
@media (max-width: 820px) {
  .app-main {
    padding-top: 25px;
    padding-bottom: 60px;
  }
  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 0;
  }
  .primary-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .primary-nav a {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
  }
  .dashboard-heading h1 {
    font-size: 31px;
  }
  .dashboard-summary article span {
    font-size: 13px;
  }
  .dashboard-queue-panel,
  .dashboard-recent-panel {
    padding: 19px;
  }
  .invoice-review-layout,
  .invoice-detail-grid,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Mobile phones. */
@media (max-width: 620px) {
  .wrap {
    width: calc(100% - 28px);
  }
  .app-main {
    padding-top: 20px;
    padding-bottom: 44px;
  }
  .brand {
    font-size: 19px;
  }
  .primary-nav {
    gap: 4px;
  }
  .primary-nav a {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
  }
  .nav-user {
    font-size: 12px;
  }
  .dashboard-heading {
    gap: 12px;
  }
  .dashboard-heading h1 {
    font-size: 28px;
  }
  .dashboard-heading .muted {
    font-size: 14px;
  }
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
  }
  .dashboard-summary article {
    min-height: 88px;
    padding: 14px;
  }
  .dashboard-summary article span {
    font-size: 12px;
  }
  .dashboard-summary article strong {
    margin-top: 7px;
    font-size: 27px;
  }
  .dashboard-queue-panel,
  .dashboard-recent-panel {
    padding: 16px;
    margin: 14px 0;
  }
  .dashboard-queue-panel .section-head,
  .dashboard-recent-panel .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .dashboard-queue-panel .section-head h2,
  .dashboard-recent-panel .section-head h2 {
    font-size: 19px;
  }
  .dashboard-queue-panel .section-head p,
  .dashboard-recent-panel .section-head p {
    font-size: 13px;
  }
  .dashboard-queue-table th,
  .dashboard-recent-panel th {
    padding: 12px 10px;
    font-size: 10px;
  }
  .dashboard-queue-table td,
  .dashboard-recent-panel td {
    padding: 12px 10px;
    font-size: 13px;
  }
  .dashboard-queue-table table {
    min-width: 660px;
  }
  .dashboard-recent-panel table {
    min-width: 610px;
  }
  .retry-form {
    align-items: stretch;
    flex-direction: column;
  }
  .retry-form button,
  .retry-form .button,
  .dashboard-retry-form button {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }
  .form-actions,
  .review-form-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .form-actions > *,
  .review-form-actions > * {
    max-width: 100%;
  }
}

/* Very narrow phones. */
@media (max-width: 390px) {
  .wrap {
    width: calc(100% - 22px);
  }
  .dashboard-summary {
    grid-template-columns: 1fr;
  }
  .dashboard-summary article {
    min-height: 78px;
  }
  .dashboard-summary article strong {
    font-size: 26px;
  }
  .dashboard-heading h1 {
    font-size: 26px;
  }
  .dashboard-queue-panel,
  .dashboard-recent-panel {
    padding: 13px;
  }
  .primary-nav a {
    padding: 7px 8px;
    font-size: 11px;
  }
  .login-panel,
  .form-panel {
    padding: 16px;
  }
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Fix Re-extract PDF button hover */
.retry-form button,
.retry-form button:hover,
.retry-form button:focus,
.retry-form button:active {
    background-color: #963719 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: #963719 !important;
    opacity: 1 !important;
    filter: none !important;
}


/* Phase 5.2 — shared responsive navigation */
.app-header {
  position: relative;
  z-index: 100;
  background: #ffffff;
}
.app-header .nav {
  min-height: 76px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px 0;
}
.app-header .brand {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.app-header .brand-logo {
  max-width: 150px;
  max-height: 44px;
  object-fit: contain;
}
.app-header .primary-nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 5px;
  padding: 0;
  margin: 0;
  border: 0;
}
.app-header .primary-nav > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 9px;
  color: #53637a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.app-header .primary-nav > a:hover,
.app-header .primary-nav > a.is-active {
  background: var(--brand-soft, #eaf1ed);
  color: var(--brand, #075b25);
}
.app-header .primary-nav > a.nav-upload,
.app-header .primary-nav > a.nav-upload:hover {
  padding-inline: 15px;
  background: var(--brand, #075b25);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  box-shadow: 0 4px 11px rgba(10, 85, 37, .16);
}
.app-header .primary-nav > a.nav-upload:hover {
  filter: brightness(.94);
}
.app-header .primary-nav .nav-user {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0 2px 0 8px;
  padding: 7px 12px;
  border: 1px solid #dce5ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #61718a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 1px solid #dce5ee;
  border-radius: 11px;
  background: #ffffff;
  color: #172b45;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(20, 36, 60, .05);
}
.nav-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle.is-open span:first-child {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

/* Device management stays available under Company settings, not in the global menu. */
.settings-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 20px 0;
  padding: 22px 24px;
  border: 1px solid var(--line, #dce5ee);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(30, 51, 80, .035);
}
.settings-device-card h2 {
  margin: 3px 0 6px;
  font-size: 18px;
}
.settings-device-card p {
  margin: 0;
  font-size: 13px;
}
.settings-device-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line, #dce5ee);
  border-radius: 9px;
  color: var(--brand, #075b25);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.settings-device-link:hover {
  background: var(--brand-soft, #eaf1ed);
  text-decoration: none;
}

@media (max-width: 1120px) {
  .app-header .nav {
    min-height: 68px;
    flex-wrap: wrap;
    gap: 0 14px;
    padding: 11px 0;
  }
  .app-header .brand {
    font-size: 19px;
  }
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .app-header .primary-nav {
    display: none;
    flex: 0 0 100%;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 12px 0 3px;
    margin-top: 11px;
    border-top: 1px solid #e7edf3;
  }
  .app-header .primary-nav.is-open {
    display: flex;
  }
  .app-header .primary-nav > a {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 11px 14px;
    font-size: 14px;
  }
  .app-header .primary-nav > a.nav-upload,
  .app-header .primary-nav > a.nav-upload:hover {
    justify-content: flex-start;
    margin: 3px 0;
  }
  .app-header .primary-nav .nav-user {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
    margin: 7px 0 2px;
    padding: 10px 14px;
    border-radius: 10px;
  }
}
@media (max-width: 560px) {
  .app-header .nav {
    width: calc(100% - 28px);
    min-height: 66px;
    padding: 10px 0;
  }
  .app-header .brand {
    gap: 9px;
    font-size: 17px;
    letter-spacing: -.4px;
  }
  .app-header .brand-logo {
    max-width: 42px;
    max-height: 42px;
    border-radius: 8px;
  }
  .nav-toggle {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
  .settings-device-card {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    padding: 18px;
  }
  .settings-device-link {
    width: 100%;
    justify-content: center;
  }
}
