/* =============================================================================
   Collector's Paradise — staff data entry tool (v2)
   Dense desktop layout, gold-on-dark theme.
   ============================================================================= */

:root {
  --bg:           #0A0A10;
  --surface-1:    #12121C;
  --surface-2:    #1A1A28;
  --surface-3:    #22222F;
  --hairline:     rgba(255, 255, 255, 0.06);
  --hairline-2:   rgba(255, 255, 255, 0.10);

  --gold-1:       #C9A84C;
  --gold-2:       #E8C96A;
  --gold-glow:    rgba(232, 201, 106, 0.35);
  --gold-soft:    rgba(232, 201, 106, 0.12);
  --gold-grad:    linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 100%);

  --green:        #4ADE80;
  --green-soft:   rgba(74, 222, 128, 0.12);

  --danger:       #F87171;
  --danger-soft:  rgba(248, 113, 113, 0.12);
  --warning:      #FBBF24;

  --text-1:       #F4ECDC;
  --text-2:       #C8C0AE;
  --text-3:       #8A8576;

  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    18px;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------------------------------
   Reset / base
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 201, 106, 0.05), transparent 60%),
    var(--bg);
}

button { font: inherit; color: inherit; cursor: pointer; }

/* Generic logo mark — actual size/frame comes from the modifier class
   that sits alongside (.login-mark, .nav-diamond, .success-mark, .boot-logo). */
.logo-mark { line-height: 0; user-select: none; }
a       { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code    { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }

h1, h2, h3, h4 { margin: 0; color: var(--text-1); font-weight: 600; }
h2 { font-size: 22px; letter-spacing: -0.01em; }
h3 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-2); }
p  { margin: 0; }

.muted   { color: var(--text-2); }
.small   { font-size: 12.5px; }
.mono    { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.block   { display: block; }
.ellip   { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------------------
   Boot / loading shell
   ---------------------------------------------------------------------------- */
.boot-shell {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
}
.boot-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  overflow: hidden;
  filter: drop-shadow(0 0 20px var(--gold-glow));
  animation: pulse 1.6s var(--ease-out) infinite;
  display: inline-block;
}
.boot-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.boot-text { color: var(--text-2); }
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

/* ----------------------------------------------------------------------------
   Login + setup screens
   ---------------------------------------------------------------------------- */
.login-shell {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface-1);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.45);
}
.login-mark {
  width: 72px; height: 72px;
  display: inline-block;
  background: var(--gold-grad);
  border-radius: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px var(--gold-glow);
  overflow: hidden;
  padding: 3px;   /* shows a thin gold frame around the photo */
}
.login-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}
.login-title { font-size: 22px; }
.login-sub   { color: var(--text-2); margin-top: 4px; }
.login-sent  { color: var(--text-1); margin-top: 16px; }
.login-foot  { color: var(--text-3); font-size: 12.5px; margin-top: 14px; }
.login-btn   { width: 100%; margin-top: 16px; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  margin: 18px 0 4px;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--hairline-2);
}

/* Banner (shown at top of app, e.g. "set a password") */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--gold-soft);
  border-bottom: 1px solid var(--gold-1);
  color: var(--text-1);
  padding: 12px 24px;
  font-size: 14px;
}
@media (max-width: 700px) { .banner { flex-direction: column; align-items: flex-start; } }

/* ----------------------------------------------------------------------------
   App shell
   ---------------------------------------------------------------------------- */
