/* ==========================================================================
   Apptosd Support Center – design system v4
   One stylesheet for the help center, customer area and admin panel.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --brand: #236ED1;
  --brand-600: color-mix(in srgb, var(--brand) 88%, #000);
  --brand-700: color-mix(in srgb, var(--brand) 75%, #000);
  --brand-50: color-mix(in srgb, var(--brand) 7%, #fff);
  --brand-100: color-mix(in srgb, var(--brand) 14%, #fff);
  --accent: #EF830B;

  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #e3e7ef;
  --border-strong: #cfd6e3;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --muted-bg: #f1f4f9;

  --success: #16a34a; --success-bg: #e9f8ef;
  --warning: #b45309; --warning-bg: #fff4e0;
  --danger:  #dc2626; --danger-bg:  #fdecec;
  --info:    var(--brand); --info-bg: var(--brand-50);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px -8px rgba(15, 23, 42, .12);
  --shadow-lg: 0 20px 50px -20px rgba(15, 23, 42, .28);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1180px;
  --header-h: 68px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --surface: #111a2e;
  --surface-2: #0f1729;
  --border: #1f2a44;
  --border-strong: #2b3a5c;
  --text: #e8edf7;
  --text-2: #b4c0d6;
  --text-3: #8c9ab4;
  --muted-bg: #16213a;
  --brand-50: color-mix(in srgb, var(--brand) 16%, #0b1120);
  --brand-100: color-mix(in srgb, var(--brand) 26%, #0b1120);
  --success-bg: #0f2c1d; --warning-bg: #2d2110; --danger-bg: #2f1418;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 750; }
h2 { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 820px; }
.container-md { max-width: 980px; }
.stack > * + * { margin-top: var(--stack, 1rem); }
.row { display: flex; gap: 12px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.text-muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-sm { font-size: .88rem; }
.text-xs { font-size: .78rem; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2.5rem; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title h2 { margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }

@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .section { padding: 40px 0; } }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; font-size: .93rem; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--btn-fg); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { --btn-bg: var(--brand-600); --btn-bd: var(--brand-600); color: #fff; }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); }
.btn-accent:hover { filter: brightness(.95); color: #fff; }
.btn-soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand); --btn-bd: transparent; }
.btn-soft:hover { --btn-bg: var(--brand-100); border-color: transparent; color: var(--brand-700); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--muted-bg); border-color: transparent; color: var(--text); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.btn-danger-soft { --btn-bg: var(--danger-bg); --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn .spinner { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 22px; }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.02rem; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .2s, transform .2s; }
.card-link:hover { color: inherit; border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap; background: var(--muted-bg); color: var(--text-2); }
.badge-info { background: var(--info-bg); color: var(--brand); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--muted-bg); color: var(--text-3); }
.badge-outline { background: transparent; border: 1px solid currentColor; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .86rem; font-weight: 550; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active, .chip:has(input:checked) { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--muted-bg); color: var(--text-2); }
.count-brand { background: var(--brand); color: #fff; }
.count-danger { background: var(--danger); color: #fff; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: .9rem; margin-bottom: 7px; color: var(--text); }
.label .opt { font-weight: 500; color: var(--text-3); font-size: .8rem; }
.hint { font-size: .82rem; color: var(--text-3); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: .95rem; transition: border-color .15s, box-shadow .15s; appearance: none;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.select { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.is-invalid, .is-invalid:focus { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent) !important; }
.invalid { color: var(--danger); font-size: .82rem; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.input-group { position: relative; }
.input-group .icon-left { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group .input { padding-left: 40px; }
.input-group .input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .92rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch-text strong { display: block; font-size: .95rem; }
.switch-text span { display: block; font-size: .84rem; color: var(--text-3); }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.strength { height: 4px; border-radius: 4px; background: var(--border); margin-top: 8px; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }

/* Dropzone */
.dropzone { position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; text-align: center; background: var(--surface-2); color: var(--text-3); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { color: var(--text); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--muted-bg); font-size: .82rem; color: var(--text-2); max-width: 260px; }
.file-pill .truncate { max-width: 170px; }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid transparent; font-size: .93rem; }
.alert .icon { margin-top: 2px; }
.alert-info { background: var(--info-bg); color: var(--text); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.alert-info > .icon { color: var(--brand); }
.alert-success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-success > .icon { color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-warning > .icon { color: var(--warning); }
.alert-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-danger > .icon { color: var(--danger); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.toasts { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .25s ease-out; }
.toast .icon { margin-top: 2px; }
.toast-success .icon { color: var(--success); } .toast-error .icon { color: var(--danger); } .toast-info .icon { color: var(--brand); } .toast-warning .icon { color: var(--warning); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 0 0 0 6px; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table a.row-link { color: var(--text); font-weight: 600; }
.table a.row-link:hover { color: var(--brand); }

/* ---------- Avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--muted-bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: var(--text-2); overflow: hidden; }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.6rem; }
.avatar-bot { background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; }
.avatar-bot .icon { width: 55%; height: 55%; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.dropdown.is-open .dropdown-menu { display: block; animation: toast-in .15s ease-out; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 9px; color: var(--text-2); font-size: .92rem; background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown-item:hover { background: var(--muted-bg); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-header { padding: 10px 11px 8px; }
.notif-list { max-height: 360px; overflow: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 11px; border-radius: 10px; color: var(--text-2); font-size: .88rem; }
.notif-item:hover { background: var(--muted-bg); color: var(--text); }
.notif-item.unread { background: var(--brand-50); color: var(--text); }
.notif-item img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 16, 30, .55); backdrop-filter: blur(3px); }
.modal-body { padding: 24px; }
.modal-footer { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; background: var(--danger-bg); color: var(--danger); }
.modal-icon .icon { width: 24px; height: 24px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--text-3); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--muted-bg); border-radius: 12px; flex-wrap: wrap; }
.segmented a { padding: 7px 12px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.segmented a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Pagination / breadcrumb ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; margin: 24px 0 0; padding: 0; list-style: none; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .9rem; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .is-active span { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .is-disabled span { opacity: .45; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; list-style: none; margin: 0 0 14px; padding: 0; font-size: .86rem; color: var(--text-3); }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "/"; opacity: .5; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ==========================================================================
   Public site
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 1.05rem; flex: none; }
.brand img { height: 30px; width: auto; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.brand-tag { font-size: .72rem; font-weight: 650; color: var(--brand); background: var(--brand-50); padding: 3px 8px; border-radius: 999px; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .93rem; }
.nav a:hover, .nav a.is-active { color: var(--text); background: var(--muted-bg); }
.header-search { flex: 1; max-width: 420px; margin-left: auto; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-search + .header-actions { margin-left: 0; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .nav, .header-search { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions .hide-sm { display: none; }
}
.mobile-nav { display: none; position: fixed; inset: var(--header-h) 0 0; background: var(--surface); z-index: 49; padding: 20px; overflow: auto; }
.mobile-nav.is-open { display: block; }
.mobile-nav a { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 12px; color: var(--text); font-weight: 600; }
.mobile-nav a:hover { background: var(--muted-bg); }

/* Search box */
.search { position: relative; }
.search-input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 44px 0 42px; font-size: .95rem; }
.search-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); font-family: var(--mono); font-size: .72rem; color: var(--text-3); }
.search-lg .search-input { height: 62px; border-radius: 18px; font-size: 1.08rem; padding-left: 54px; padding-right: 120px; box-shadow: var(--shadow-lg); border-color: transparent; }
.search-lg > .icon { left: 20px; width: 22px; height: 22px; }
.search-lg .btn { position: absolute; right: 8px; top: 8px; height: 46px; border-radius: 13px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 70; display: none; max-height: 70vh; overflow: auto; text-align: left; }
.search-results.is-open { display: block; }
.search-result { display: flex; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--text); }
.search-result:hover, .search-result.is-active { background: var(--muted-bg); color: var(--text); }
.search-result .icon { color: var(--text-3); margin-top: 3px; }
.search-result strong { display: block; font-weight: 600; font-size: .94rem; }
.search-result small { display: block; color: var(--text-3); font-size: .82rem; }
.search-result mark, .highlight mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-footer { padding: 10px 12px; border-top: 1px solid var(--border); margin-top: 4px; font-size: .86rem; display: flex; justify-content: space-between; gap: 10px; color: var(--text-3); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 84px; text-align: center; color: #fff; background:
  radial-gradient(1000px 420px at 12% -10%, color-mix(in srgb, #fff 18%, transparent), transparent 60%),
  radial-gradient(800px 380px at 100% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%),
  linear-gradient(135deg, var(--brand-700), var(--brand) 55%, color-mix(in srgb, var(--brand) 70%, #7c3aed)); }
.hero::after { content: ""; position: absolute; inset: auto 0 -1px 0; height: 60px; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.hero h1 { color: #fff; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin-bottom: 12px; }
.hero p.lead { color: rgba(255,255,255,.86); font-size: 1.1rem; max-width: 620px; margin: 0 auto 28px; }
.hero .search { max-width: 680px; margin: 0 auto; color: var(--text); }
.hero-popular { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: .88rem; color: rgba(255,255,255,.8); }
.hero-popular a { color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); padding: 4px 11px; border-radius: 999px; }
.hero-popular a:hover { background: rgba(255,255,255,.24); }
.hero-sm { padding: 44px 0 52px; text-align: left; }
.hero-sm h1 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); }
.hero-sm .breadcrumb, .hero-sm .breadcrumb a { color: rgba(255,255,255,.75); }

/* App (category) cards */
.app-card { padding: 22px; height: 100%; display: flex; flex-direction: column; }
.app-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.app-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); flex: none; }
.app-icon .icon { width: 24px; height: 24px; }
.app-card h3 { margin: 0; font-size: 1.05rem; }
.app-card .meta { font-size: .82rem; color: var(--text-3); }
.app-card ul { list-style: none; padding: 0; margin: 0 0 14px; }
.app-card li a { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; color: var(--text-2); font-size: .9rem; line-height: 1.45; }
.app-card li a .icon { color: var(--text-3); margin-top: 3px; width: 14px; height: 14px; }
.app-card li a:hover { color: var(--brand); }
.app-card .more { margin-top: auto; font-weight: 600; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; }

.list-card { overflow: hidden; }
.list-item { display: flex; gap: 14px; align-items: center; padding: 16px 20px; color: var(--text); border-bottom: 1px solid var(--border); transition: background .12s; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); color: var(--text); }
.list-item .li-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--muted-bg); color: var(--text-3); display: flex; align-items: center; justify-content: center; flex: none; }
.list-item:hover .li-icon { background: var(--brand-50); color: var(--brand); }
.list-item strong { display: block; font-weight: 600; }
.list-item small { display: block; color: var(--text-3); font-size: .85rem; margin-top: 2px; }
.list-item > .icon:last-child { color: var(--text-3); margin-left: auto; }

