/* ============================================================
   SeguimientoPro — Design System v2
   Aesthetic: Refined professional · Warm neutrals · Confident
   Font: DM Sans (UI) + DM Mono (folios)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --brand:           #2563EB;
  --brand-dark:      #1D4ED8;
  --brand-soft:      #EFF6FF;
  --brand-mid:       #BFDBFE;
  --bg:              #F8F9FC;
  --surface:         #FFFFFF;
  --surface-hover:   #F1F5F9;
  --border:          #E2E8F0;
  --border-strong:   #CBD5E1;
  --text-primary:    #0F172A;
  --text-secondary:  #475569;
  --text-muted:      #94A3B8;
  --success:         #16A34A;
  --success-bg:      #F0FDF4;
  --success-border:  #BBF7D0;
  --warning:         #D97706;
  --warning-bg:      #FFFBEB;
  --warning-border:  #FDE68A;
  --danger:          #DC2626;
  --danger-bg:       #FEF2F2;
  --danger-border:   #FECACA;
  --info:            #0284C7;
  --info-bg:         #F0F9FF;
  --info-border:     #BAE6FD;
  --wa:              #25D366;
  --wa-dark:         #1DA851;
  --sidebar-w:       256px;
  --topbar-h:        60px;
  --radius-sm:       6px;
  --radius:          10px;
  --radius-lg:       14px;
  --radius-xl:       20px;
  --radius-full:     9999px;
  --shadow-xs:       0 1px 2px rgba(15,23,42,.04);
  --shadow-sm:       0 1px 3px rgba(15,23,42,.08),0 1px 2px rgba(15,23,42,.04);
  --shadow-md:       0 4px 6px rgba(15,23,42,.06),0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:       0 10px 24px rgba(15,23,42,.08),0 4px 8px rgba(15,23,42,.04);
  --shadow-xl:       0 20px 40px rgba(15,23,42,.14);
  --shadow-brand:    0 4px 14px rgba(37,99,235,.28);
  --font:            'DM Sans', system-ui, sans-serif;
  --font-mono:       'DM Mono', monospace;
  --ease:            cubic-bezier(.4,0,.2,1);
  --dur-fast:        120ms;
  --dur:             200ms;
  --dur-slow:        320ms;
}

/* ── Reset ───────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--text-primary); background: var(--bg); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--brand-dark); }
button { font-family: var(--font); cursor: pointer; }

/* ── Inputs ──────────────────────────────────────────────── */
input,select,textarea {
  font-family: var(--font); font-size: 14px; color: var(--text-primary);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  outline: none;
}
input:focus,select:focus,textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
input::placeholder,textarea::placeholder { color: var(--text-muted); }
input[type=color]    { padding: 3px 6px; height: 40px; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
input[type=datetime-local] { font-size: 13px; }
label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; margin-bottom: 5px; letter-spacing: .01em; }
textarea { resize: vertical; min-height: 72px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px; font-family: var(--font); font-size: 13px;
  font-weight: 600; line-height: 1; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; cursor: pointer;
  transition: all var(--dur-fast) var(--ease); white-space: nowrap;
  text-decoration: none !important; letter-spacing: .01em;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary  { background: var(--brand);   color: #fff; border-color: var(--brand);   box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.38); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text-primary); }
.btn-ghost  { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-wa     { background: var(--wa);    color: #fff; border-color: var(--wa); }
.btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Layout ──────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar { width: var(--sidebar-w); background: #0F172A; display: flex; flex-direction: column; flex-shrink: 0; z-index: 20; }

.sidebar-brand { padding: 20px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand-icon { width: 36px; height: 36px; background: var(--brand); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(37,99,235,.45); }
.brand-icon svg { width: 20px; height: 20px; color: #fff; }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.brand-tagline { font-size: 10px; color: rgba(255,255,255,.35); margin-top: 1px; }

.negocio-chip { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: var(--radius-sm); }
.negocio-avatar { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg,var(--brand),#7C3AED); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.negocio-info { min-width: 0; }
.negocio-nombre { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.negocio-plan { font-size: 10px; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .06em; }

.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-section-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.28); text-transform: uppercase; letter-spacing: .09em; padding: 0 8px; margin: 18px 0 5px; }
.nav-section-label:first-child { margin-top: 4px; }

.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: rgba(255,255,255,.52); cursor: pointer; transition: all var(--dur-fast) var(--ease); text-decoration: none !important; margin-bottom: 2px; position: relative; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(37,99,235,.28); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); min-width: 18px; text-align: center; }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.user-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease); }
.user-row:hover { background: rgba(255,255,255,.05); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,var(--brand),#7C3AED); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.32); }
.logout-btn { width: 28px; height: 28px; border-radius: var(--radius-sm); background: rgba(255,255,255,.06); border: none; color: rgba(255,255,255,.38); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur-fast) var(--ease); flex-shrink: 0; text-decoration: none !important; }
.logout-btn:hover { background: var(--danger); color: #fff; }
.logout-btn svg { width: 14px; height: 14px; }

/* ── Main area ───────────────────────────────────────────── */
#main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 16px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-title { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#content { flex: 1; overflow-y: auto; padding: 24px; scroll-behavior: smooth; }

/* ── Flash ───────────────────────────────────────────────── */
.flash-msg { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; margin-bottom: 20px; border: 1.5px solid; animation: slideDown var(--dur-slow) var(--ease); }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.flash-ok  { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.flash-err { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-border); }
.flash-close { margin-left: auto; background: none; border: none; cursor: pointer; opacity: .6; font-size: 18px; color: inherit; }
.flash-close:hover { opacity: 1; }

/* ── Metric cards ────────────────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 14px; margin-bottom: 24px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; position: relative; overflow: hidden; transition: box-shadow var(--dur) var(--ease),transform var(--dur) var(--ease); cursor: default; }
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.metric-card::after { content:''; position:absolute; top:0; right:0; width:80px; height:80px; border-radius:50%; opacity:.07; transform:translate(20px,-20px); }
.metric-card.blue::after   { background:var(--brand); }
.metric-card.amber::after  { background:var(--warning); }
.metric-card.green::after  { background:var(--success); }
.metric-card.red::after    { background:var(--danger); }
.metric-icon { width: 38px; height: 38px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.metric-icon svg { width: 18px; height: 18px; }
.metric-card.blue  .metric-icon { background: var(--brand-soft); color: var(--brand); }
.metric-card.amber .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-card.green .metric-icon { background: var(--success-bg); color: var(--success); }
.metric-card.red   .metric-icon { background: var(--danger-bg);  color: var(--danger); }
.metric-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.metric-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.metric-card.blue  .metric-value { color: var(--brand); }
.metric-card.amber .metric-value { color: var(--warning); }
.metric-card.green .metric-value { color: var(--success); }
.metric-card.red   .metric-value { color: var(--danger); }
.metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Order rows ──────────────────────────────────────────── */
.orders-list { display: flex; flex-direction: column; gap: 8px; }
.order-row { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all var(--dur-fast) var(--ease); text-decoration: none !important; color: var(--text-primary) !important; }
.order-row:hover { border-color: var(--brand-mid); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.order-folio { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text-muted); background: var(--bg); padding: 3px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); min-width: 74px; text-align: center; flex-shrink: 0; }
.order-body { flex: 1; min-width: 0; }
.order-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.order-date { font-size: 11px; color: var(--text-muted); min-width: 96px; text-align: right; flex-shrink: 0; }
.order-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; flex-shrink: 0; }
.badge::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; flex-shrink:0; opacity:.7; }

/* ── Filter tabs ─────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; margin-bottom: 18px; width: fit-content; flex-wrap: wrap; }
.filter-tab { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: var(--text-muted); background: transparent; border: none; cursor: pointer; transition: all var(--dur-fast) var(--ease); text-decoration: none !important; white-space: nowrap; }
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ── Search ──────────────────────────────────────────────── */
.search-bar { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-bar svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.search-bar input { padding-left: 34px; }

/* ── Section header ──────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }

/* ── Forms ───────────────────────────────────────────────── */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; max-width: 640px; }
.form-card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--bg); }
.form-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.form-card-desc  { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.form-card-body  { padding: 24px; }
.form-grid { display: grid; gap: 16px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; }
.form-hint  { font-size: 11px; color: var(--text-muted); margin-top: 5px; display: flex; align-items: flex-start; gap: 4px; line-height: 1.4; }
.form-hint svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; }
.form-section { padding-top: 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.form-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

/* ── Detail grid ─────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.detail-card-header { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; background: var(--bg); display: flex; align-items: center; gap: 6px; }
.detail-card-header svg { width: 13px; height: 13px; }
.detail-card-body { padding: 14px 16px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--bg); gap: 8px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.detail-row .v { font-size: 13px; font-weight: 600; text-align: right; }

/* ── Timeline ────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; align-items: flex-start; gap: 12px; }
.tl-connector { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; transition: all var(--dur) var(--ease); }
.tl-dot.done   { background: var(--success); color: #fff; }
.tl-dot.active { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-dot.next   { background: var(--bg); color: var(--text-muted); border: 2px solid var(--border); }
.tl-line { width: 2px; height: 18px; background: var(--border); margin: 3px 0; flex-shrink: 0; transition: background var(--dur) var(--ease); }
.tl-line.done  { background: var(--success); }
.tl-content { padding-bottom: 16px; padding-top: 3px; flex: 1; }
.tl-label { font-size: 13px; font-weight: 500; }
.tl-label.done   { color: var(--text-muted); text-decoration: line-through; }
.tl-label.active { font-weight: 700; color: var(--text-primary); }
.tl-label.next   { color: var(--text-muted); }

/* ── Historial ───────────────────────────────────────────── */
.hist-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bg); }
.hist-item:last-child { border-bottom: none; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 5px; flex-shrink: 0; }
.hist-dot.creacion      { background: var(--brand); }
.hist-dot.cambio_estado { background: var(--warning); }
.hist-dot.pago          { background: var(--success); }
.hist-time { font-size: 11px; color: var(--text-muted); min-width: 44px; flex-shrink: 0; margin-top: 1px; font-family: var(--font-mono); }
.hist-desc { font-size: 12px; color: var(--text-secondary); flex: 1; }

