/*!
 * ═══════════════════════════════════════════════════════════════
 *  needs.vvtrade.mx — Design System & Stylesheet
 *  Versión   : 1.0.0
 *  Autor     : VVTrade Soluciones
 *  Licencia  : Privado / Uso interno
 *  Descripción: Paleta oscura industrial, tipografía Barlow,
 *               acento ámbar — consistente con vvtrade.mx
 * ═══════════════════════════════════════════════════════════════
 *
 *  SECCIONES
 *  1.  Variables CSS (Design Tokens)
 *  2.  Reset & Base
 *  3.  Scrollbar
 *  4.  Login Screen
 *  5.  App Shell / Topbar
 *  6.  Stat Cards
 *  7.  Toolbar & Forms
 *  8.  Table
 *  9.  Priority & Status Pills
 * 10.  Modal
 * 11.  Side Panel (detalle)
 * 12.  Status Selector
 * 13.  Users View
 * 14.  Logs View
 * 15.  Empty State
 * 16.  Semáforo View
 * 17.  Toast Notifications
 * 18.  Responsive
 * 19.  Utilities
 * ═══════════════════════════════════════════════════════════════
 */


/* ═══════════════════════════════════════════════════════════════
   VVTrade Needs — Design System
═══════════════════════════════════════════════════════════════ */
:root {
  --bg:        #0a0a0a;
  --bg2:       #111111;
  --bg3:       #181818;
  --bg4:       #1f1f1f;
  --border:    #2a2a2a;
  --border2:   #333333;
  --text:      #e8e8e8;
  --text2:     #999999;
  --text3:     #666666;
  --orange:    #f59e0b;
  --orange2:   #ea580c;
  --orange-bg: rgba(245,158,11,.08);
  --orange-glow: rgba(245,158,11,.15);
  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,.08);
  --blue:      #3b82f6;
  --blue-bg:   rgba(59,130,246,.08);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.08);
  --yellow:    #eab308;
  --yellow-bg: rgba(234,179,8,.08);
  --radius:    6px;
  --radius2:   10px;
  --font:      'Barlow', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --cond:      'Barlow Condensed', sans-serif;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ══════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════ */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(245,158,11,.06) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(245,158,11,.015) 40px, rgba(245,158,11,.015) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(245,158,11,.015) 40px, rgba(245,158,11,.015) 41px);
}

.login-box {
  width: 380px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 44px 40px;
  box-shadow: var(--shadow), 0 0 60px rgba(245,158,11,.06);
  animation: fadeUp .4s ease;
}

@keyframes fadeUp {
  from { opacity:0; transform: translateY(12px); }
  to   { opacity:1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .wordmark {
  font-family: var(--cond);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--orange);
}

.login-logo .sub {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}

.pin-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0 28px;
}

.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: transparent;
  transition: all .15s;
}

.pin-dot.filled {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 8px rgba(245,158,11,.5);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.pin-key {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  transition: all .12s;
  text-align: center;
  user-select: none;
}

.pin-key:hover {
  background: var(--bg4);
  border-color: var(--orange);
  color: var(--orange);
}

.pin-key:active { transform: scale(.95); }

.pin-key.clear {
  color: var(--text3);
  font-size: .85rem;
}

.btn-login {
  width: 100%;
  background: var(--orange);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--cond);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  text-transform: uppercase;
}

.btn-login:hover { background: var(--orange2); }
.btn-login:disabled { opacity:.4; cursor:not-allowed; }

.login-error {
  color: var(--red);
  font-size: .82rem;
  text-align: center;
  margin-top: 12px;
  min-height: 1.2em;
}

/* ══════════════════════════════════
   APP SHELL
══════════════════════════════════ */
#app {
  display: none;
  min-height: 100vh;
}