.cta-band { border-radius: var(--radius-xl); padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; background: linear-gradient(135deg, var(--surface), var(--brand-50)); border: 1px solid var(--border); }
.cta-band h2 { margin-bottom: 8px; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 800px) { .cta-band { grid-template-columns: 1fr; padding: 28px; } .cta-actions { justify-content: flex-start; } }
.steps { counter-reset: step; }
.step { position: relative; padding: 22px; }
.step-num { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 1rem; }
.step p { color: var(--text-2); font-size: .92rem; margin: 0; }

/* Article page */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.article-layout.no-aside { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
@media (max-width: 1000px) { .article-layout { grid-template-columns: 1fr; } .aside-sticky { position: static !important; } }
.aside-sticky { position: sticky; top: calc(var(--header-h) + 20px); }
.article-card { padding: clamp(22px, 4vw, 44px); }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-3); font-size: .86rem; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-meta span { display: inline-flex; gap: 6px; align-items: center; }
.toc { font-size: .9rem; }
.toc h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-2); line-height: 1.4; }
.toc a:hover { color: var(--brand); }
.toc a.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.toc .lvl-h3 a { padding-left: 24px; font-size: .86rem; }
.feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); margin-top: 32px; }
.feedback strong { font-size: 1rem; }

/* Prose (article / page content from the editor) */
.prose { color: var(--text); font-size: 1.02rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.45rem; margin: 2em 0 .6em; }
.prose h3 { font-size: 1.18rem; margin: 1.6em 0 .5em; }
.prose h4 { font-size: 1.05rem; margin: 1.4em 0 .5em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--brand); }
.prose img { border-radius: 14px; border: 1px solid var(--border); margin: .6em 0; height: auto !important; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.prose blockquote { border-left: 4px solid var(--brand); padding: 12px 18px; background: var(--brand-50); border-radius: 0 12px 12px 0; color: var(--text-2); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--muted-bg); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 16px 18px; border-radius: 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: .94rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose hr { margin: 2em 0; }
.prose iframe { max-width: 100%; border-radius: 14px; }

/* Footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); padding: 48px 0 26px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 7px 0; }
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: .85rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Cookie + popup */
.cookie-bar { position: fixed; left: 18px; bottom: 18px; z-index: 90; max-width: 420px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .9rem; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 360px at 0% 0%, rgba(255,255,255,.16), transparent 60%), linear-gradient(150deg, var(--brand-700), var(--brand) 60%, color-mix(in srgb, var(--brand) 60%, #7c3aed)); }
.auth-side h2 { color: #fff; font-size: 2rem; max-width: 420px; }
.auth-side p { color: rgba(255,255,255,.82); max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.92); }
.auth-points .icon { background: rgba(255,255,255,.16); padding: 6px; width: 30px; height: 30px; border-radius: 9px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-box h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-box .sub { color: var(--text-3); margin-bottom: 26px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .82rem; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-facebook { --btn-bg: #1877f2; --btn-fg: #fff; --btn-bd: #1877f2; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ==========================================================================
   Customer area & tickets
   ========================================================================== */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin: 32px 0 22px; }
.page-head h1 { font-size: 1.7rem; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.user-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 40px; }
.user-nav { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 2px; margin-top: 32px; }
.user-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; color: var(--text-2); font-weight: 550; font-size: .93rem; }
.user-nav a:hover { background: var(--surface); color: var(--text); }
.user-nav a.is-active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.user-nav .count { margin-left: auto; }
@media (max-width: 900px) { .user-layout { grid-template-columns: 1fr; } .user-nav { position: static; flex-direction: row; overflow-x: auto; margin-top: 20px; } .user-nav a { white-space: nowrap; } }

.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: var(--surface-2); color: var(--text); }
.ticket-row .t-subject { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.ticket-row .t-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-3); font-size: .83rem; margin-top: 4px; }
.ticket-row .t-meta span { display: inline-flex; gap: 5px; align-items: center; }
.ticket-row .t-side { display: flex; gap: 8px; align-items: center; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .ticket-layout { grid-template-columns: 1fr; } }
.ticket-title { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ticket-title h1 { font-size: 1.45rem; margin: 0; }
.info-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.info-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.info-list li:last-child { border-bottom: 0; }
.info-list span:first-child { color: var(--text-3); }
.info-list span:last-child { text-align: right; font-weight: 550; overflow-wrap: anywhere; }

.thread { display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg-body { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 4px 16px 16px 16px; box-shadow: var(--shadow-sm); }
.msg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: .86rem; }
.msg-head strong { font-size: .93rem; }
.msg-text { padding: 14px 16px; overflow-wrap: anywhere; line-height: 1.65; }
.msg-text a { text-decoration: underline; }
.msg-staff .msg-body { background: var(--brand-50); border-color: color-mix(in srgb, var(--brand) 22%, var(--border)); }
.msg-staff .msg-head { border-bottom-color: color-mix(in srgb, var(--brand) 18%, var(--border)); }
.msg-bot .msg-body { background: linear-gradient(135deg, var(--brand-50), color-mix(in srgb, #7c3aed 8%, var(--surface))); }
.msg-mine { flex-direction: row-reverse; }
.msg-mine .msg-body { border-radius: 16px 4px 16px 16px; }
.msg-original { margin: 0 16px 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: .88rem; color: var(--text-2); }
.msg-translated { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--text-3); background: none; border: 0; cursor: pointer; padding: 0; }
.msg-translated:hover { color: var(--brand); }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.file-card { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .83rem; color: var(--text-2); max-width: 240px; }
.file-card:hover { border-color: var(--brand); color: var(--brand); }
.file-thumb { width: 88px; height: 66px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.bot-typing { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--brand-50); color: var(--text-2); font-size: .9rem; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.reply-box { margin-top: 20px; }
.reply-box .textarea { min-height: 130px; border: 0; box-shadow: none; border-radius: 0; padding: 16px; }
.reply-box .textarea:focus { box-shadow: none; }
.reply-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.attach-btn { position: relative; overflow: hidden; }
.attach-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.suggestions { margin-top: 10px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border)); background: var(--brand-50); border-radius: var(--radius); padding: 12px 14px; }
.suggestions strong { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin-bottom: 6px; }
.suggestions a { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-size: .92rem; }

.wizard-step { display: flex; gap: 14px; }
.wizard-num { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px; }
.wizard-content { flex: 1; min-width: 0; }
.app-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.app-option { position: relative; display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; transition: all .15s; }
.app-option:hover { border-color: var(--brand); }
.app-option input { position: absolute; opacity: 0; }
.app-option .app-icon { width: 34px; height: 34px; border-radius: 10px; }
.app-option .app-icon .icon { width: 18px; height: 18px; }
.app-option:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand); }
details.more-info summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more-info summary::-webkit-details-marker { display: none; }

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--brand-50); color: var(--brand); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.violet { background: color-mix(in srgb, #7c3aed 12%, var(--surface)); color: #7c3aed; }
.stat-value { font-size: 1.55rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { font-size: .84rem; color: var(--text-3); }

/* ==========================================================================
   Admin panel
   ========================================================================== */
.admin { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { padding: 4px 8px 16px; }
.side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); font-weight: 700; padding: 14px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: .92rem; }
.side-link:hover { background: var(--muted-bg); color: var(--text); }
.side-link.is-active { background: var(--brand-50); color: var(--brand); }
.side-link .count { margin-left: auto; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .search { max-width: 380px; flex: 1; }
.topbar .search-input { height: 40px; }
.admin-content { padding: 28px; width: 100%; max-width: 1400px; }
.admin-content .page-head { margin-top: 0; }
.sidebar-toggle { display: none; }
@media (max-width: 1024px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sidebar-toggle { display: inline-flex; }
  .topbar, .admin-content { padding-left: 16px; padding-right: 16px; }
}
.backdrop { position: fixed; inset: 0; background: rgba(10,16,30,.45); z-index: 70; display: none; }
.backdrop.is-open { display: block; }
.settings-tile { display: flex; gap: 14px; padding: 20px; align-items: flex-start; }
.settings-tile h3 { margin: 0 0 4px; font-size: 1rem; }
.settings-tile p { margin: 0; font-size: .88rem; color: var(--text-3); }
.chart-box { position: relative; height: 260px; }
.kpi-trend { font-size: .8rem; color: var(--success); font-weight: 600; }
.code-editor { font-family: var(--mono); font-size: .88rem; min-height: 460px; tab-size: 2; }
.sortable-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: grab; }
.sortable-item.is-dragging { opacity: .5; }
.handle { color: var(--text-3); }

/* CKEditor tweaks */
.cke_chrome { border-radius: 12px !important; overflow: hidden; border-color: var(--border-strong) !important; }

@media print { .site-header, .site-footer, .feedback, .aside-sticky, .toasts { display: none !important; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Inline two-column grids collapse on small screens */
@media (max-width: 960px) {
  .grid[style*="grid-template-columns"], .form-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .site-header .container { gap: 8px; padding: 0 14px; }
  .brand-tag { display: none; }
  .header-actions { gap: 2px; }
  .brand img { height: 26px; }
  .hero { padding: 48px 0 64px; }
  .search-lg .search-input { padding-right: 104px; font-size: 1rem; }
  .article-card { border-radius: var(--radius); }
  .page-head h1 { font-size: 1.4rem; }
}
.hero::after { height: 36px; }
@media (max-width:640px){.hide-sm{display:none!important}}
