@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Bondly — design system  (v2 redesign)
   Token NAMES preserved (inline styles in views reference them);
   values refreshed for a modern operations look.
   ============================================================ */
:root {
  /* Accent */
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;

  /* Ink / neutrals (slightly cool) */
  --ink-950: #14161f;
  --ink-900: #1b1e2b;
  --ink-800: #2a2f3e;
  --ink-600: #545b6e;
  --ink-500: #7a8194;
  --ink-400: #9aa1b3;

  /* Surfaces */
  --canvas: #f4f5fa;
  --surface: #ffffff;
  --surface-soft: #f1f3f9;
  --surface-blue: #f2f4ff;
  --border: #e6e8f0;
  --border-strong: #d3d7e3;

  /* Semantic */
  --success-700: #15803d;  --success-50: #dcfce7;
  --warning-700: #b45309;  --warning-50: #fef3c7;
  --danger-700:  #be123c;  --danger-50:  #ffe4e6;
  --red-800:     #9f1239;

  /* Sidebar (dark) */
  --nav-bg: #12141d;
  --nav-bg-soft: #1a1d29;
  --nav-line: #262a38;
  --nav-text: #c7ccda;
  --nav-text-dim: #838aa0;

  --shadow-sm: 0 1px 2px rgba(20, 22, 31, .05), 0 1px 3px rgba(20, 22, 31, .04);
  --shadow-md: 0 2px 6px rgba(20, 22, 31, .06), 0 8px 24px rgba(20, 22, 31, .07);
  --shadow-lg: 0 12px 40px rgba(20, 22, 31, .14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, .28);

  /* Back-compat aliases used in some views */
  --ms-blue: var(--brand-600);
  --ms-blue-dark: var(--brand-700);
  --ms-green: var(--success-700);
  --ms-yellow: #d97706;
  --ms-red: var(--danger-700);
  --surface-white: var(--surface);
  --surface-canvas: var(--canvas);
  --surface-border: var(--border);
  --text-primary: var(--ink-950);
  --text-secondary: var(--ink-600);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(1200px 480px at 88% -8%, rgba(79, 70, 229, .06), transparent 60%),
    var(--canvas);
  color: var(--ink-950);
  font-family: var(--font-family);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink-950); font-weight: 700; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { margin: 0; }

a { color: var(--brand-600); text-decoration: none; transition: color .18s var(--ease-out); }
a:hover { color: var(--brand-700); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============================================================
   App shell + sidebar
   ============================================================ */
.workspace-shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--nav-bg-soft), var(--nav-bg));
  border-right: 1px solid var(--nav-line);
  padding: 20px 16px; gap: 6px;
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand__copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: linear-gradient(135deg, var(--brand-600), #7c3aed);
  color: #fff; font-weight: 800; font-size: 18px; border-radius: 11px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .4);
}
.brand-title { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-subtitle { color: var(--nav-text-dim); font-size: 11.5px; font-weight: 500; }
.sidebar-close { display: none; background: transparent; border: 0; color: var(--nav-text-dim); font-size: 26px; cursor: pointer; line-height: 1; }

.sidebar__label { color: var(--nav-text-dim); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 14px 10px 6px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; color: var(--nav-text);
  font-weight: 500; font-size: 14px; transition: background .16s var(--ease-out), color .16s var(--ease-out);
}
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-link.is-active { background: linear-gradient(135deg, rgba(79, 70, 229, .95), rgba(124, 58, 237, .9)); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.sidebar-link__icon { display: grid; place-items: center; width: 22px; font-size: 15px; opacity: .9; }
.sidebar-link__count { margin-left: auto; background: var(--danger-700); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; }
.sidebar-link.is-active .sidebar-link__count { background: rgba(255, 255, 255, .25); }

.sidebar__bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--nav-line); display: flex; flex-direction: column; gap: 8px; }
.sidebar-account { display: flex; align-items: center; gap: 11px; padding: 8px 6px; }
.sidebar-account__avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, var(--brand-600)); color: #fff; font-weight: 700; flex: none; }
.sidebar-account__copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar-account__copy strong { color: #fff; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account__copy small { color: var(--nav-text-dim); font-size: 11.5px; }
.sidebar-signout { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; color: var(--nav-text-dim); font-weight: 500; }
.sidebar-signout:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.sidebar-scrim { display: none; }

.workspace-main { display: flex; flex-direction: column; min-width: 0; }
.workspace-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 30px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.sidebar-open { display: none; background: transparent; border: 1px solid var(--border); border-radius: 9px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; color: var(--ink-600); }
.workspace-breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--ink-500); font-size: 13.5px; }
.workspace-breadcrumb strong { color: var(--ink-950); font-weight: 600; }
.workspace-topbar__status { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-500); font-size: 12.5px; font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-700); box-shadow: 0 0 0 3px var(--success-50); }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 30px; }
.footer { padding: 22px 30px 34px; color: var(--ink-400); font-size: 12.5px; text-align: center; }

