/* ArgiCore UI
   Ink sidebar, cool canvas, one bright accent (--brand, the company's colour when it has one).
   Signature element: a thin brand-colour line across the top of every screen.
   Change the look here (tokens in :root). To restyle without editing ArgiCore, add your own
   wwwroot/css/app.css in your app: the layout loads it after this file. */

:root {
  --ink: #171A2F;
  --ink-2: #22264A;
  --ink-soft: #2E3360;
  --canvas: #F3F4F7;
  --surface: #FFFFFF;
  --line: #E3E5EC;
  --line-strong: #CDD1DC;
  --text: #1C2033;
  --muted: #646B82;
  --accent: #4F46E5;
  --accent-ink: #FFFFFF;
  --accent-soft: #EEF0FF;
  --brand: var(--accent);
  --ok: #1F9D6B;
  --warn: #B7790A;
  --bad: #D2353B;
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar: 252px;

  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--canvas);
  --bs-primary: var(--brand);
  --bs-link-color: color-mix(in srgb, var(--brand) 85%, black);
  --bs-link-hover-color: color-mix(in srgb, var(--brand) 65%, black);
  --bs-border-color: var(--line);
  --bs-border-radius: var(--radius-sm);
}

html { font-size: 15px; }
body { font-family: var(--font-body); background: var(--canvas); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .display-font { font-family: var(--font-display); letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
.text-muted, .muted { color: var(--muted) !important; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }

/* ── Top line ────────────────────────────────────────────── */
.topline { height: 4px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #22D3EE)); }

/* ── App shell ───────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--sidebar), var(--canvas) var(--sidebar)); }
.brandmark { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.brandmark:hover { color: #fff; }
.sidebar {
  background: var(--ink); color: #C9CCE0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar .brandmark { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.brandmark .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 1.1rem; flex: none; overflow: hidden;
}
.brandmark .mark img { width: 100%; height: 100%; object-fit: cover; }
.brandmark .name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.brandmark .sub { font-size: .75rem; color: #8F94B6; }
.nav-group { padding: .9rem 1.25rem .35rem; font-size: .78rem; color: #7F84A8; }
.side-link {
  display: flex; align-items: center; gap: .7rem; margin: 1px .65rem; padding: .5rem .65rem;
  border-radius: 7px; color: #C9CCE0; text-decoration: none; font-weight: 500; position: relative;
}
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.side-link:hover { background: var(--ink-2); color: #fff; }
.side-link.active { background: var(--ink-soft); color: #fff; }
.side-link.active::before { content: ""; position: absolute; left: -.65rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side-link.soon { opacity: .5; pointer-events: none; }
.side-link .pill { margin-left: auto; font-size: .68rem; background: #34396A; color: #C9CCE0; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 1rem 1.25rem; font-size: .75rem; color: #6E739A; border-top: 1px solid #262A4C; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 1020;
}
.topbar .crumb { font-weight: 600; color: var(--muted); }
.topbar .crumb strong { color: var(--text); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; color: var(--text); position: relative;
}
.icon-btn:hover { background: var(--canvas); }
.badge-dot {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--ink-soft); color: #fff; font-weight: 700; font-size: .8rem; overflow: hidden;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.content { padding: 1.75rem 1.75rem 3rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--muted); max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.mobile-toggle { display: none; }
@media (max-width: 991.98px) {
  .shell { grid-template-columns: 1fr; background: var(--canvas); }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); z-index: 1040; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 12, 30, .45); }
  .mobile-toggle { display: inline-grid; }
  .content { padding: 1.25rem 1rem 3rem; }
  .topbar { padding: 0 1rem; }
}

/* ── Banners ─────────────────────────────────────────────── */
.strip { padding: .55rem 1.5rem; font-size: .9rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.strip.impersonate { background: #2B1D5C; color: #fff; }
.strip.trial { background: color-mix(in srgb, var(--brand) 9%, white); color: color-mix(in srgb, var(--brand) 60%, black); border-bottom: 1px solid color-mix(in srgb, var(--brand) 20%, white); }
.strip.announce { background: #EAF1FF; color: #183B7A; border-bottom: 1px solid #D3E0FB; }
.strip.announce.warning { background: #FFF6DE; color: #6B4A00; border-color: #F6E3AE; }
.strip .btn { padding: .15rem .6rem; font-size: .8rem; }

/* ── Panels, stats, tables ───────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.02rem; }
.panel-head .actions { margin-left: auto; }
.panel-body { padding: 1.25rem; }
.panel + .panel { margin-top: 1.25rem; }

.stat { padding: 1rem 1.25rem; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; line-height: 1.1; margin-top: .2rem; }
.stat .hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

.table { --bs-table-bg: transparent; margin: 0; }
.table > thead th { font-size: .8rem; font-weight: 600; color: var(--muted); background: #FAFAFC; border-bottom: 1px solid var(--line); padding: .65rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .75rem 1rem; vertical-align: middle; border-color: var(--line); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #FAFBFD; }
.cell-title { font-weight: 600; color: var(--text); text-decoration: none; }
.cell-sub { font-size: .82rem; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.chip.ok { background: #E7F6EF; color: #146B49; }
.chip.warn { background: #FFF4D9; color: #7A5200; }
.chip.bad { background: #FDE8E8; color: #A3242A; }
.chip.info { background: #EAF1FF; color: #1D4AA0; }
.chip.neutral { background: #EEF0F5; color: #4A5068; }
.chip.accent { background: color-mix(in srgb, var(--brand) 10%, white); color: color-mix(in srgb, var(--brand) 70%, black); }
.chip.outline { border-color: var(--line-strong); color: var(--muted); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; color: var(--line-strong); }

/* ── Forms & buttons ─────────────────────────────────────── */
.btn { font-weight: 600; border-radius: 8px; padding: .5rem .95rem; }
.btn-sm { padding: .3rem .65rem; border-radius: 7px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 86%, black); --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 86%, black); --bs-btn-active-bg: color-mix(in srgb, var(--brand) 78%, black); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink-2); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--canvas); --bs-btn-hover-border-color: var(--line-strong); }
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.form-control, .form-select { border-color: var(--line-strong); border-radius: 8px; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent); }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.field-validation-error, .validation-summary-errors { color: var(--bad); font-size: .85rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.form-section { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; padding: 1.5rem 1.25rem; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section > .intro h3 { font-size: .98rem; margin-bottom: .25rem; }
.form-section > .intro p { font-size: .85rem; color: var(--muted); margin: 0; }
@media (max-width: 767.98px) { .form-section { grid-template-columns: 1fr; gap: .75rem; } }
.lock-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; color: var(--muted); }
.lock-note i { color: var(--ok); }
.color-input { width: 48px; height: 38px; padding: 3px; border-radius: 8px; }

/* Nav tabs used inside panels */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); padding: 0 1rem; overflow-x: auto; }
.tabs a { padding: .8rem .8rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand); }
.tabs a:hover { color: var(--text); }