.app {
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: rgba(10, 10, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav-brand    { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-diamond {
  width: 32px; height: 32px;
  display: inline-block;
  background: var(--gold-grad);
  border-radius: 9px;
  overflow: hidden;
  padding: 2px;
}
.nav-diamond img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 7px;
}
.nav-title    { font-weight: 600; letter-spacing: -0.01em; }
.nav-tabs     { display: flex; gap: 4px; flex: 1; }
.nav-user     { display: flex; align-items: center; gap: 12px; }

.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.tab:hover  { color: var(--text-1); background: var(--surface-2); }
.tab-on     {
  color: #2A220C;
  background: var(--gold-grad);
  font-weight: 600;
  border-color: transparent;
}

.main {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.footer {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  padding: 18px;
  border-top: 1px solid var(--hairline);
}
.footer .diamond { color: var(--gold-2); margin-right: 4px; }

/* ----------------------------------------------------------------------------
   Form page (the dense single-page intake)
   ---------------------------------------------------------------------------- */
.form-page, .list-page, .detail-page { display: flex; flex-direction: column; gap: 20px; }

.form-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.form-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form-section {
  background: var(--surface-1);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.form-section h3 { margin-bottom: 4px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.field          { display: flex; flex-direction: column; gap: 6px; }
.field-wide     { grid-column: 1 / -1; }
.field-label    { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.field-label .req { color: var(--danger); }
.field-hint     { color: var(--text-3); font-size: 12px; }
.field-err      { color: var(--danger); font-size: 12.5px; }

/* Inputs */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 9px 12px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover  { border-color: rgba(255,255,255,0.16); }
.input:focus  {
  outline: none;
  border-color: var(--gold-1);
  box-shadow: 0 0 0 3px var(--gold-soft);
  background: var(--surface-3);
}
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(-45deg, transparent 50%, var(--text-2) 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

textarea.input, .textarea {
  resize: vertical;
  min-height: 64px;
  font-family: inherit;
  line-height: 1.4;
}

/* Native date picker calendar icon — invert so it's visible on dark theme */
input[type="date"].input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].input::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85) sepia(0.4) saturate(2) hue-rotate(10deg);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.input.search { max-width: 380px; }

.list-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------------------
   Status pills (clickable selects styled as rounded badges)
   ---------------------------------------------------------------------------- */
.status-pill {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 22px 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(-45deg, transparent 50%, currentColor 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 7px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  transition: filter 0.12s;
}
.status-pill:hover { filter: brightness(1.15); }
.status-pill:focus { outline: 2px solid var(--gold-1); outline-offset: 1px; }
.status-pill option { background: var(--surface-1); color: var(--text-1); text-transform: none; letter-spacing: normal; }

.status-pill-ok     { background-color: rgba(74, 222, 128, 0.15);  color: var(--green);   border-color: rgba(74, 222, 128, 0.45); }
.status-pill-warn   { background-color: rgba(251, 191, 36, 0.15);  color: var(--warning); border-color: rgba(251, 191, 36, 0.45); }
.status-pill-danger { background-color: rgba(248, 113, 113, 0.15); color: var(--danger);  border-color: rgba(248, 113, 113, 0.45); }
.status-pill-info   { background-color: rgba(99, 162, 255, 0.15);  color: #93c5fd;        border-color: rgba(99, 162, 255, 0.45); }
.status-pill-muted  { background-color: var(--surface-3);          color: var(--text-2);  border-color: var(--hairline-2); }

/* ----------------------------------------------------------------------------
   Orders table (wider, with expand rows)
   ---------------------------------------------------------------------------- */
.orders-table { font-size: 13.5px; }
.orders-table th, .orders-table td { padding: 10px 8px; }
.orders-table thead th { text-align: center; }
.orders-table tbody tr.order-expand-row { cursor: default; }
.orders-table tbody tr.order-expand-row:hover { background: transparent; }

.order-expand-body {
  background: var(--bg);
  padding: 14px 16px;
  border-top: 1px solid var(--hairline);
}
.order-expand-meta {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.order-expand-meta strong { color: var(--text-1); font-weight: 500; }
.order-expand-notes {
  margin: 8px 0 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--gold-1);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-1);
}
.order-expand-notes strong { color: var(--gold-2); }

/* Line items grid (used inside the modal AND inside the order detail expand) */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
}
.line-items-table thead th {
  text-align: left;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline-2);
}
.line-items-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.line-items-table tbody tr:last-child td { border-bottom: none; }
.line-items-table .input { padding: 6px 8px; font-size: 13px; }

/* Order totals box (inside Log Order modal) */
.order-totals {
  grid-template-columns: 220px 1fr;
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  border-radius: 8px;
  padding: 12px 16px;
}

/* New totals box with toggles (Items qty, Subtotal, Tariff, Banking Fees, Total) */
.totals-box {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  padding: 16px 20px;
}
.totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-2);
}
.totals-row .mono { color: var(--text-1); }
.totals-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.totals-toggle {
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  padding: 8px 8px;
  margin: 0 -8px;
  transition: background 0.12s;
}
.totals-toggle:hover { background: var(--surface-3); }
.totals-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-2);
  cursor: pointer;
}
.totals-toggle.is-on { color: var(--text-1); }
.totals-toggle:not(.is-on) .mono { color: var(--text-3); }

