:root {
  --navy: #0e2a55; --navy-2: #173b70; --gold: #d99b20; --gold-pale: #fff5da;
  --ink: #12294d; --muted: #68758a; --paper: #fff; --shell: #f4f5f3;
  --line: #dde2e8; --danger: #a72c38; --success: #217a54;
  --shadow: 0 18px 60px rgba(14, 42, 85, .1);
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--shell); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(217,155,32,.55); outline-offset: 2px; }
.kicker { display: block; margin-bottom: 8px; color: #8a671d; font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.signin { width: min(560px, calc(100% - 32px)); margin: max(8vh, 48px) auto; padding: clamp(32px, 6vw, 64px); background: var(--paper); border: 1px solid var(--line); border-radius: 40px; box-shadow: var(--shadow); text-align: center; }
.signin__brand { width: 86px; height: 86px; margin: 0 auto 28px; overflow: hidden; border-radius: 24px; background: var(--shell); }
.signin__brand img { width: 100%; height: 100%; object-fit: contain; }
.signin h1,
.signin h2 { max-width: 12ch; margin: 0 auto 20px; font-size: clamp(38px, 7vw, 60px); font-weight: 350; line-height: .98; letter-spacing: -.04em; }
.signin > p { max-width: 44ch; margin: 0 auto 28px; color: var(--muted); line-height: 1.65; }
.signin .button { width: 100%; justify-content: center; margin-top: 6px; }
.signin .signin__hint { margin: 18px auto 0; font-size: 12px; }
.workspace { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 260px; display: flex; flex-direction: column; padding: 28px 20px 22px; color: #fff; background: var(--navy); }
.sidebar__brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.sidebar__brand img { width: 44px; height: 44px; border-radius: 12px; background: #fff; }
.sidebar__brand span { display: grid; gap: 2px; }
.sidebar__brand strong { font-size: 15px; letter-spacing: .16em; }
.sidebar__brand small { color: rgba(255,255,255,.55); font-size: 9px; letter-spacing: .2em; }
.side-nav { display: grid; gap: 5px; margin-top: 52px; }
.side-nav button { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 14px; color: rgba(255,255,255,.68); background: transparent; border: 0; border-radius: 14px; text-align: left; }
.side-nav button span { color: rgba(255,255,255,.35); font-size: 10px; letter-spacing: .12em; }
.side-nav button:hover, .side-nav button.is-active { color: #fff; background: rgba(255,255,255,.1); }
.side-nav b { margin-left: auto; min-width: 23px; padding: 3px 7px; color: #2b210d; background: var(--gold); border-radius: 99px; font-size: 10px; text-align: center; }
.sidebar__foot { display: grid; gap: 12px; margin-top: auto; padding: 18px 14px 0; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar__foot a, .sidebar__foot button { padding: 0; color: rgba(255,255,255,.76); background: none; border: 0; text-align: left; text-decoration: none; }
.sidebar__foot small { overflow: hidden; color: rgba(255,255,255,.4); text-overflow: ellipsis; }
.admin-main { min-height: 100vh; margin-left: 260px; padding: 34px clamp(24px, 4vw, 60px) 70px; }
.topbar { display: flex; align-items: center; gap: 24px; margin-bottom: 36px; }
.topbar h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 350; letter-spacing: -.035em; }
.topbar__actions { display: flex; gap: 10px; margin-left: auto; }
.menu-button { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 18px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 13px; font-weight: 650; text-decoration: none; }
.button:hover { border-color: #aab5c2; }
.button--primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.button--primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.button--call { color: var(--navy); }
.button--danger { color: var(--danger); background: #fff4f5; border-color: #f0cdd1; }
.text-button { padding: 8px; color: var(--navy); background: none; border: 0; font-weight: 650; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44vh; color: var(--muted); }
.loading span { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view { animation: enter .25s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.metric { min-height: 172px; display: flex; flex-direction: column; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; }
.metric > span { color: var(--muted); font-size: 13px; }
.metric strong { margin-top: auto; font-size: 48px; font-weight: 350; line-height: 1; }
.metric small { margin-top: 8px; color: var(--muted); }
.metric--dark { color: #fff; background: var(--navy); border-color: var(--navy); }
.metric--dark > span, .metric--dark small { color: rgba(255,255,255,.62); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,.75fr); gap: 16px; margin-top: 16px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel__head h3 { margin: 0; font-size: 25px; font-weight: 450; }
.dashboard-grid > .panel { padding: 26px; }
.lead-list { display: grid; }
.recent-lead { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.recent-lead:last-child { border-bottom: 0; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; color: var(--navy); background: var(--gold-pale); border-radius: 14px; font-weight: 750; }
.recent-lead strong, .recent-lead small { display: block; }
.recent-lead small { margin-top: 4px; color: var(--muted); }
.quick-grid { display: grid; gap: 9px; margin-top: 20px; }
.quick-grid button { padding: 16px; color: var(--ink); background: var(--shell); border: 0; border-radius: 15px; font-weight: 700; text-align: left; }
.quick-grid small { display: block; margin: 5px 0 0 24px; color: var(--muted); font-weight: 400; }
.toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.toolbar label { flex: 0 1 230px; }
.toolbar .search { flex: 1 1 360px; }
label { display: grid; gap: 8px; }
label > span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
label > small { color: var(--muted); line-height: 1.45; }
input, textarea, select { width: 100%; padding: 12px 14px; color: var(--ink); background: #fff; border: 1px solid #ccd4de; border-radius: 12px; }
textarea { resize: vertical; line-height: 1.55; }
.lead-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(340px,.7fr); gap: 16px; align-items: start; }
.lead-table-wrap { overflow: hidden; }
.lead-table { width: 100%; border-collapse: collapse; }
.lead-table th { padding: 15px 18px; color: var(--muted); background: #f8f9f8; font-size: 11px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.lead-table td { padding: 17px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.lead-table tbody tr { cursor: pointer; }
.lead-table tbody tr:hover, .lead-table tbody tr.is-active { background: #faf8f1; }
.lead-table strong, .lead-table small { display: block; }
.lead-table small { margin-top: 4px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; padding: 5px 9px; color: #495668; background: #eef1f4; border-radius: 99px; font-size: 11px; font-weight: 750; text-transform: capitalize; }
.pill--new { color: #8b5d05; background: #fff1c7; }
.pill--contacted { color: #265a8c; background: #e6f2ff; }
.pill--qualified { color: #6b448e; background: #f2eaff; }
.pill--won { color: #17633f; background: #dcf5e8; }
.pill--closed { color: #6b717a; background: #eceff1; }
.lead-detail { position: sticky; top: 20px; min-height: 320px; padding: 24px; }
.lead-detail h3 { margin: 0; font-size: 28px; font-weight: 450; }
.lead-detail__top { display: flex; justify-content: space-between; gap: 16px; }
.lead-detail__meta { margin: 6px 0 24px; color: var(--muted); }
.lead-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; }
.lead-actions .button { padding-inline: 10px; }
.detail-list { display: grid; gap: 0; margin: 20px 0; }
.detail-list div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.lead-detail textarea { min-height: 110px; }
.lead-detail .button--primary { width: 100%; margin-top: 10px; }
.empty { padding: 34px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 8px; color: var(--ink); }
.content-layout, .settings-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.form-panel { display: grid; gap: 19px; padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.save-state { color: var(--success); font-size: 12px; }
.seed-panel { grid-column: 1 / -1; }
.seed-panel > p { max-width: 76ch; margin: 0; color: var(--muted); line-height: 1.6; }
.seed-panel .form-actions { align-items: center; }
.panel-view { animation: enter .25s ease both; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.view-head h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 350; letter-spacing: -.035em; }
.view-head p { max-width: 58ch; margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.view-head__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
[data-copy-form] { display: grid; gap: 16px; }
[data-copy-form] > .form-panel { align-content: start; }
.copy-group { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; }
.copy-group legend { grid-column: 1 / -1; padding: 0 8px; }
.copy-group label:has(textarea) { grid-column: 1 / -1; }
.copy-group label small { overflow-wrap: anywhere; font-size: 10px; opacity: .72; }
.copy-toggle { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; }
.copy-toggle input { width: 40px; height: 22px; margin: 0; accent-color: var(--navy); }
.copy-toggle span { color: var(--ink); font-size: 14px; letter-spacing: 0; }
.section-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-actions p { margin: 0; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.project-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.project-card__image { aspect-ratio: 16/10; background: #e9edf1; }
.project-card__image img { width: 100%; height: 100%; object-fit: cover; }
.project-card__body { padding: 19px; }
.project-card__body > span { color: var(--muted); font-size: 12px; }
.project-card h3 { margin: 7px 0 14px; font-size: 21px; }
.project-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.url-library { display: grid; grid-template-columns: minmax(220px,1fr) minmax(240px,1.2fr) minmax(220px,1fr) auto; align-items: end; gap: 16px; padding: 26px; }
.url-library strong { display: block; font-size: 22px; font-weight: 500; }
.url-library p { max-width: 50ch; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.media-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.media-card { position: relative; overflow: hidden; aspect-ratio: 1; background: #e5e9ed; border-radius: 18px; }
.media-card img { width: 100%; height: 100%; object-fit: cover; }
.media-card__actions { position: absolute; inset: auto 8px 8px; display: flex; justify-content: space-between; gap: 6px; padding: 7px; background: rgba(8,22,43,.82); border-radius: 12px; }
.media-card button { padding: 6px 9px; color: #fff; background: transparent; border: 0; font-size: 12px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { max-width: 48ch; margin-top: 5px; color: var(--muted); line-height: 1.5; }
.setting-row code { max-width: 48%; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.editor { width: min(820px, calc(100% - 28px)); max-width: none; padding: 0; border: 0; border-radius: 26px; box-shadow: 0 28px 90px rgba(3,15,34,.35); }
.editor::backdrop { background: rgba(6,18,37,.62); backdrop-filter: blur(4px); }
.editor__shell { max-height: min(880px, calc(100vh - 28px)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.editor header, .editor footer { display: flex; align-items: center; gap: 10px; padding: 20px 24px; }
.editor header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.editor header h2 { margin: 0; font-size: 30px; font-weight: 400; }
.editor footer { justify-content: end; border-top: 1px solid var(--line); }
.editor footer span { flex: 1; }
.editor__body { display: grid; gap: 17px; padding: 24px; overflow: auto; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; background: var(--shell); border: 0; border-radius: 50%; font-size: 25px; }
.check-row { display: flex; flex-wrap: wrap; gap: 22px; }
.check-row label { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.notice { padding: 12px 14px; border-radius: 12px; }
.notice--error { color: var(--danger) !important; background: #fff0f2; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(420px, calc(100% - 32px)); padding: 14px 18px; color: #fff; background: var(--navy); border-radius: 14px; box-shadow: var(--shadow); }
.toast.is-error { background: var(--danger); }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid, .lead-layout { grid-template-columns: 1fr; }
  .lead-detail { position: static; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .url-library { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  body.menu-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.25); }
  .admin-main { margin-left: 0; padding: 22px 16px 50px; }
  .menu-button { display: inline-flex; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
  .topbar__actions .button--call { display: none; }
  .content-layout, .settings-layout { grid-template-columns: 1fr; }
  .view-head { align-items: stretch; flex-direction: column; }
  .view-head__actions { justify-content: flex-start; }
  .lead-table th:nth-child(2), .lead-table td:nth-child(2) { display: none; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar__actions { width: 100%; margin: 0; }
  .topbar__actions .button { width: 100%; }
  .metric-grid, .project-grid { grid-template-columns: 1fr; }
  .metric { min-height: 140px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar label, .toolbar .search { flex-basis: auto; width: 100%; }
  .toolbar .button { width: 100%; }
  .lead-table th, .lead-table td { padding-inline: 12px; }
  .lead-table th:nth-child(3), .lead-table td:nth-child(3) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .copy-group { grid-template-columns: 1fr; padding: 16px; }
  .copy-group label:has(textarea) { grid-column: auto; }
  .media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .url-library { grid-template-columns: 1fr; }
  .section-actions { align-items: stretch; flex-direction: column; }
  .editor footer { flex-wrap: wrap; }
  .editor footer span { display: none; }
  .editor footer .button { flex: 1; }
  .signin { margin-block: 16px; border-radius: 28px; }
}