/* ============================================================
   Auth screens
   ============================================================ */
.auth-app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.auth-topbar { padding: 22px 30px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; }
.brand-lockup .brand-title { color: var(--ink-950); }
.auth-shell { min-height: 62vh; display: grid; place-items: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 428px; }
.auth-card__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-500); font-weight: 600; font-size: 13px; margin-bottom: 18px; }
.auth-card__brand .brand-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
.auth-footer { text-align: center; color: var(--ink-500); font-size: 13.5px; margin-top: 18px; }

/* ============================================================
   Page header
   ============================================================ */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header__copy { max-width: 60ch; }
.page-header h1 { font-size: 28px; margin: 4px 0 6px; }
.page-header p { color: var(--ink-600); }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow, .dashboard-eyebrow, .dashboard-card__eyebrow {
  display: inline-block; color: var(--brand-600); font-weight: 700;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
}

/* ============================================================
   Cards
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card__header h2 { font-size: 17px; }
.card__header p { color: var(--ink-500); font-size: 13px; margin-top: 2px; }
.card__body { padding: 22px 24px; }
.card--accent { border-top: 3px solid var(--brand-600); }
.card--review { border-top: 3px solid var(--warning-700); }
.form-card { padding: 8px; }
.form-card .form-section { padding: 18px 20px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink-800); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .12s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out), border-color .16s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary { --btn-bg: linear-gradient(135deg, var(--brand-600), #6d5cf0); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 6px 16px rgba(79, 70, 229, .28); }
.btn-primary:hover { --btn-bg: linear-gradient(135deg, var(--brand-700), var(--brand-600)); box-shadow: 0 10px 24px rgba(79, 70, 229, .34); }
.btn-secondary { --btn-bg: var(--surface); --btn-fg: var(--ink-800); }
.btn-secondary:hover { --btn-bg: var(--surface-soft); }
.btn-success { --btn-bg: var(--success-700); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger { --btn-bg: #fff; --btn-fg: var(--danger-700); --btn-bd: var(--danger-50); }
.btn-danger:hover { --btn-bg: var(--danger-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: not-allowed; transform: none; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: bondly-spin .6s linear infinite; color: #fff; }
.btn-secondary.is-loading::after, .btn-danger.is-loading::after { color: var(--ink-600); }
@keyframes bondly-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Forms
   ============================================================ */
