/* ==========================================================================
   ASLcode Admin — same tokens as the public site (style.css)
   ========================================================================== */
:root {
  --bg: #F7F4EE;
  --card: #FFFFFF;
  --ink: #0B1E3F;
  --ink-soft: #4A5568;
  --navy: #0B1E3F;
  --navy-2: #13294F;
  --green: #006C35;
  --green-dark: #00552A;
  --green-tint: #e6f3ec;
  --sand: #C9A96E;
  --sand-tint: #f5eddd;
  --border: #E4DFD4;
  --danger: #b3261e;
  --font: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(11,30,63,.04), 0 8px 24px -12px rgba(11,30,63,.12);
  --sadu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8'%3E%3Cpath d='M0 8 6 0 12 8z' fill='%23006C35'/%3E%3Cpath d='M12 0h12l-6 8z' fill='%23C9A96E'/%3E%3C/svg%3E");
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 2 46 24 24 46 2 24z' fill='none' stroke='%23C9A96E' stroke-width='1'/%3E%3Cpath d='M24 16 32 24 24 32 16 24z' fill='%23C9A96E'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { color: var(--ink-soft); margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* ---------------- Shell ---------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 248px; flex: none; background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 0 14px 18px; overflow-y: auto;
}
.admin-sidebar::before { content: ''; display: block; height: 8px; margin: 0 -14px; background: var(--sadu) repeat-x; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 22px 10px 26px; color: #fff; }
.admin-brand .logo-img { display: block; height: 30px; width: auto; max-width: 150px; object-fit: contain; }
.logo-invert { filter: brightness(0) invert(1); }
.admin-brand:hover { text-decoration: none; }
.admin-brand b { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.admin-brand b span { color: var(--sand); }
.admin-brand small { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav .nav-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 18px 12px 8px; }
.admin-nav a, .admin-sidebar-foot a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px;
  color: rgba(255,255,255,.75); font-size: 14px; font-weight: 500; position: relative;
  transition: background .15s ease, color .15s ease;
}
.admin-nav a:hover, .admin-sidebar-foot a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.admin-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-nav a.active::before { content: ''; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sand); }
.admin-nav a.active .icon { color: var(--sand); }
.nav-badge { margin-inline-start: auto; background: var(--sand); color: var(--navy); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.admin-sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }

.admin-main { flex: 1; min-width: 0; padding: 28px 40px 60px; }
.admin-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 26px; margin: 0; }
.admin-topbar p { margin: 4px 0 0; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.user-chip b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--sand); font-size: 13px; text-transform: uppercase; }
.admin-content { max-width: 1200px; }