.totals-final {
  border-top: 1px solid var(--hairline);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 16px;
  color: var(--text-1);
}
.totals-final .total-amount {
  color: var(--gold-2);
  font-weight: 700;
  font-size: 20px;
}

/* Headline fields at the top of the Log Order modal — bigger, Title Case label */
.order-headline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
@media (max-width: 600px) {
  .order-headline-fields { grid-template-columns: 1fr; }
}

.field-emphasis .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0;
  text-transform: none;
}
.field-emphasis .input {
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
  background: var(--surface-2);
}
.field-emphasis select.input { padding-right: 40px; }

/* $ prefix inside an input (used on Price per unit) */
.input-prefix-wrap {
  position: relative;
}
.input-prefix-dollar {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  pointer-events: none;
  font-weight: 500;
  font-size: 14px;
  z-index: 1;
}
.input-prefix-wrap .input {
  padding-left: 24px;
}

/* Square category badge shown under the product picker */
.category-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--gold-soft);
  color: var(--gold-2);
  border: 1px solid var(--gold-1);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Wider modal for order entry; cap height so many line items can scroll */
.order-modal {
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Vertical line-item cards (used in Log Order modal) */
.line-item-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.line-item-card {
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  padding: 14px 16px;
}
.line-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}
.line-item-num {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 600;
}
.line-item-profit {
  padding: 9px 12px;
  background: var(--surface-3);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  font-size: 14px;
}

/* Service chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--gold-1); color: var(--text-1); }
.chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; border: 1px solid var(--text-3);
}
.chip-on {
  background: var(--gold-soft);
  border-color: var(--gold-1);
  color: var(--gold-2);
}
.chip-on .chip-dot { background: var(--gold-2); border-color: var(--gold-2); }

/* Check rows */
.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--gold-2);
  width: 16px; height: 16px;
}
.check-row span     { color: var(--text-1); font-size: 14px; }
.check-row strong   { color: var(--text-1); font-weight: 600; }
.check-row-required { background: var(--gold-soft); border-color: var(--gold-1); }

.form-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
  margin-top: 6px;
}

/* ----------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.12s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--gold-grad);
  color: #2A220C;
  font-weight: 600;
  box-shadow: 0 6px 16px var(--gold-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px var(--gold-glow); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-1);
  border-color: var(--hairline-2);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--gold-1); }

.btn-tertiary {
  background: transparent;
  color: var(--text-2);
  padding: 6px 12px;
}
.btn-tertiary:hover:not(:disabled) { color: var(--text-1); background: var(--surface-2); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.18); }

/* ----------------------------------------------------------------------------
   Clients list (table)
   ---------------------------------------------------------------------------- */
.client-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-1);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.client-table thead th {
  text-align: left;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-2);
}
.client-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-1);
  font-size: 14px;
}
.client-table tbody tr { cursor: pointer; transition: background 0.12s; }
.client-table tbody tr:hover { background: var(--surface-2); }
.client-table tbody tr:last-child td { border-bottom: none; }

.row-arrow { color: var(--gold-2); font-size: 18px; }

.badge {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-1);
}

/* Neutral grey variant — used for "Local" (non-Square) supplier rows */
.badge.badge-muted {
  background: var(--surface-1);
  color: var(--text-2);
  border-color: var(--hairline-2);
}

.empty {
  background: var(--surface-1);
  border: 1px dashed var(--hairline-2);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  color: var(--text-2);
}

