@font-face {
  font-family: "Stack_sans_notch";
  src: local("Stack Sans Notch"), local("Stack_sans_notch"), url("../../assets/fonts/StackSansNotch-VariableFont_wght.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 200 700;
}

:root {
  --admin-bg: #f4f6f9;
  --admin-surface: #ffffff;
  --admin-ink: #111827;
  --admin-muted: #687386;
  --admin-line: #e2e7ee;
  --admin-sidebar: #0b1018;
  --admin-blue: #1683ff;
  --admin-blue-dark: #0066db;
  --admin-blue-soft: #e8f2ff;
  --admin-success: #15875d;
  --admin-warning: #b46908;
  --admin-danger: #d43c50;
  --admin-radius: 14px;
  --admin-shadow: 0 10px 34px rgba(15, 23, 42, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; min-width: 320px; color: var(--admin-ink); background: var(--admin-bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img, svg { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
::selection { color: #fff; background: var(--admin-blue); }
:focus-visible { outline: 3px solid rgba(22, 131, 255, .34); outline-offset: 2px; }

.admin-wordmark { display: inline-flex; align-items: baseline; font-family: "Stack_sans_notch", Inter, sans-serif; font-size: 1.38rem; font-weight: 700; letter-spacing: -.055em; line-height: 1; }
.admin-wordmark .flow { color: #fff; }
.admin-wordmark .scale { color: var(--admin-blue); }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 255px; padding: 25px 17px 18px; color: #fff; background: var(--admin-sidebar); }
.sidebar-logo { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 10px; }
.sidebar-logo small { margin-left: 8px; color: rgba(255,255,255,.35); font-size: .54rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; margin-top: 35px; }
.sidebar-label { margin: 18px 12px 8px; color: rgba(255,255,255,.3); font-size: .58rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-nav a, .sidebar-nav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; color: rgba(255,255,255,.57); background: transparent; border-radius: 8px; font-size: .78rem; font-weight: 600; text-align: left; cursor: pointer; transition: color .2s, background .2s; }
.sidebar-nav a:hover, .sidebar-nav button:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: #fff; background: rgba(22,131,255,.17); box-shadow: inset 3px 0 var(--admin-blue); }
.nav-icon { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; color: currentColor; }
.nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; color: #fff; background: var(--admin-blue); border-radius: 20px; font-size: .54rem; font-weight: 800; line-height: 1; }
.sidebar-footer { padding-top: 15px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 15px; }
.sidebar-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--admin-blue); border-radius: 9px; font-size: .7rem; font-weight: 800; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: .72rem; }.sidebar-user small { color: rgba(255,255,255,.35); font-size: .58rem; }
.logout-form { margin: 0; }

.admin-main { min-height: 100vh; margin-left: 255px; }
.topbar { position: sticky; z-index: 35; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 36px; border-bottom: 1px solid var(--admin-line); background: rgba(244,246,249,.88); backdrop-filter: blur(14px); }
.topbar-title h1 { margin: 0; font-size: 1.18rem; font-weight: 720; letter-spacing: -.025em; }
.topbar-title p { margin: 2px 0 0; color: var(--admin-muted); font-size: .65rem; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.mobile-toggle { display: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--admin-line); background: #fff; border-radius: 9px; cursor: pointer; }
.mobile-toggle span { display: block; width: 16px; height: 1.5px; margin: 4px auto; background: var(--admin-ink); }
.admin-content { width: min(100%, 1500px); margin: 0 auto; padding: 32px 36px 60px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: .72rem; font-weight: 700; line-height: 1; cursor: pointer; transition: transform .18s, background .18s, border-color .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--admin-blue); }.button-primary:hover { background: var(--admin-blue-dark); }
.button-secondary { color: var(--admin-ink); border-color: var(--admin-line); background: #fff; }.button-secondary:hover { border-color: #bac5d3; }
.button-danger { color: var(--admin-danger); border-color: #f1cbd1; background: #fff; }.button-danger:hover { color: #fff; background: var(--admin-danger); }
.button-ghost { color: var(--admin-muted); background: transparent; }.button-ghost:hover { color: var(--admin-ink); background: #edf0f4; }
.button-small { min-height: 33px; padding: 0 11px; font-size: .65rem; }
.button-icon { width: 36px; padding: 0; }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 26px; }
.page-intro h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.15; letter-spacing: -.045em; }
.page-intro p { max-width: 650px; margin: 7px 0 0; color: var(--admin-muted); font-size: .82rem; }
.page-intro-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card { position: relative; min-height: 142px; padding: 21px; overflow: hidden; border: 1px solid var(--admin-line); background: var(--admin-surface); border-radius: var(--admin-radius); box-shadow: 0 3px 15px rgba(15,23,42,.025); }
.stat-card::after { content: ""; position: absolute; top: -25px; right: -25px; width: 88px; height: 88px; border: 17px solid var(--admin-blue-soft); border-radius: 50%; }
.stat-label { color: var(--admin-muted); font-size: .66rem; font-weight: 650; }
.stat-value { margin-top: 25px; font-size: 1.85rem; font-weight: 750; line-height: 1; letter-spacing: -.04em; }
.stat-meta { margin-top: 9px; color: var(--admin-muted); font-size: .6rem; }
.stat-card.accent { color: #fff; border-color: var(--admin-blue); background: var(--admin-blue); }
.stat-card.accent::after { border-color: rgba(255,255,255,.12); }.stat-card.accent .stat-label,.stat-card.accent .stat-meta { color: rgba(255,255,255,.7); }

.dashboard-grid { display: grid; grid-template-columns: 1.5fr .8fr; gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--admin-line); background: var(--admin-surface); border-radius: var(--admin-radius); box-shadow: 0 3px 15px rgba(15,23,42,.025); }
.panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 21px; border-bottom: 1px solid var(--admin-line); }
.panel-header h3 { margin: 0; font-size: .88rem; letter-spacing: -.015em; }.panel-header p { margin: 2px 0 0; color: var(--admin-muted); font-size: .6rem; }
.panel-body { padding: 21px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 11px 15px; color: var(--admin-muted); background: #fafbfd; font-size: .59rem; font-weight: 750; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 14px 15px; border-top: 1px solid var(--admin-line); font-size: .72rem; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table .primary-cell strong, .data-table .primary-cell small { display: block; }.data-table .primary-cell small { margin-top: 2px; color: var(--admin-muted); font-size: .6rem; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 20px; font-size: .58rem; font-weight: 750; }
.status::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status-draft { color: #64748b; background: #eef1f5; }.status-sent { color: #1767bb; background: #e6f2ff; }.status-accepted { color: #13815b; background: #e3f7ee; }.status-rejected,.status-error { color: #c23a4d; background: #fdecef; }.status-expired { color: #996006; background: #fff2d8; }
.status-unread { color: #126fd4; background: var(--admin-blue-soft); }
.status-read { color: #687386; background: #eef1f5; }

.inbox-filters { grid-template-columns: minmax(250px, 1fr) minmax(150px, .3fr) auto; }
.inbox-table .inbox-row { transition: background .18s, box-shadow .18s; }
.inbox-table .inbox-row.is-unread { background: #f5f9ff; box-shadow: inset 3px 0 var(--admin-blue); }
.inbox-table .inbox-row.is-unread:hover { background: #edf5ff; }
.inbox-table .inbox-row.is-unread strong { font-weight: 780; }
.inbox-contact a, .inbox-summary a { display: inline-block; }
.inbox-summary { min-width: 320px; max-width: 590px; white-space: normal; }
.inbox-summary strong, .inbox-summary small { display: block; }
.inbox-summary small { max-width: 580px; margin-top: 3px; overflow: hidden; color: var(--admin-muted); font-size: .61rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.inbox-table .table-actions form, .inbox-page-intro .page-intro-actions form { display: flex; gap: 5px; }
.inbox-back { display: inline-block; margin-bottom: 10px; color: var(--admin-blue-dark); font-size: .66rem; font-weight: 750; }
.inbox-page-intro { align-items: flex-end; }
.inbox-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); gap: 16px; }
.inbox-message-panel, .inbox-meta-panel { min-width: 0; }
.inbox-message-body { min-height: 290px; color: #273244; font-size: .79rem; line-height: 1.8; overflow-wrap: anywhere; white-space: normal; }
.inbox-meta-list { display: grid; gap: 0; margin: 0; }
.inbox-meta-list div { padding: 12px 0; border-bottom: 1px solid var(--admin-line); }
.inbox-meta-list div:first-child { padding-top: 0; }
.inbox-meta-list div:last-child { padding-bottom: 0; border-bottom: 0; }
.inbox-meta-list dt { margin-bottom: 3px; color: var(--admin-muted); font-size: .56rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.inbox-meta-list dd { margin: 0; color: var(--admin-ink); font-size: .7rem; line-height: 1.5; overflow-wrap: anywhere; }
.inbox-meta-list a { color: var(--admin-blue-dark); }

.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 11px; padding: 0 0 20px; }
.activity-item::after { content: ""; position: absolute; top: 28px; bottom: 0; left: 13px; width: 1px; background: var(--admin-line); }.activity-item:last-child::after { display: none; }
.activity-dot { z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; color: var(--admin-blue); background: var(--admin-blue-soft); border-radius: 8px; font-size: .65rem; font-weight: 800; }
.activity-item p { margin: 1px 0 2px; font-size: .68rem; line-height: 1.4; }.activity-item time { color: var(--admin-muted); font-size: .57rem; }
.empty-state { padding: 55px 25px; color: var(--admin-muted); text-align: center; }.empty-state strong { display: block; margin-bottom: 5px; color: var(--admin-ink); font-size: .9rem; }

.filters { display: grid; grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(130px, .7fr)) auto; gap: 10px; margin-bottom: 16px; padding: 15px; border: 1px solid var(--admin-line); background: #fff; border-radius: var(--admin-radius); }
.filter-actions { display: flex; align-items: end; gap: 7px; }

.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.col-12 { grid-column: span 12; }.col-8 { grid-column: span 8; }.col-6 { grid-column: span 6; }.col-4 { grid-column: span 4; }.col-3 { grid-column: span 3; }
.form-section { margin-bottom: 18px; padding: 24px; border: 1px solid var(--admin-line); background: #fff; border-radius: var(--admin-radius); }
.form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding-bottom: 17px; border-bottom: 1px solid var(--admin-line); }
.form-section-heading h3 { margin: 0; font-size: .95rem; letter-spacing: -.02em; }.form-section-heading p { margin: 4px 0 0; color: var(--admin-muted); font-size: .64rem; }
.field label { display: flex; justify-content: space-between; margin-bottom: 7px; color: #475569; font-size: .63rem; font-weight: 700; }
.field label small { color: #96a0ae; font-weight: 500; }
.required { color: var(--admin-blue); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d7dde5; outline: 0; color: var(--admin-ink); background: #fff; border-radius: 8px; font-size: .75rem; transition: border .18s, box-shadow .18s; }
.field input, .field select { height: 43px; padding: 0 12px; }.field textarea { min-height: 110px; padding: 11px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--admin-blue); box-shadow: 0 0 0 3px rgba(22,131,255,.1); }
.field input::placeholder, .field textarea::placeholder { color: #a4acb8; }
.field-help { margin: 6px 0 0; color: var(--admin-muted); font-size: .58rem; }
.input-prefix { position: relative; }.input-prefix span { position: absolute; top: 50%; left: 12px; color: var(--admin-muted); font-size: .68rem; transform: translateY(-50%); }.input-prefix input { padding-left: 29px; }
.checkbox { display: inline-flex; align-items: flex-start; gap: 9px; color: var(--admin-muted); font-size: .68rem; cursor: pointer; }.checkbox input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--admin-blue); }

.form-actions { position: sticky; z-index: 20; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding: 14px 17px; border: 1px solid var(--admin-line); background: rgba(255,255,255,.94); border-radius: 12px; box-shadow: var(--admin-shadow); backdrop-filter: blur(12px); }
.form-actions-group { display: flex; flex-wrap: wrap; gap: 8px; }

.quote-items { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.quote-items th { padding: 0 7px 3px; color: var(--admin-muted); font-size: .56rem; text-align: left; text-transform: uppercase; }
.quote-items td { padding: 7px; background: #f8fafc; vertical-align: middle; }
.quote-items td:first-child { border-radius: 8px 0 0 8px; }.quote-items td:last-child { border-radius: 0 8px 8px 0; }
.quote-items input { width: 100%; height: 38px; padding: 0 9px; border: 1px solid #d7dde5; background: #fff; border-radius: 6px; font-size: .68rem; }
.quote-items .item-description { min-width: 250px; }.quote-items .item-number { min-width: 85px; }.quote-items .item-total { min-width: 110px; font-size: .7rem; font-weight: 750; text-align: right; }
.remove-row { width: 34px; height: 34px; padding: 0; border: 0; color: var(--admin-danger); background: transparent; border-radius: 7px; cursor: pointer; }.remove-row:hover { background: #fdecef; }
.quote-summary { display: flex; justify-content: flex-end; margin-top: 18px; }
.totals-card { width: min(100%, 420px); padding: 16px; background: #f7f9fc; border-radius: 10px; }
.total-line { display: flex; justify-content: space-between; padding: 7px 0; color: var(--admin-muted); font-size: .68rem; }.total-line strong { color: var(--admin-ink); }
.total-line.grand { margin-top: 7px; padding-top: 13px; border-top: 1px solid #d8dfe8; color: var(--admin-ink); font-size: .9rem; }.total-line.grand strong { color: var(--admin-blue); font-size: 1.15rem; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: .7rem; line-height: 1.5; }
.alert-success { color: #126a4c; border-color: #bce8d7; background: #eaf9f2; }.alert-error { color: #a72d3e; border-color: #f2c4cb; background: #fff0f2; }.alert-info { color: #145d9e; border-color: #badbfa; background: #ebf5ff; }.alert-warning { color: #875608; border-color: #f0d59e; background: #fff7e6; }
.alert ul { margin: 0; padding-left: 18px; }

.editor { border: 1px solid #d7dde5; border-radius: 8px; overflow: hidden; background: #fff; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px; border-bottom: 1px solid var(--admin-line); background: #f8fafc; }
.editor-toolbar button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; background: transparent; border-radius: 5px; font-size: .68rem; font-weight: 700; cursor: pointer; }.editor-toolbar button:hover { border-color: var(--admin-line); background: #fff; }
.editor-content { min-height: 220px; padding: 16px; outline: 0; font-size: .78rem; line-height: 1.7; }.editor-content:focus { box-shadow: inset 0 0 0 2px rgba(22,131,255,.15); }.editor-content p:first-child { margin-top: 0; }
.editor-content:empty::before { color: #a4acb8; content: attr(data-placeholder); pointer-events: none; }

.email-signature-preview { margin-top: 18px; padding: 20px; border: 1px solid var(--admin-line); background: #f8fafc; border-radius: 10px; }
.email-signature-empty { color: var(--admin-muted); font-size: .68rem; }
.signature-render { color: #4b5565; font-family: Arial, Helvetica, sans-serif; }
.signature-render[hidden], .email-signature-empty[hidden] { display: none; }

.signatures-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.signature-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.signature-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--admin-line); }
.signature-card-header h3 { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.signature-card-header p { margin: 3px 0 0; color: var(--admin-muted); font-size: .63rem; }
.signature-default-badge { display: inline-flex; align-items: center; padding: 5px 9px; color: #126fd4; background: var(--admin-blue-soft); border-radius: 20px; font-size: .56rem; font-weight: 780; }
.signature-card-preview { min-height: 205px; padding: 28px 24px; overflow-wrap: anywhere; background: #fff; }
.signature-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--admin-line); background: #fafbfd; }
.signature-card-actions form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.signature-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); align-items: start; gap: 16px; }
.signature-editor-grid .form-section { margin: 0; }
.signature-live-preview { position: sticky; top: 94px; overflow: hidden; }
.signature-live-preview .signature-card-preview { min-height: 280px; }
.signature-default-check { min-height: 43px; align-items: center; padding: 0 12px; border: 1px solid #d7dde5; background: #fff; border-radius: 8px; }

.attachment-list { display: grid; gap: 7px; margin-top: 10px; }.attachment-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 11px; background: #f7f9fc; border-radius: 7px; font-size: .65rem; }

.preview-switch { display: inline-flex; padding: 3px; background: #e9edf2; border-radius: 8px; }.preview-switch button { min-height: 32px; padding: 0 12px; border: 0; color: var(--admin-muted); background: transparent; border-radius: 6px; font-size: .62rem; font-weight: 700; cursor: pointer; }.preview-switch button.active { color: var(--admin-ink); background: #fff; box-shadow: 0 2px 7px rgba(15,23,42,.08); }
.email-preview-stage { min-height: 720px; padding: 28px; overflow: auto; background: #dfe4ea; border-radius: var(--admin-radius); text-align: center; }.email-preview-frame { width: 100%; max-width: 720px; height: 690px; border: 0; background: #fff; box-shadow: 0 15px 45px rgba(15,23,42,.15); transition: max-width .3s; }.email-preview-stage.mobile .email-preview-frame { max-width: 390px; }

.document-preview { padding: 25px; overflow: auto; background: #dfe4ea; border-radius: var(--admin-radius); }.document-sheet { width: 210mm; min-height: 297mm; margin: 0 auto; padding: 22mm 16mm; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.16); transform-origin: top center; }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 30px 18px; color: #fff; background: radial-gradient(circle at 75% 20%, rgba(22,131,255,.2), transparent 30%), #0b1018; }
.auth-page::before { content: ""; position: fixed; inset: 0; opacity: .25; background-image: linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px); background-size: 64px 64px; pointer-events: none; }
.auth-card { position: relative; width: min(100%, 450px); padding: 34px; border: 1px solid rgba(255,255,255,.11); background: rgba(19,27,39,.9); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); backdrop-filter: blur(15px); }
.auth-card.install-card { width: min(100%, 720px); }
.auth-header { margin-bottom: 28px; }.auth-header .admin-wordmark { margin-bottom: 38px; }.auth-header h1 { margin: 0; font-size: 1.65rem; letter-spacing: -.04em; }.auth-header p { margin: 7px 0 0; color: rgba(255,255,255,.48); font-size: .75rem; }
.auth-card .field label { color: rgba(255,255,255,.65); }.auth-card .field input,.auth-card .field select { color: #fff; border-color: rgba(255,255,255,.13); background: rgba(0,0,0,.18); }.auth-card .field input:focus,.auth-card .field select:focus { border-color: var(--admin-blue); }.auth-card .field input::placeholder { color: rgba(255,255,255,.25); }
.auth-card .form-grid { gap: 15px; }.auth-submit { width: 100%; margin-top: 8px; }.auth-note { margin: 20px 0 0; color: rgba(255,255,255,.35); font-size: .62rem; text-align: center; }
.setup-steps { display: flex; gap: 8px; margin: 0 0 25px; padding: 0; list-style: none; }.setup-steps li { flex: 1; height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; }.setup-steps li.active { background: var(--admin-blue); }

.settings-nav { display: flex; gap: 5px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--admin-line); background: #fff; border-radius: 10px; }.settings-nav a { padding: 9px 13px; color: var(--admin-muted); border-radius: 7px; font-size: .67rem; font-weight: 700; }.settings-nav a.active { color: #fff; background: var(--admin-blue); }
.secret-state { display: inline-flex; margin-top: 6px; padding: 4px 7px; color: var(--admin-success); background: #e6f7f0; border-radius: 5px; font-size: .55rem; font-weight: 700; }

.pwa-install-action { display: none; align-items: center; gap: 12px; width: 100%; min-height: 42px; margin-bottom: 8px; padding: 0 12px; border: 1px solid rgba(22,131,255,.24); color: rgba(255,255,255,.72); background: rgba(22,131,255,.1); border-radius: 8px; font: inherit; font-size: .72rem; font-weight: 650; text-align: left; cursor: pointer; }
.pwa-install-action:hover { color: #fff; background: rgba(22,131,255,.18); }
.pwa-install-action .nav-icon { flex: 0 0 auto; }
.pwa-guide-overlay { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5,10,18,.66); backdrop-filter: blur(8px); }
.pwa-guide-overlay[hidden], .push-consent[hidden], [data-push-enable][hidden], [data-push-disable][hidden] { display: none !important; }
.pwa-guide-dialog { position: relative; width: min(100%, 420px); padding: 30px; background: #fff; border-radius: 16px; box-shadow: 0 28px 80px rgba(0,0,0,.28); text-align: center; }
.pwa-guide-dialog h2 { margin: 12px 0 8px; font-size: 1.25rem; letter-spacing: -.035em; }
.pwa-guide-dialog p { margin: 0 0 22px; color: var(--admin-muted); font-size: .75rem; line-height: 1.7; }
.pwa-guide-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; color: var(--admin-muted); background: transparent; border-radius: 8px; font-size: 1.25rem; cursor: pointer; }
.pwa-guide-close:hover { background: #f0f3f7; }
.pwa-guide-icon { display: grid; width: 48px; height: 48px; margin: 0 auto; place-items: center; color: #fff; background: var(--admin-blue); border-radius: 13px; font-size: 1.35rem; font-weight: 800; }

.push-settings { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,360px); align-items: start; gap: 16px; }
.push-settings-main, .push-settings-info { overflow: hidden; }
.push-settings-body { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; }
.push-device-icon { display: grid; width: 48px; height: 48px; place-items: center; color: var(--admin-blue); background: var(--admin-blue-soft); border-radius: 13px; }
.push-device-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.push-settings-copy strong { display: block; margin-bottom: 4px; font-size: .78rem; }
.push-settings-copy p { margin: 0; color: var(--admin-muted); font-size: .68rem; line-height: 1.6; }
.push-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.push-state-badge { display: inline-flex; align-items: center; padding: 5px 9px; color: var(--admin-muted); background: #eef1f5; border-radius: 20px; font-size: .56rem; font-weight: 780; white-space: nowrap; }
.push-state-badge[data-tone="success"] { color: var(--admin-success); background: #e6f7f0; }
.push-state-badge[data-tone="warning"] { color: #9a6500; background: #fff4d8; }
.push-state-badge[data-tone="danger"] { color: var(--admin-danger); background: #fff0f0; }
.push-consent { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-top: 1px solid var(--admin-line); background: #f8fbff; }
.push-consent strong { display: block; margin-bottom: 4px; font-size: .75rem; }
.push-consent p { max-width: 620px; margin: 0; color: var(--admin-muted); font-size: .65rem; line-height: 1.6; }
.push-consent > div:last-child { display: flex; flex: 0 0 auto; gap: 7px; }
.push-facts { display: grid; gap: 13px; margin: 0; }
.push-facts div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--admin-line); }
.push-facts div:last-child { padding-bottom: 0; border: 0; }
.push-facts dt { color: var(--admin-muted); font-size: .64rem; }
.push-facts dd { margin: 0; color: var(--admin-ink); font-size: .66rem; font-weight: 700; text-align: right; }
.push-ios-note { margin: 20px 0 0; padding: 13px; color: var(--admin-muted); background: #f6f8fb; border-radius: 8px; font-size: .62rem; line-height: 1.6; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .field:first-child { grid-column: span 2; }
  .col-3 { grid-column: span 6; }
  .signature-editor-grid { grid-template-columns: 1fr; }
  .signature-live-preview { position: static; }
  .push-settings { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s ease; box-shadow: 25px 0 60px rgba(0,0,0,.25); }.nav-open .sidebar { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .topbar { min-height: 68px; padding: 0 18px; }.mobile-toggle { display: block; }.topbar-title { margin-right: auto; margin-left: 12px; }.topbar-title p { display: none; }
  .admin-content { padding: 24px 18px 50px; }
  .page-intro { align-items: flex-start; flex-direction: column; }.page-intro-actions { justify-content: flex-start; }
  .col-8,.col-6,.col-4 { grid-column: span 12; }
  .quote-summary { justify-content: stretch; }
  .totals-card { width: 100%; }
  .document-preview { padding: 10px; }.document-sheet { transform: scale(.72); margin-bottom: -84mm; }
  .inbox-detail-grid { grid-template-columns: 1fr; }
  .inbox-page-intro .page-intro-actions, .inbox-page-intro .page-intro-actions form { width: 100%; }
  .signatures-grid { grid-template-columns: 1fr; }
  .pwa-install-action:not([hidden]) { display: flex; }
  .push-settings-body { grid-template-columns: auto minmax(0,1fr); }
  .push-settings-actions { grid-column: 1 / -1; justify-content: stretch; }
  .push-settings-actions .button { flex: 1; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }.filters .field:first-child { grid-column: auto; }.filter-actions { align-items: stretch; }
  .form-section { padding: 18px 14px; }.col-3 { grid-column: span 12; }
  .form-actions { position: static; align-items: stretch; flex-direction: column; }.form-actions-group { display: grid; grid-template-columns: 1fr; }.form-actions .button { width: 100%; }
  .topbar-actions .button span { display: none; }.topbar-actions .button { width: 40px; padding: 0; }
  .auth-card { padding: 27px 20px; }
  .settings-nav { overflow-x: auto; }.settings-nav a { white-space: nowrap; }
  .document-sheet { transform: scale(.46); margin-bottom: -160mm; }
  .inbox-page-intro .page-intro-actions form { display: grid; grid-template-columns: 1fr; }
  .inbox-summary { min-width: 240px; }
  .signature-card-actions { align-items: stretch; flex-direction: column; }
  .signature-card-actions .button, .signature-card-actions form { width: 100%; }
  .signature-card-actions form { display: grid; grid-template-columns: 1fr; }
  .push-consent { align-items: stretch; flex-direction: column; }
  .push-consent > div:last-child { display: grid; grid-template-columns: 1fr; }
  .push-settings-body { grid-template-columns: 1fr; }
  .push-device-icon { width: 42px; height: 42px; }
}

@media print {
  .sidebar,.topbar,.page-intro,.form-actions,.no-print { display:none!important; }.admin-main { margin:0; }.admin-content { width:100%;padding:0; }.document-preview { padding:0;background:#fff; }.document-sheet { box-shadow:none; }
}