/* ---------------- Cards & layout ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-head a { font-size: 13px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid-2 > *, .grid-3-1 > *, .kpi-grid > * { min-width: 0; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--border); }
.kpi.accent::after { background: var(--green); }
.kpi.sand::after { background: var(--sand); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.kpi-label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.kpi-icon { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; background: var(--green-tint); color: var(--green); }
.kpi.sand .kpi-icon { background: var(--sand-tint); color: #8a6a2e; }
.kpi strong { display: block; font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }

/* Horizontal bars (leads by type/status) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 26px minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 14px; }
.hbar .icon { color: var(--ink-soft); }
.hbar-label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hbar-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; width: var(--w); background: var(--green); border-radius: 3px; transform-origin: left; animation: grow-x .8s cubic-bezier(.2,.7,.2,1); }
.hbar b { text-align: end; font-variant-numeric: tabular-nums; }
a.hbar { color: inherit; border-radius: 4px; }
a.hbar:hover { text-decoration: none; background: #fcfbf8; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; justify-self: center; }
.s-new { background: var(--sand); } .s-contacted { background: #2a4a86; } .s-won { background: var(--green); } .s-lost { background: #a3a3a3; }
.mt { margin-top: 20px; }

/* Weekly column chart */
.cols { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; align-items: end; height: 170px; padding-top: 18px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.col i { width: 100%; max-width: 38px; height: var(--h); min-height: 3px; background: linear-gradient(var(--green), #2f8f5b); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: grow-y .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 50ms); }
.col:last-child i { background: var(--sand); }
.col b { font-size: 12px; font-variant-numeric: tabular-nums; }
.col span { font-family: var(--mono); font-size: 10px; color: var(--ink-soft); white-space: nowrap; max-width: 100%; overflow: hidden; }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px;
  border-radius: 6px; border: 1px solid transparent; font: 600 14px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: #fdecec; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 15px; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.field-hint.is-error { color: var(--danger); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.card-narrow { max-width: 860px; }
.card-sm { max-width: 440px; }
.card-head.spaced { margin-top: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 6px; border: 1px solid var(--border); background: #fff;
  font: 15px var(--font); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,108,53,.12); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.input-icon input { padding-inline-start: 38px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 24px 0 16px; margin-top: 8px; z-index: 5; }

/* ---------------- Alerts / badges / pills ---------------- */
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; animation: pop .35s ease; }
.alert-success { background: var(--green-tint); color: var(--green-dark); border: 1px solid #b7dcc7; }
.alert-error { background: #fdecec; color: #8a2e28; border: 1px solid #f5c6c3; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--border); font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.badge-green { background: var(--green-tint); color: var(--green-dark); border-color: #b7dcc7; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-new { background: var(--sand-tint); color: #8a6a2e; }
.pill-contacted { background: #e8eef8; color: #2a4a86; }
.pill-won { background: var(--green-tint); color: var(--green-dark); }
.pill-lost { background: #efefef; color: #6b6b6b; }
.dot-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }

/* ---------------- Tabs / filters ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--green); }
.tabs a span { font-size: 12px; font-variant-numeric: tabular-nums; background: var(--bg); padding: 0 7px; border-radius: 999px; color: var(--ink-soft); }
.tabs a.active span { background: var(--green); color: #fff; }
.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filters .input-icon { flex: 1; min-width: 220px; }
.filters.flush { margin: 0; }
.filters select { width: auto; min-width: 200px; }

/* ---------------- Leads ---------------- */
.lead-list { display: flex; flex-direction: column; gap: 12px; }
.lead { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s ease; }
.lead:hover { border-color: #d6ccb6; }
.lead.is-unread { border-inline-start: 3px solid var(--green); }
.lead-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; }
.lead-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--sand); display: grid; place-items: center; font-weight: 700; text-transform: uppercase; }
.lead-who { min-width: 0; }
.lead-who strong { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.lead-who span { display: block; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lead-date { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); }
.type-chip .icon { width: 14px; height: 14px; color: var(--green); }
.lead details { border-top: 1px solid var(--border); }
.lead summary { list-style: none; cursor: pointer; padding: 12px 20px; font-size: 14px; color: var(--ink-soft); display: flex; gap: 10px; }
.lead summary::-webkit-details-marker { display: none; }
.lead summary .excerpt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead summary::after { content: '+'; font-family: var(--mono); color: var(--green); }
.lead details[open] summary::after { content: '−'; }
.lead details[open] .excerpt { display: none; }
.lead-body { padding: 0 20px 16px; white-space: pre-wrap; font-size: 15px; color: var(--ink); }
.lead-body, .lead summary .excerpt { text-align: start; unicode-bidi: plaintext; }
.lead-actions { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: #fcfbf8; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.lead-actions form { margin: 0; }
.lead-actions select { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; }
.lead-actions .spacer { flex: 1; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty .icon { width: 40px; height: 40px; color: var(--sand); margin-bottom: 8px; }

/* Recent leads (dashboard) */
.mini-leads { display: flex; flex-direction: column; }
.mini-lead { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); color: var(--ink); }
.mini-lead:first-child { border-top: 0; }
.mini-lead:hover { text-decoration: none; background: #fcfbf8; }
.mini-lead .lead-avatar { width: 36px; height: 36px; font-size: 13px; }
.mini-lead strong { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.mini-text { min-width: 0; }
.mini-text > span { font-size: 12px; color: var(--ink-soft); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shortcut { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); font-size: 14px; font-weight: 500; transition: border-color .15s ease, background .15s ease; }
.shortcut:hover { border-color: var(--green); background: var(--green-tint); text-decoration: none; }
.shortcut .icon { color: var(--green); }

/* ---------------- Photos ---------------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.photo-slot { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.photo-slot figure { margin: 0; aspect-ratio: 3 / 2; background: var(--bg) var(--lattice); position: relative; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot figure .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.photo-slot-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.photo-slot-body strong { font-size: 14px; }
.file-pick { display: flex; gap: 8px; align-items: center; }
.file-pick input[type=file] { flex: 1; min-width: 0; font-size: 13px; }
.file-pick input[type=file]::file-selector-button { font: 600 13px var(--font); border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 6px 10px; margin-inline-end: 8px; cursor: pointer; }

.section-title { font-size: 13px; font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--green); margin: 8px 0 12px; }
.brand-grid { margin-bottom: 36px; }
.brand-slot figure { aspect-ratio: 5 / 2; display: grid; place-items: center; background: #fff; border-bottom: 1px solid var(--border); }
.brand-slot figure img { width: auto; height: auto; max-width: 70%; max-height: 50%; object-fit: contain; }
.brand-slot.on-dark figure { background: var(--navy); }
.brand-slot.preview-invert figure img { filter: brightness(0) invert(1); }
.brand-slot.icon-slot figure img { width: 64px; height: 64px; max-width: none; max-height: none; border-radius: 12px; object-fit: cover; }
.wordmark { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.wordmark span { color: var(--green); }
.on-dark .wordmark { color: #fff; } .on-dark .wordmark span { color: var(--sand); }
.icon-slot .wordmark { font-size: 0; } .icon-slot .wordmark::before { content: 'A'; font-size: 30px; width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--sand); }
.photo-slot-body .field-hint { margin: -6px 0 0; }

/* ---------------- Website text editor ---------------- */
.text-toolbar { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 4px 0 12px; display: flex; flex-direction: column; gap: 12px; }
.text-group { margin-bottom: 28px; }
.text-group h2 { font-size: 13px; font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--green); margin: 0 0 10px; }
.text-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.text-row.is-edited { border-inline-start: 3px solid var(--sand); }
.text-row label { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-soft); display: flex; justify-content: space-between; margin-bottom: 4px; }
.text-row label em { font-style: normal; color: #8a6a2e; }
.text-row textarea { min-height: 44px; font-size: 14px; padding: 8px 10px; }
.text-row textarea:not(:placeholder-shown) { background: #fffdf7; border-color: var(--sand); }
.text-row textarea[dir=rtl] { font-family: 'IBM Plex Sans Arabic', var(--font); }
.text-row[hidden] { display: none; }

/* ---------------- Login ---------------- */
.login-body { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--navy) var(--lattice); position: relative; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-side::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,30,63,.4), var(--navy) 85%); }
.login-side > * { position: relative; }
.login-side::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--sadu) repeat-x; }
.login-side .admin-brand { padding: 0; }
.login-side h2 { font-size: 34px; line-height: 1.15; max-width: 14ch; color: #fff; }
.login-side p { color: rgba(255,255,255,.7); max-width: 40ch; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card > p { margin-bottom: 28px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 48px; }
.pw-toggle { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); background: none; border: 0; padding: 8px; color: var(--ink-soft); cursor: pointer; border-radius: 4px; }
.pw-toggle:hover { color: var(--ink); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: auto; height: auto; position: sticky; z-index: 20; padding: 0 12px; flex-direction: row; align-items: center; gap: 8px; overflow: visible; }
  .admin-sidebar::before { position: absolute; top: 0; left: 0; right: 0; margin: 0; }
  .admin-brand { padding: 18px 4px 12px; flex: none; }
  .admin-brand small { display: none; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to var(--end, right), #000 80%, transparent); mask-image: linear-gradient(to var(--end, right), #000 80%, transparent); }
  .admin-nav .nav-label, .admin-nav .label-text { display: none; }
  .admin-nav a { padding: 10px; }
  .admin-nav a.active::before { inset-inline-start: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .admin-sidebar-foot { flex-direction: row; border: 0; padding: 0; margin-inline-start: auto; }
  .admin-sidebar-foot a { padding: 10px; }
  .admin-sidebar-foot .label-text { display: none; }
  .admin-main { padding: 20px 16px 48px; }
  .text-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .login-body { grid-template-columns: 1fr; }
  .login-side { padding: 32px 24px; min-height: 220px; }
  .login-side h2 { font-size: 24px; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 24px; }
  .lead-head { grid-template-columns: 36px minmax(0, 1fr); }
  .lead-avatar { width: 36px; height: 36px; }
  .lead-meta { grid-column: 1 / -1; justify-content: flex-start; }
  .shortcuts { grid-template-columns: 1fr; }
  .cols { gap: 4px; }
  .col span { font-size: 9px; }
  .filters select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