/* ----------------------------------------------------------------------------
   HOME PORTAL — landing page after login. Branded hero + role-aware tile grid.
   ---------------------------------------------------------------------------- */
.home-portal {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.home-hero {
  text-align: center;
  padding: 24px 0 36px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 36px;
}

.home-logo {
  height: 140px;
  width: auto;
  filter: drop-shadow(0 0 24px var(--gold-glow));
  margin-bottom: 18px;
}

.home-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  letter-spacing: 0.06em;
  color: var(--text-1);
  margin: 0 0 8px;
  font-weight: 600;
}

.home-greeting {
  font-size: 16px;
  color: var(--text-2);
  margin: 0;
}
.home-greeting strong {
  color: var(--gold-2);
  font-weight: 600;
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.home-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
  padding: 22px 22px 24px;
  background: var(--surface-1);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg);
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease,
              box-shadow 0.12s ease;
}
.home-tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold-1);
  background: var(--surface-2);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--gold-soft) inset;
}
.home-tile:active {
  transform: translateY(0);
}

.home-tile-icon {
  font-size: 32px;
  line-height: 1;
}

.home-tile-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold-2);
  letter-spacing: 0.02em;
}

.home-tile-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

@media (max-width: 720px) {
  .home-logo  { height: 100px; }
  .home-title { font-size: 22px; }
  .home-portal { padding: 20px 16px 36px; }
}

/* Detail key/value grid */
.kv-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  margin: 0;
}
.kv-grid dt { color: var(--text-2); font-size: 13px; }
.kv-grid dd { color: var(--text-1); margin: 0; font-size: 14px; }

/* ----------------------------------------------------------------------------
   Success card overlay (after save)
   ---------------------------------------------------------------------------- */
.success-shell {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 24px;
  z-index: 100;
  animation: fade-in 0.2s var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.success-card {
  width: 100%; max-width: 460px;
  background: var(--surface-1);
  border: 1px solid var(--gold-1);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: 0 30px 80px var(--gold-glow);
  animation: pop-in 0.3s var(--ease-out);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.success-mark {
  width: 72px; height: 72px;
  display: inline-block;
  background: var(--gold-grad);
  border-radius: 18px;
  margin: 0 auto 14px;
  box-shadow: 0 10px 30px var(--gold-glow);
  overflow: hidden;
  padding: 3px;
}
.success-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}
.success-eyebrow {
  color: var(--gold-2);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.success-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 44px;
  font-weight: 700;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.04em;
  margin: 4px 0 8px;
}
.success-name { color: var(--text-2); margin-bottom: 20px; }

.success-emails  {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 12px;
}
.success-actions {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

/* Email status list shown in the SuccessCard */
.email-status {
  display: flex; flex-direction: column; gap: 8px;
  margin: 8px 0 16px;
  text-align: left;
}
.email-status-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm);
}
.email-status-row.is-sent   { border-left: 3px solid var(--green);  background: var(--green-soft); }
.email-status-row.is-failed { border-left: 3px solid var(--danger); background: var(--danger-soft); }
.email-status-icon {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  background: var(--surface-3);
  border-radius: 50%;
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}
.email-status-row.is-sent   .email-status-icon { background: var(--green);  color: #0A2A14; }
.email-status-row.is-failed .email-status-icon { background: var(--danger); color: #2A0A0A; }
.email-status-label { flex: 1; }

/* ----------------------------------------------------------------------------
   Toasts
   ---------------------------------------------------------------------------- */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--surface-1);
  border: 1px solid var(--hairline-2);
  border-left: 3px solid var(--gold-1);
  color: var(--text-1);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  animation: toast-in 0.2s var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
.toast-error { border-left-color: var(--danger); }
.toast-ok    { border-left-color: var(--green); }

/* ----------------------------------------------------------------------------
   Empty / not-yet-staff shell
   ---------------------------------------------------------------------------- */
.empty-shell {
  flex: 1;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 14px; padding: 60px 24px; max-width: 720px; margin: 0 auto;
}
.empty-shell h2 { font-size: 28px; }
.codeblock {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