/* ── Top Bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 56px;
  gap: 20px;
}

.topbar-brand {
  font-family: var(--cond);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--orange);
  flex-shrink: 0;
}

.topbar-brand span {
  color: var(--text3);
  font-weight: 400;
  font-size: .9rem;
  margin-left: 8px;
  letter-spacing: .04em;
}

.topbar-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover { background: var(--bg3); color: var(--text); }
.nav-tab.active { background: var(--orange-bg); color: var(--orange); }

.nav-tab .badge {
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 6px;
  line-height: 1.5;
}

.topbar-user {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px 5px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
}

.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--orange);
  color: #000;
  font-weight: 700;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.role-badge.MASTER     { background: rgba(245,158,11,.2); color: var(--orange); }
.role-badge.AGENTE     { background: rgba(59,130,246,.2); color: var(--blue); }
.role-badge.SOLICITANTE{ background: rgba(34,197,94,.2); color: var(--green); }

.btn-icon {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  padding: 7px 10px;
  cursor: pointer;
  transition: all .15s;
  font-size: .85rem;
}

.btn-icon:hover { border-color: var(--border2); color: var(--text); }

/* ── Main Content ── */
.content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; }

/* ══════════════════════════════════
   STAT CARDS
══════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.orange::before { background: var(--orange); }
.stat-card.green::before  { background: var(--green); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.red::before    { background: var(--red); }
.stat-card.yellow::before { background: var(--yellow); }

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--cond);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.blue   .stat-value { color: var(--blue); }
.stat-card.red    .stat-value { color: var(--red); }
.stat-card.yellow .stat-value { color: var(--yellow); }

/* ══════════════════════════════════
   TOOLBAR / FILTERS
══════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-title {
  font-family: var(--cond);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  flex: 1;
  min-width: 140px;
}

select, input[type=text], input[type=number], textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .85rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color .15s;
}

select:focus, input[type=text]:focus, input[type=number]:focus, textarea:focus {
  border-color: var(--orange);
}

select option { background: var(--bg3); }

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.btn {
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  color: #000;
}
.btn-primary:hover { background: var(--orange2); }

.btn-secondary {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }

.btn-danger {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,.3);
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-green {
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,.3);
  color: var(--green);
}
.btn-green:hover { background: var(--green); color: #000; }

.btn-sm { padding: 5px 10px; font-size: .78rem; }

/* ══════════════════════════════════
   TABLE
══════════════════════════════════ */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,.015); }

.td-id {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--orange);
}

/* ── Priority Pills ── */
.prio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.prio.P1 { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.prio.P2 { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(234,179,8,.25); }
.prio.P3 { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,.25); }

/* ── Status Pills ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}

.status-pill.ABIERTO    { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(239,68,68,.2); }
.status-pill.EN-PROCESO { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(59,130,246,.2); }
.status-pill.RESUELTO   { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(34,197,94,.2); }

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill.ABIERTO    .status-dot { background: var(--red); animation: pulse 1.5s infinite; }
.status-pill.EN-PROCESO .status-dot { background: var(--blue); }
.status-pill.RESUELTO   .status-dot { background: var(--green); }

@keyframes pulse {
  0%,100% { opacity:1; }
  50%      { opacity:.3; }
}

/* ══════════════════════════════════
   MODAL
══════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeUp .25s ease;
  box-shadow: var(--shadow), 0 0 80px rgba(0,0,0,.6);
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-family: var(--cond);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color .15s;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
}

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-btn {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all .12s;
}

.radio-btn:hover { border-color: var(--border2); }
.radio-btn[data-val="P1"].sel { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.radio-btn[data-val="P2"].sel { border-color: var(--yellow); background: var(--yellow-bg); color: var(--yellow); }
.radio-btn[data-val="P3"].sel { border-color: var(--green); background: var(--green-bg); color: var(--green); }

/* ══════════════════════════════════
   DETAIL PANEL (slide-in)
══════════════════════════════════ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 400;
  display: none;
}

.panel-overlay.open { display: block; }

.side-panel {
  position: fixed;
  top: 0; right: -540px;
  width: 540px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 450;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-panel.open { right: 0; }

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg3);
}

.panel-id {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--orange);
  font-weight: 500;
}

.panel-cat {
  font-size: .75rem;
  color: var(--text3);
  margin-top: 2px;
}

.panel-header-meta {
  flex: 1;
}

.panel-title {
  font-size: .95rem;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.4;
}

.panel-body { flex: 1; overflow-y: auto; padding: 20px; }

.panel-section {
  margin-bottom: 20px;
}

.panel-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-item { display: flex; flex-direction: column; gap: 3px; }

.meta-k {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
}

.meta-v {
  font-size: .85rem;
  color: var(--text);
}

.desc-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .87rem;
  line-height: 1.6;
  color: var(--text);
}

/* Actions timeline */
.action-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.action-item:last-child { border-bottom: none; }