/* ── Notification dropdown & toasts ──────────────────────── */
.notif-menu { width: 380px; max-width: calc(100vw - 2rem); padding: 0; border-radius: var(--radius); border-color: var(--line); box-shadow: 0 16px 40px rgba(23, 26, 47, .16); }
.notif-menu .head { display: flex; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: .75rem; padding: .75rem 1rem; text-decoration: none; color: var(--text); border-bottom: 1px solid #F0F1F5; }
.notif-item:hover { background: #FAFBFD; }
.notif-item.unread { background: #FFF8F5; }
.notif-item .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #EEF0F5; color: var(--ink); }
.notif-item.type-success .ico { background: #E7F6EF; color: var(--ok); }
.notif-item.type-warning .ico { background: #FFF4D9; color: var(--warn); }
.notif-item.type-error .ico { background: #FDE8E8; color: var(--bad); }
.notif-item.type-announcement .ico { background: #EAF1FF; color: #1D4AA0; }
.notif-item .t { font-weight: 600; font-size: .9rem; }
.notif-item .m { font-size: .83rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item .w { font-size: .75rem; color: #9AA0B5; margin-top: .15rem; }
.toast-zone { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; }
.toast-card { background: var(--ink); color: #fff; border-radius: 10px; padding: .75rem 1rem; min-width: 280px; max-width: 380px; box-shadow: 0 12px 30px rgba(10, 12, 30, .3); display: flex; gap: .7rem; align-items: flex-start; animation: toast-in .25s ease-out; }
.toast-card.ok i { color: #5BE0A8; }
.toast-card.bad i { color: #FF8A8F; }
.toast-card .x { margin-left: auto; background: none; border: 0; color: #9AA0C5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast-card { animation: none; } .sidebar { transition: none; } }

/* ── Company footer in app ──────────────────────────────── */
.app-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); padding: 1.25rem 1.75rem; font-size: .85rem; color: var(--muted); }
.app-footer .links a { color: var(--text); font-weight: 600; text-decoration: none; margin-right: 1rem; }
.app-footer .custom p:last-child { margin-bottom: 0; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); background: var(--surface); }
.auth-art { background: var(--ink); color: #fff; padding: 3rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art .brandmark { padding: 0; }
.auth-art h2 { color: #fff; font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.04; font-weight: 800; max-width: 14ch; margin: auto 0 1rem; letter-spacing: -0.03em; }
.auth-art p { color: #B8BCD8; max-width: 44ch; font-size: 1.05rem; }
.auth-art .points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .6rem; color: #D4D7EE; }
.auth-art .points li { display: flex; gap: .6rem; align-items: center; }
.auth-art .points i { color: color-mix(in srgb, var(--brand) 55%, white); }
.auth-form { padding: 3rem clamp(1.5rem, 4vw, 3.5rem); display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 1.9rem; font-weight: 800; }
.auth-form .lead { color: var(--muted); font-size: 1rem; }
.btn-oauth { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; background: #fff; border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; padding: .6rem; border-radius: 9px; }
.btn-oauth:hover { background: var(--canvas); }
.btn-oauth svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1.25rem 0; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.demo-box { border: 1px dashed var(--line-strong); border-radius: 10px; padding: .75rem; margin-top: 1.5rem; }
.demo-box button { text-align: left; }
@media (max-width: 991.98px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ── Email designer ──────────────────────────────────────── */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.style-card { border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; display: block; }
.style-card:hover { border-color: var(--line-strong); }
.style-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.style-card .thumb { height: 300px; overflow: hidden; position: relative; background: #f4f5f7; }
.style-card .thumb iframe { width: 680px; height: 820px; border: 0; transform: scale(.36); transform-origin: 0 0; pointer-events: none; position: absolute; top: 0; left: 0; }
.style-card .meta { padding: .75rem .9rem; border-top: 1px solid var(--line); }
.style-card .meta strong { display: block; }
.style-card .meta span { font-size: .8rem; color: var(--muted); }
.preview-frame { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.placeholder-list code { display: inline-block; margin: 0 .25rem .35rem 0; padding: .15rem .45rem; background: #F1F2F7; border-radius: 5px; color: #3B2A96; font-size: .8rem; cursor: pointer; }
.code-area { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; }

/* ── Audit diff ──────────────────────────────────────────── */
.diff td { font-size: .85rem; vertical-align: top; }
.diff .old { color: #A3242A; background: #FFF5F5; word-break: break-word; }
.diff .new { color: #146B49; background: #F3FBF7; word-break: break-word; }

/* ── Plans ───────────────────────────────────────────────── */
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.4rem; height: 100%; display: flex; flex-direction: column; position: relative; }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.plan-card .price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; }
.plan-card .price small { font-size: .9rem; color: var(--muted); font-weight: 500; font-family: var(--font-body); }
.plan-card ul { list-style: none; padding: 0; margin: 1rem 0; font-size: .9rem; }
.plan-card li { padding: .25rem 0; display: flex; gap: .5rem; }
.plan-card li i { color: var(--ok); }
.plan-card .badge-top { position: absolute; top: -11px; left: 1.2rem; }
.feature-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.feature-row:last-child { border-bottom: 0; }
.feature-row .fi { width: 36px; height: 36px; border-radius: 9px; background: #EEF0F5; display: grid; place-items: center; flex: none; }
.feature-row .fd { font-size: .83rem; color: var(--muted); }

.checklist .item { display: flex; gap: .85rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); align-items: center; text-decoration: none; color: var(--text); }
.checklist .item:last-child { border-bottom: 0; }
.checklist .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; }
.checklist .item.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .item.done .what { color: var(--muted); text-decoration: line-through; }
.progress-bar-soft { height: 8px; border-radius: 99px; background: #EEF0F5; overflow: hidden; }
.progress-bar-soft > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.masked { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: .55rem 1rem; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }

/* ── Public landing ─────────────────────────────────────── */
.landing-nav { display: flex; align-items: center; padding: 1.1rem clamp(1rem, 4vw, 3rem); gap: 1rem; }
.landing-hero { background: var(--ink); color: #fff; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem) 0; overflow: hidden; }
.landing-hero h1 { color: #fff; font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: .98; font-weight: 800; letter-spacing: -0.04em; max-width: 15ch; }
.landing-hero p.lede { color: #B8BCD8; font-size: 1.2rem; max-width: 52ch; margin: 1.25rem 0 2rem; }
.hero-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 3.5rem; padding-bottom: 3rem; }
.hero-tiles div { background: var(--ink-2); border: 1px solid var(--ink-soft); border-radius: var(--radius); padding: 1rem; color: #D4D7EE; font-weight: 600; }
.hero-tiles i { display: block; font-size: 1.3rem; color: color-mix(in srgb, var(--brand) 55%, white); margin-bottom: .4rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.feature-grid h3 { font-size: 1.05rem; margin: .5rem 0 .25rem; }
.feature-grid i { font-size: 1.4rem; color: var(--brand); }
.section-pad { padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); }
.check-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