.form-section { padding: 6px 0 18px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section__heading { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; flex-direction: column; gap: 3px; }
.form-section__heading span { font-size: 12.5px; font-weight: 500; color: var(--ink-500); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-group--full { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--ink-800); }
.optional { color: var(--ink-400); font-weight: 500; font-size: .92em; }
.form-control {
  width: 100%; padding: 10px 13px; font-family: inherit; font-size: 14px; color: var(--ink-950);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.form-control::placeholder { color: var(--ink-400); }
.form-control:hover { border-color: var(--ink-400); }
.form-control:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--focus-ring); }
textarea.form-control { resize: vertical; min-height: 92px; line-height: 1.6; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a8194' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.form-control.is-invalid { border-color: var(--danger-700); box-shadow: 0 0 0 3px var(--danger-50); }
.field-error { color: var(--danger-700); font-size: 12px; font-weight: 500; }
.form-hint { color: var(--ink-500); font-size: 12px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 20px 10px; }
.form-actions--split { justify-content: space-between; }
.form-actions__group { display: flex; gap: 10px; }
.review-message { font-family: var(--mono); font-size: 13px; line-height: 1.6; }

/* Autocomplete suggestion popovers (company / location) */
.location-picker, .company-picker { position: relative; }
.location-suggestions, .company-suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 280px; overflow-y: auto;
}
.location-suggestion, .company-suggestion {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 9px 11px; border: 0; background: transparent; border-radius: 8px; cursor: pointer;
}
.location-suggestion:hover, .company-suggestion:hover { background: var(--brand-50); }
.location-suggestion strong, .company-suggestion strong { font-size: 13.5px; color: var(--ink-950); }
.location-suggestion small, .company-suggestion small { font-size: 11.5px; color: var(--ink-500); }
.location-suggestion-empty, .company-suggestion-empty { padding: 11px; font-size: 12.5px; color: var(--ink-500); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap, .dashboard-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.table, .dashboard-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); }
.table thead th, .dashboard-table thead th {
  text-align: left; padding: 12px 16px; background: var(--surface-soft);
  color: var(--ink-500); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table tbody td, .dashboard-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td, .dashboard-table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr, .dashboard-table tbody tr { transition: background .12s var(--ease-out); }
.table tbody tr:hover, .dashboard-table tbody tr:hover { background: var(--surface-blue); }
.table-subtext { color: var(--ink-500); font-size: 12px; }
.table-actions { display: flex; gap: 8px; justify-content: flex-end; }
th.is-sortable { cursor: pointer; user-select: none; }
th.is-sortable::after { content: " ⇅"; color: var(--ink-400); font-size: 10px; }
th.sort-asc::after { content: " ↑"; color: var(--brand-600); }
th.sort-desc::after { content: " ↓"; color: var(--brand-600); }

/* Injected table toolbar (search) */
.table-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.table-search { max-width: 320px; padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237a8194' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; }
.table-count { color: var(--ink-500); font-size: 12.5px; }

/* ============================================================
   Badges / pills / alerts / empty states
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.badge-secondary { background: var(--surface-soft); color: var(--ink-600); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); }
.badge-danger { background: var(--danger-50); color: var(--danger-700); }
.badge-success { background: var(--success-50); color: var(--success-700); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.alert strong { font-weight: 700; }
.alert span { color: inherit; }
.alert--success { background: var(--success-50); border-color: #bbf7d0; color: #14532d; }
.alert--error { background: var(--danger-50); border-color: #fecdd3; color: #9f1239; }

.empty-state { text-align: center; padding: 46px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-50); color: var(--brand-600); font-size: 24px; margin-bottom: 6px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--ink-500); max-width: 42ch; }
.empty-state__action { margin-top: 10px; }

/* ============================================================
   Review meta + approval editor
   ============================================================ */
.review-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.review-meta > div { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.review-meta__label { color: var(--ink-500); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.review-meta__value { font-weight: 600; font-size: 14px; }
.approval-email-editor, #plainMessageEditor { display: flex; flex-direction: column; gap: 10px; }
.approval-visual-editor-shell { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; }
.approval-visual-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 13px; background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--ink-600); }
.approval-visual-editor { min-height: 220px; padding: 18px; background: #fff; line-height: 1.6; outline: none; }
.template-preview { width: 100%; min-height: 320px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-page { display: flex; flex-direction: column; gap: 24px; }
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dashboard-title { font-size: 30px; margin: 6px 0 8px; max-width: 20ch; }
.dashboard-subtitle { color: var(--ink-600); max-width: 60ch; }
.dashboard-head__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dashboard-date { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-600); box-shadow: var(--shadow-sm); }
.dashboard-date__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-600); }

.dashboard-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.dashboard-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; transition: transform .14s var(--ease-out), box-shadow .16s; }
.dashboard-metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dashboard-metric__top { display: flex; align-items: center; justify-content: space-between; }
.dashboard-metric__index { font-family: var(--mono); font-size: 11px; color: var(--ink-400); }
.dashboard-metric__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.dashboard-metric__number { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.dashboard-metric__meta { font-size: 12px; color: var(--ink-500); }
.dashboard-metric--primary { background: linear-gradient(150deg, #ffffff, var(--brand-50)); border-color: var(--brand-100); }
.dashboard-metric--primary .dashboard-metric__number { color: var(--brand-700); }
.dashboard-metric--attention::before, .dashboard-metric--scheduled::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; }
.dashboard-metric--attention::before { background: var(--warning-700); }
.dashboard-metric--scheduled::before { background: var(--brand-600); }

.dashboard-focus { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow-sm); }
.dashboard-focus__copy h2 { font-size: 21px; margin: 8px 0 8px; }
.dashboard-focus__copy p { color: var(--ink-600); max-width: 44ch; }
.dashboard-focus__actions { display: flex; flex-direction: column; gap: 10px; }
.dashboard-focus-action { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-soft); transition: transform .14s var(--ease-out), box-shadow .16s; }
.dashboard-focus-action:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); }
.dashboard-focus-action__count { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; font-weight: 800; font-size: 16px; flex: none; color: #fff; }
.dashboard-focus-action span:nth-child(2) { display: flex; flex-direction: column; margin-right: auto; }
.dashboard-focus-action strong { font-size: 14px; color: var(--ink-950); }
.dashboard-focus-action small { font-size: 12px; color: var(--ink-500); }
.dashboard-focus-action--blue .dashboard-focus-action__count { background: var(--brand-600); }
.dashboard-focus-action--amber .dashboard-focus-action__count { background: var(--warning-700); }
.dashboard-focus-action--violet .dashboard-focus-action__count { background: #7c3aed; }
.dashboard-focus-clear { display: flex; align-items: center; gap: 13px; padding: 16px; border-radius: 14px; background: var(--success-50); }
.dashboard-focus-clear__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--success-700); color: #fff; font-weight: 700; }
.dashboard-focus-clear strong { display: block; font-size: 14px; }
.dashboard-focus-clear small { color: var(--ink-600); font-size: 12px; }

.dashboard-empty { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center; background: linear-gradient(140deg, var(--surface), var(--surface-blue)); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 30px; }
.dashboard-empty__kicker { color: var(--brand-600); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.dashboard-empty h2 { font-size: 22px; margin: 10px 0; }
.dashboard-empty p { color: var(--ink-600); margin-bottom: 16px; }
.dashboard-flow { display: flex; align-items: center; gap: 8px; }
.dashboard-flow__item { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.dashboard-flow__item span { font-family: var(--mono); color: var(--brand-600); font-size: 12px; }
.dashboard-flow__item strong { font-size: 13.5px; }
.dashboard-flow__item small { color: var(--ink-500); font-size: 11.5px; }
.dashboard-flow__line { width: 22px; height: 2px; background: var(--border-strong); flex: none; }

.dashboard-grid { display: grid; gap: 20px; }
.dashboard-grid--main { grid-template-columns: 1.3fr 1fr; }
.dashboard-grid--secondary { grid-template-columns: 1fr 1fr; }
.dashboard-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dashboard-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dashboard-card__head h2 { font-size: 17px; margin: 4px 0 3px; }
.dashboard-card__head p { color: var(--ink-500); font-size: 12.5px; }
.dashboard-card__stat { color: var(--ink-500); font-size: 12.5px; font-weight: 600; }
.dashboard-text-link { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dashboard-card__empty { text-align: center; padding: 28px 16px; color: var(--ink-500); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.dashboard-card__empty strong { color: var(--ink-800); }
.dashboard-card__empty-icon { font-size: 24px; color: var(--ink-400); }

.dashboard-birthday-list { display: flex; flex-direction: column; }
.dashboard-birthday-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 13px 8px; border-bottom: 1px solid var(--border); transition: background .12s; }
.dashboard-birthday-row:last-child { border-bottom: 0; }
.dashboard-birthday-row:hover { background: var(--surface-blue); border-radius: 10px; }
.dashboard-birthday-date { text-align: center; min-width: 54px; }
.dashboard-birthday-date strong { display: block; font-size: 14px; }
.dashboard-birthday-date small { color: var(--brand-600); font-size: 11px; font-weight: 600; }
.dashboard-birthday-person { display: flex; flex-direction: column; min-width: 0; }
.dashboard-birthday-person strong { font-size: 14px; color: var(--ink-950); }
.dashboard-birthday-person small { color: var(--ink-500); font-size: 12px; }
.dashboard-birthday-location { color: var(--ink-500); font-size: 12px; }
.dashboard-birthday-arrow { color: var(--ink-400); }

.dashboard-delivery-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dashboard-delivery-summary > div { background: var(--surface-soft); border-radius: 12px; padding: 14px; text-align: center; }
.dashboard-delivery-summary strong { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dashboard-delivery-summary span { color: var(--ink-500); font-size: 12px; }

.dashboard-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-soft); color: var(--ink-600); }
.dashboard-status span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dashboard-status--sent, .dashboard-status--delivered, .dashboard-status--demorecorded, .dashboard-status--manualsent { background: var(--success-50); color: var(--success-700); }
.dashboard-status--manualpending, .dashboard-status--pending { background: var(--warning-50); color: var(--warning-700); }
.dashboard-status--deliveryfailed, .dashboard-status--failed { background: var(--danger-50); color: var(--danger-700); }

.dashboard-category-list { display: flex; flex-direction: column; gap: 12px; }
.dashboard-category-row__label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.dashboard-category-row__label span { color: var(--ink-500); font-variant-numeric: tabular-nums; }
.dashboard-category-bar { height: 8px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; }
.dashboard-category-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-600), #7c3aed); border-radius: 999px; }

.dashboard-pipeline { display: flex; flex-direction: column; gap: 14px; }
.dashboard-pipeline__item { display: flex; align-items: flex-start; gap: 12px; }
.dashboard-pipeline__marker { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; flex: none; }
.dashboard-pipeline__marker--blue { background: var(--brand-600); }
.dashboard-pipeline__marker--violet { background: #7c3aed; }
.dashboard-pipeline__marker--green { background: var(--success-700); }
.dashboard-pipeline__item strong { display: block; font-size: 14px; }
.dashboard-pipeline__item small { color: var(--ink-500); font-size: 12px; }

/* ============================================================
   User management
   ============================================================ */
.user-management-page { display: flex; flex-direction: column; gap: 22px; }
.user-management-header, .user-management-list__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.user-management-summary { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow-sm); }
.user-management-summary__lock { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); font-size: 18px; }
.user-management-summary__note { color: var(--ink-500); font-size: 13px; }
.user-management-count { color: var(--ink-500); font-size: 13px; font-weight: 600; }
.user-management-list__hint { color: var(--ink-500); font-size: 13px; }
.user-management-empty { text-align: center; padding: 40px; color: var(--ink-500); }
.user-management-empty__icon { font-size: 28px; color: var(--ink-400); }

.user-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.user-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.user-card__identity { display: flex; align-items: center; gap: 12px; }
.user-card__avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-600), #7c3aed); color: #fff; font-weight: 700; font-size: 17px; flex: none; }
.user-card__details { display: flex; flex-direction: column; min-width: 0; }
.user-card__details strong { font-size: 15px; }
.user-card__details small { color: var(--ink-500); font-size: 12.5px; }
.user-card__permissions { display: flex; flex-wrap: wrap; gap: 6px; }
.user-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.user-card__inline-form { display: inline; }
.user-card__danger { background: none; border: 0; color: var(--danger-700); font-weight: 600; cursor: pointer; padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.user-card__danger:hover { background: var(--danger-50); }
.user-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.user-status--approved { background: var(--success-50); color: var(--success-700); }
.user-status--pending { background: var(--warning-50); color: var(--warning-700); }
.user-status--deactivated { background: var(--danger-50); color: var(--danger-700); }

.user-permission-options, .user-form-permissions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.user-permission-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: border-color .14s, background .14s; }
.user-permission-option:hover { border-color: var(--brand-600); background: var(--brand-50); }
.user-permission-option input { margin-top: 3px; }
.user-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px; }