.action-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 5px;
  flex-shrink: 0;
}

.action-by {
  font-size: .75rem;
  font-weight: 600;
  color: var(--orange);
}

.action-ts {
  font-size: .7rem;
  color: var(--text3);
}

.action-note {
  font-size: .83rem;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.5;
}

.panel-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}

.action-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.action-input-wrap textarea {
  flex: 1;
  min-height: 56px;
}

.panel-actions-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════
   STATUS SELECTOR
══════════════════════════════════ */
.status-select {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-opt {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg4);
  color: var(--text2);
  transition: all .12s;
}

.status-opt:hover { border-color: var(--border2); }
.status-opt.sel-ABIERTO    { background: var(--red-bg);   border-color: rgba(239,68,68,.4); color: var(--red); }
.status-opt.sel-EN-PROCESO { background: var(--blue-bg);  border-color: rgba(59,130,246,.4); color: var(--blue); }
.status-opt.sel-RESUELTO   { background: var(--green-bg); border-color: rgba(34,197,94,.4); color: var(--green); }

/* ══════════════════════════════════
   USERS VIEW
══════════════════════════════════ */
.user-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  transition: border-color .15s;
}

.user-card:hover { border-color: var(--border2); }

.user-card-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--orange-bg);
  border: 2px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cond);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
}

.user-card-info { flex: 1; }
.user-card-name { font-weight: 600; font-size: .92rem; }
.user-card-meta { font-size: .78rem; color: var(--text3); margin-top: 2px; }

.inactive-badge {
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text3);
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 2px 7px;
}

/* ══════════════════════════════════
   LOGS VIEW
══════════════════════════════════ */
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}

.log-item:last-child { border-bottom: none; }

.log-ts {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text3);
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 130px;
}

.log-action {
  font-weight: 700;
  color: var(--orange);
  font-family: var(--mono);
  font-size: .72rem;
  flex-shrink: 0;
  min-width: 120px;
  padding-top: 1px;
}

.log-detail { color: var(--text2); line-height: 1.4; }
.log-user { color: var(--text3); font-size: .75rem; margin-top: 2px; }

/* ══════════════════════════════════
   EMPTY STATE
══════════════════════════════════ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.empty-text { font-size: .9rem; }

/* ══════════════════════════════════
   SEMAPHORE VIEW
══════════════════════════════════ */
.semaphore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.sem-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 18px;
}

.sem-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sem-light {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sem-light.red    { background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse 1.5s infinite; }
.sem-light.yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.sem-light.green  { background: var(--green); box-shadow: 0 0 8px var(--green); }

.sem-card-title {
  font-weight: 600;
  font-size: .9rem;
}

.sem-numbers {
  display: flex;
  gap: 8px;
}

.sem-num {
  flex: 1;
  text-align: center;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 8px 4px;
}

.sem-num-val {
  font-family: var(--cond);
  font-size: 1.4rem;
  font-weight: 700;
}

.sem-num-val.red    { color: var(--red); }
.sem-num-val.yellow { color: var(--yellow); }
.sem-num-val.green  { color: var(--green); }

.sem-num-lbl {
  font-size: .62rem;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ══════════════════════════════════
   TOAST
══════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .83rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .2s ease;
  box-shadow: var(--shadow);
  max-width: 320px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--orange); }

@keyframes toastIn {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar-nav { gap: 2px; }
  .nav-tab { padding: 6px 10px; font-size: .76rem; }
  .form-row { grid-template-columns: 1fr; }
  .side-panel { width: 100vw; }
  .meta-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════
   UTILITY
══════════════════════════════════ */
.hidden { display: none !important; }
.text-orange { color: var(--orange); }
.text-muted  { color: var(--text3); }
.text-sm     { font-size: .8rem; }
.mono        { font-family: var(--mono); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.flex { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }

/* PIN toggle visibility (security) */
.pin-hidden-text {
  letter-spacing: .3em;
  font-family: var(--mono);
}