/* ── Estado items (config) ───────────────────────────────── */
.estado-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; transition: box-shadow var(--dur-fast) var(--ease); }
.estado-item:hover { box-shadow: var(--shadow-sm); }
.estado-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.estado-nombre { flex: 1; font-size: 13px; font-weight: 600; }
.estado-final-badge { font-size: 10px; background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); padding: 2px 8px; border-radius: var(--radius-full); font-weight: 700; }

/* ── Tooltip system ──────────────────────────────────────── */
.help-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--border); color: var(--text-muted); font-size: 10px; font-weight: 700; cursor: help; flex-shrink: 0; transition: all var(--dur-fast) var(--ease); font-style: normal; }
.help-icon:hover { background: var(--brand-mid); color: var(--brand); }
[data-tooltip] { position: relative; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #1E293B; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45; padding: 8px 12px; border-radius: var(--radius); white-space: pre-wrap; max-width: 230px; text-align: center; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease); z-index: 200; box-shadow: var(--shadow-lg); }
[data-tooltip]::before { content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1E293B; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease); z-index: 200; }
[data-tooltip]:hover::after,[data-tooltip]:hover::before { opacity: 1; }

/* ── Callout boxes ───────────────────────────────────────── */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1.5px solid; font-size: 13px; line-height: 1.5; }
.callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.callout strong { font-weight: 700; display: block; margin-bottom: 3px; }
.callout.info   { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info); }
.callout.tip    { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.callout.guide  { background: var(--brand-soft); border-color: var(--brand-mid);      color: var(--brand); }
.callout.success{ background: var(--success-bg); border-color: var(--success-border); color: var(--success); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 44px; margin-bottom: 14px; opacity: .5; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; max-width: 300px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0F172A; background-image: radial-gradient(circle at 20% 50%,rgba(37,99,235,.18) 0%,transparent 50%), radial-gradient(circle at 80% 20%,rgba(124,58,237,.12) 0%,transparent 40%); padding: 24px; }
.auth-card { background: var(--surface); border-radius: var(--radius-xl); padding: 42px; width: 100%; max-width: 440px; box-shadow: var(--shadow-xl); animation: authIn var(--dur-slow) var(--ease); }
@keyframes authIn { from { opacity:0; transform:translateY(16px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
.auth-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.auth-brand-icon { width: 44px; height: 44px; background: var(--brand); border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-brand); }
.auth-brand-icon svg { width: 24px; height: 24px; color: #fff; }
.auth-brand-name { font-size: 21px; font-weight: 800; color: var(--text-primary); letter-spacing: -.02em; }
.auth-title { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -.02em; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted); }
.auth-demo-box { padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.auth-demo-box strong { color: var(--text-secondary); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; margin-top: 18px; flex-wrap: wrap; }
.page-btn { min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all var(--dur-fast) var(--ease); text-decoration: none !important; }
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }

/* ── Toast ───────────────────────────────────────────────── */
#sp-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px); background: #1E293B; color: #fff; padding: 11px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 500; z-index: 9999; opacity: 0; transition: opacity var(--dur) var(--ease),transform var(--dur) var(--ease); pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-xl); display: flex; align-items: center; gap: 8px; }
#sp-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ──────────────────────────────────────────── */
@media(max-width:768px) {
  #sidebar { display: none; }
  .detail-grid,.form-row { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  #content { padding: 16px; }
}
@media(max-width:480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .order-date,.order-actions { display: none; }
  .auth-card { padding: 28px 22px; }
}

/* ── Utils ───────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-sm       { font-size: 12px; }
.text-xs       { font-size: 11px; }
.font-mono     { font-family: var(--font-mono); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-brand    { color: var(--brand); }
.mt-1{margin-top:8px;} .mt-2{margin-top:16px;} .mt-3{margin-top:24px;}
.mb-1{margin-bottom:8px;} .mb-2{margin-bottom:16px;}
.flex{display:flex;} .items-center{align-items:center;} .justify-between{justify-content:space-between;} .flex-wrap{flex-wrap:wrap;}
.gap-1{gap:8px;} .gap-2{gap:14px;}
.w-full{width:100%;} .hidden{display:none!important;}