:root {
  --blue: #1a2b66;
  --blue-dark: #111f4a;
  --green: #e2ef8b;
  --green-dark: #70840d;
  --cream: #fbf9ee;
  --white: #fff;
  --muted: #68748a;
  --line: #dfe5da;
  --danger: #b94b4b;
  --ok: #2f8b57;
  --shadow: 0 20px 55px rgba(26,43,102,.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--blue); background: linear-gradient(180deg, var(--cream), #fff 260px); font-family: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif; }
body, input, select, textarea, button { font: 16px/1.45 "DM Sans", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.skip-link { position: absolute; left: -999px; top: 10px; background: var(--green); padding: 10px; z-index: 99; }
.skip-link:focus { left: 10px; }
.admin-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px max(18px, calc((100vw - 1360px)/2)); background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(26,43,102,.09); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand img { width: 100px; height: 100px; object-fit: contain; display: block; }
.admin-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-nav a, .admin-account a { padding: 9px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--muted); }
.admin-nav a:hover, .admin-nav a.active { background: var(--green); color: var(--blue-dark); }
.admin-account { display: flex; align-items: center; gap: 6px; }
.admin-account a:hover { color: var(--blue-dark); background: #eef1e8; }
.admin-nav .mobile-account-link { display: none; }
.nav-toggle { display: none; border: 0; border-radius: 999px; padding: 10px 16px; background: var(--blue); color: #fff; font-weight: 900; }
.portal-shell { width: min(calc(100% - 28px), 1240px); margin: 0 auto; }
.portal-shell.module-shell { width: min(calc(100% - 28px), 1360px); display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start; }
.admin-main { min-width: 0; padding: 34px 0 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font: 900 clamp(32px, 5vw, 54px)/1.03 "Manrope"; letter-spacing: -.05em; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.button, .secondary-button, .danger-button { min-height: 48px; padding: 13px 22px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.button { background: var(--green); color: var(--blue-dark); }
.button:hover { background: #edf6a8; }
.secondary-button { background: var(--blue); color: #fff; }
.danger-button { background: #ffe7e7; color: var(--danger); }
.card { padding: 24px; border: 1px solid rgba(26,43,102,.08); border-radius: 24px; background: var(--white); box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.stat-card { padding: 22px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; margin-top: 10px; font: 900 36px/1 "Manrope"; letter-spacing: -.04em; }
.two-col { grid-template-columns: 1.25fr .75fr; align-items: start; }
.three-col { grid-template-columns: repeat(3, 1fr); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.table-wrap { overflow-x: auto; }
.flash { margin-bottom: 18px; padding: 14px 16px; border-radius: 16px; font-weight: 800; }
.flash.success { background: #e8f7ee; color: var(--ok); }
.flash.error, .alert { background: #fff0f0; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label, fieldset legend { display: block; color: var(--blue-dark); font-weight: 900; font-size: 13px; }
label span, fieldset legend { display: block; margin-bottom: 7px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #d8dfd2; border-radius: 13px; background: #fffef9; color: var(--blue); outline: none; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(226,239,139,.45); }
fieldset { margin: 0; padding: 0; border: 0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkbox-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; }
.checkbox-card input { width: auto; min-height: auto; margin-right: 8px; accent-color: var(--green-dark); }
.quote-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.sticky-summary { position: sticky; top: 94px; }
.summary-price { margin: 10px 0; font: 900 44px/1 "Manrope"; color: var(--ok); letter-spacing: -.05em; }
.summary-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.warnings { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.warnings li { padding: 10px 12px; border-radius: 12px; background: #fff4df; color: #8b5b10; font-weight: 800; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { padding: 10px 14px; border-radius: 999px; background: #eef1e8; font-weight: 900; }
.tab.active { background: var(--blue); color: #fff; }
.login-page { min-height: 100vh; background: linear-gradient(180deg, var(--cream), #fff 320px); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 420px); text-align: center; overflow: hidden; padding: 34px 30px; display: flex; flex-direction: column; align-items: center; }
.login-logo { width: 200px; height: 200px; max-width: 78%; object-fit: contain; margin: 0 auto 22px; display: block; }
.login-card h1 { font: 900 42px/1 "Manrope"; margin-bottom: 8px; }
.login-card label { width: 100%; text-align: left; }
.login-card .button { align-self: center; min-width: 150px; }
.muted { color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: 1fr 220px 180px auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.client-filter { grid-template-columns: 1fr auto; }
.client-list-box { max-height: 620px; overflow-y: auto; padding-right: 6px; scrollbar-color: var(--green-dark) #eef1e8; }
.client-list-box tr { transition: background .18s ease, box-shadow .18s ease, transform .18s ease; }
.client-list-box tbody tr:hover { background: #fbfdf1; box-shadow: inset 4px 0 0 var(--green); transform: translateX(2px); }
.client-list-box tbody tr:hover .company-link { color: var(--blue-dark); text-decoration-thickness: 3px; }
.client-empty-state { margin: 16px 0 0; text-align: center; font-weight: 800; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-button { border: 0; background: transparent; color: var(--blue); font-weight: 900; text-decoration: underline; cursor: pointer; padding: 0; }
.company-link { color: var(--blue); font-weight: 900; text-decoration: underline; text-decoration-color: var(--green-dark); text-underline-offset: 4px; }
.followup-due { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #fff0f0; color: var(--danger); font-weight: 900; }
.followup-ok { color: var(--muted); font-weight: 800; }
.notes-field textarea { min-height: 220px; }
.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 22px; }
.module-card { display: block; padding: 24px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); border: 1px solid rgba(26,43,102,.08); }
.module-card h2 { margin: 0 0 8px; font: 900 28px/1.1 "Manrope"; }
.module-card p { margin: 0; color: var(--muted); }
.module-sidebar { position: sticky; top: 138px; margin-top: 34px; padding: 18px; border: 1px solid rgba(26,43,102,.08); border-radius: 24px; background: #fff; box-shadow: var(--shadow); display: grid; gap: 9px; }
.module-sidebar span { color: var(--green-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.module-sidebar a { padding: 12px 14px; border-radius: 16px; color: var(--muted); font-weight: 900; }
.module-sidebar a:hover, .module-sidebar a.active { background: var(--blue); color: #fff; }
.confirm-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(17,31,74,.42); backdrop-filter: blur(7px); }
.confirm-modal.open { display: flex; }
.confirm-dialog { width: min(100%, 430px); padding: 28px; border-radius: 28px; background: #fff; box-shadow: 0 30px 80px rgba(17,31,74,.28); border: 1px solid rgba(26,43,102,.08); text-align: center; }
.confirm-kicker { display: inline-flex; margin-bottom: 10px; padding: 7px 12px; border-radius: 999px; background: var(--green); color: var(--green-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.confirm-dialog h2 { margin: 0 0 8px; font: 900 32px/1.05 "Manrope"; letter-spacing: -.04em; }
.confirm-dialog p { margin: 0 0 22px; color: var(--muted); }
.confirm-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.client-profile { grid-template-columns: 1fr 1fr; align-items: stretch; }
.client-hero-card { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.client-hero-card h2 { margin: 10px 0; font: 900 clamp(34px, 5vw, 56px)/1.02 "Manrope"; letter-spacing: -.05em; }
.client-hero-card p { margin: 6px 0 0; color: rgba(255,255,255,.78); }
.client-hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.client-hero-meta > span:first-child { padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 900; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 900; }
.status-pill i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.status-active i { background: #49c56f; }
.status-occasional i { background: #5cb3ff; }
.status-stopped i { background: #ff6b6b; }
.status-neutral i { background: var(--green); }
.client-notes-card { grid-column: 1 / -1; }
.client-notes-card p { min-height: 130px; color: var(--blue-dark); white-space: normal; }
.proposal { background: #fff; color: #111; }
.proposal .proposal-box { max-width: 860px; margin: auto; padding: 40px; }
.proposal h1 { color: var(--blue); }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .admin-header { padding-top: 8px; padding-bottom: 8px; }
  .brand img { width: 76px; height: 76px; }
  .admin-account { display: none; }
  .admin-nav .mobile-account-link { display: block; }
  .admin-nav { position: fixed; inset: 96px 12px auto; display: none; flex-direction: column; align-items: stretch; padding: 18px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
  .admin-nav.open { display: flex; }
  .admin-nav a { padding: 13px 14px; font-size: 16px; }
  .page-head { display: block; }
  .stats-grid, .two-col, .three-col, .quote-layout, .form-grid, .filter-bar, .client-filter, .module-grid, .client-profile { grid-template-columns: 1fr; }
  .portal-shell, .portal-shell.module-shell { display: flex; flex-direction: column; width: min(calc(100% - 28px), 1240px); }
  .admin-main { order: 2; }
  .module-sidebar { order: 1; position: static; margin: 18px 0 0; grid-template-columns: 1fr; }
  .sticky-summary { position: static; }
  .checkbox-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body, input, select, textarea, button { font-size: 15px; }
  .admin-main { padding-top: 22px; }
  .page-head h1 { font-size: 38px; }
  .page-head .button, .page-head .secondary-button { width: 100%; margin-top: 14px; }
  .card { padding: 18px; border-radius: 20px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 18px; }
  .table-wrap { overflow: visible; }
  .client-list-box { max-height: 720px; overflow-y: auto; padding-right: 0; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap th, .table-wrap td, .table-wrap tr { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 16px; margin-bottom: 12px; border: 1px solid rgba(26,43,102,.08); border-radius: 18px; background: #fff; box-shadow: 0 12px 32px rgba(26,43,102,.08); }
  .table-wrap td { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); text-align: right; }
  .table-wrap td:last-child { border-bottom: 0; display: block; text-align: left; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
  .table-wrap td:last-child::before { display: block; margin-bottom: 8px; }
  .action-row { align-items: center; }
  .action-row .link-button { padding: 8px 0; }
  .confirm-actions .secondary-button, .confirm-actions .danger-button { width: 100%; }
}
@media print {
  .admin-header, .no-print, .button, .secondary-button { display: none !important; }
  body { background: white; }
  .admin-main, .proposal .proposal-box { width: 100%; max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; }
}