/* Modal */
.user-permissions-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(20, 22, 31, .5); backdrop-filter: blur(3px); }
.user-permissions-modal[hidden] { display: none; }
.user-permissions-modal__panel { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.user-permissions-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.user-permissions-modal__close { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--ink-500); cursor: pointer; }
.user-permissions-modal__intro { padding: 16px 22px 0; color: var(--ink-500); font-size: 13px; }
.user-permissions-modal__body { padding: 16px 22px; }
.user-permissions-modal__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

/* ============================================================
   Templates
   ============================================================ */
.template-form { display: flex; flex-direction: column; gap: 18px; }
.template-editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.template-code-editor { font-family: var(--mono); font-size: 13px; line-height: 1.6; min-height: 280px; }
.template-preview-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.template-preview-card__header { padding: 11px 15px; background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--ink-600); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-soft); border-radius: 11px; }
.tabs button, .tabs a { padding: 7px 14px; border-radius: 8px; border: 0; background: transparent; font-weight: 600; font-size: 13px; color: var(--ink-600); cursor: pointer; }
.tabs .is-active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }

/* ============================================================
   Utilities + toast
   ============================================================ */
.text-center { text-align: center; }
.wrap { max-width: 1160px; margin: 0 auto; }

.bondly-toasts { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.bondly-toast { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: bondly-toast-in .3s var(--ease-out); }
.bondly-toast--success { border-left: 4px solid var(--success-700); }
.bondly-toast--error { border-left: 4px solid var(--danger-700); }
@keyframes bondly-toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .dashboard-metrics { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid--main, .dashboard-grid--secondary, .dashboard-focus, .dashboard-empty { grid-template-columns: 1fr; }
  .template-editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .workspace-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 280px; z-index: 70;
    transform: translateX(-100%); transition: transform .25s var(--ease-out);
  }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(20, 22, 31, .45); }
  .sidebar-close, .sidebar-open { display: grid; place-items: center; }
  .container { padding: 20px 16px; }
  .workspace-topbar { padding: 12px 16px; }
}
@media (max-width: 640px) {
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid--three { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .form-actions, .form-actions--split { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn, .form-actions__group { width: 100%; }
  .form-actions__group { flex-direction: column-reverse; }
  .dashboard-birthday-row { grid-template-columns: auto 1fr; }
  .dashboard-birthday-location, .dashboard-birthday-arrow { display: none; }
}
