/* ============================================
   OrderHub — Sistema de Gestión de Órdenes
   ============================================ */

:root {
  --bg: #f0f2f5;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #a8a8b8;
  --sidebar-active: #ffffff;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header h1 {
  font-size: 1.3rem;
  color: white;
  margin-bottom: 0.2rem;
}

.sidebar-header .subtitle {
  font-size: 0.75rem;
  opacity: 0.6;
}

.nav-menu {
  list-style: none;
  padding: 0.75rem 0;
  flex: 1;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.nav-link.active {
  background: rgba(79, 70, 229, 0.15);
  color: white;
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar { font-size: 1.2rem; }

.user-select {
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
  flex: 1;
  cursor: pointer;
}

.user-select option { color: #333; }

.user-name {
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fca5a5;
  font-size: 1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}
.btn-logout:hover { background: rgba(239,68,68,0.2); color: #fff; }

.role-badge {
  margin-top: 0.35rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content */
.content {
  flex: 1;
  margin-left: 240px;
  padding: 1.5rem 2rem;
}

/* Views */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.view-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--primary);
}

.stat-card .stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.stat-card.yellow { border-left-color: var(--warning); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.blue { border-left-color: var(--info); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.purple { border-left-color: #8b5cf6; }

.stat-card .stat-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* Tabs (Base de datos RICHBM) */
.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}
.tabs .tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.tabs .tab:hover { background: #f3f4f6; color: var(--text-primary); }
.tabs .tab.active {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom-color: var(--card-bg);
  color: var(--primary);
  margin-bottom: -1px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Section Row */
.section-row {
  display: flex;
  gap: 1rem;
}

.flex-1 { flex: 1; }

/* Tables */
.table-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: #f9fafb;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-sin_asignar { background: #fef3c7; color: #92400e; }
.badge-asignado { background: #ffedd5; color: #9a3412; }
.badge-confirmada { background: #d1fae5; color: #065f46; }
.badge-en_preparacion { background: #dbeafe; color: #1e40af; }
.badge-enviada { background: #e0e7ff; color: #3730a3; }
.badge-entregada { background: #d1fae5; color: #064e3b; }
.badge-cancelada { background: #fee2e2; color: #991b1b; }

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: #f3f4f6;
  color: var(--text);
}

.btn-secondary:hover { background: #e5e7eb; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

/* Inputs */
.input-search, .input-select, .input, .input-scan {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

.input-search:focus, .input-select:focus, .input:focus, .input-scan:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.input-search { width: 280px; }
.input-scan { flex: 1; font-size: 1.1rem; padding: 0.75rem; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.2rem; }

.btn-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
}

.modal-body { padding: 1.5rem; }

/* Order Detail in Modal */
.order-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-group label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.info-group span {
  font-weight: 600;
  font-size: 0.95rem;
}

.items-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.items-table th, .items-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.items-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Actions section in modal */
.order-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.notes-section { margin-top: 1rem; }

.notes-section textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

/* Dispatch */
.dispatch-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
}

.scan-area { margin-top: 1rem; }

.scan-area label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.scan-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.scan-result {
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  font-weight: 600;
}

.scan-success { background: #d1fae5; color: #065f46; }
.scan-error { background: #fee2e2; color: #991b1b; }

/* Batch list items */
.batch-item {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-item:hover { border-color: var(--primary); }

.batch-item .batch-number {
  font-weight: 700;
  font-size: 0.9rem;
}

.batch-item .batch-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Store Cards */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.store-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
}

.store-card h3 {
  margin-bottom: 0.5rem;
}

.store-card .store-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Form Row */
.form-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-row .input { flex: 1; min-width: 150px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.zone-chip {
  display: inline-block;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.zone-chip-external {
  background: #0ea5e9;
  border: 1px dashed #fff;
}

/* Status Log */
.status-log {
  max-height: 200px;
  overflow-y: auto;
}

.log-entry {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.8rem;
}

.log-entry .log-text { color: var(--text-secondary); }
.log-entry .log-date { color: #9ca3af; font-size: 0.75rem; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
}

.pagination button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.hidden { display: none !important; }

/* Mini table in dashboard */
.mini-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.mini-table td, .mini-table th {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.mini-table th {
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h1 { font-size: 1.2rem; }
  .sidebar-header .subtitle, .nav-link { font-size: 0.75rem; }
  .content { margin-left: 60px; padding: 1rem; }
  .section-row { flex-direction: column; }
  .dispatch-layout { grid-template-columns: 1fr; }
  .order-info-grid { grid-template-columns: 1fr; }
  .input-search { width: 100%; }
}

/* === Liquidaciones === */
.btn-xs {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.metric-box {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
}
.metric-box .metric-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.metric-box .metric-value {
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 2px;
}
.settlement-card {
  border-left: 4px solid var(--primary);
}
.debt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.debt-row:last-child { border-bottom: none; }
.debt-pending { background: #fef2f2; }
.debt-paid { background: #ecfdf5; }

/* ============ DASHBOARD ============ */
.dash-section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
  color: var(--text-primary);
}

/* Alertas */
.alerts-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.alert-pill {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.alert-red   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-amber { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-ok {
  background: #ecfdf5;
  color: #065f46;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Rates */
.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.rate-card {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: white;
  border-left: 3px solid;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.rate-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.rate-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.rate-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}
.rate-green  { border-left-color: #10b981; }
.rate-green  .rate-value { color: #10b981; }
.rate-amber  { border-left-color: #f59e0b; }
.rate-amber  .rate-value { color: #f59e0b; }
.rate-red    { border-left-color: #ef4444; }
.rate-red    .rate-value { color: #ef4444; }

/* Timeline chart */
.tl-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.tl-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.tl-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 180px;
  padding: 0.5rem 0;
  overflow-x: auto;
}
.tl-col {
  flex: 1;
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  cursor: default;
}
.tl-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  justify-content: center;
}
.tl-bar {
  width: 45%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: opacity 0.15s;
}
.tl-bar:hover { opacity: 0.85; }
.tl-bar span {
  position: absolute;
  top: -1.15rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.tl-bar-creadas    { background: #6366f1; }
.tl-bar-entregadas { background: #10b981; }
.tl-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  white-space: nowrap;
}

/* Month compare */
.flex-2 { flex: 2; }
.mc-tab {
  font-size: 0.75rem !important;
  padding: 0.3rem 0.65rem !important;
}
.mc-tab.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}
.mc-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.mc-summary strong { color: var(--text-primary); }

/* Today vs Yesterday */
.tvy-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.tvy-row:last-child { border-bottom: none; }
.tvy-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.tvy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}
.tvy-cell {
  background: #f9fafb;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  text-align: center;
}
.tvy-prev { background: #f3f4f6; color: var(--text-secondary); }
.tvy-delta { background: #eff6ff; font-weight: 700; }
.tvy-tag {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tvy-val {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.1rem;
}
.tvy-delta .tvy-val { font-size: 0.9rem; }

/* ============ ALERTS ============ */
.nav-badge {
  display: inline-block;
  margin-left: 0.4rem;
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
  min-width: 18px;
  text-align: center;
}
.nav-badge.critical {
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseBadge 2s infinite;
}
.nav-badge.hidden { display: none; }
@keyframes pulseBadge {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.alerts-filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.alerts-filter-btn {
  font-size: 0.78rem !important;
  padding: 0.35rem 0.75rem !important;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.alerts-filter-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.alert-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: white;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border-left: 4px solid;
}
.alert-item.sev-critical { border-left-color: #ef4444; background: #fef2f2; }
.alert-item.sev-warning  { border-left-color: #f59e0b; background: #fffbeb; }
.alert-item.sev-info     { border-left-color: #3b82f6; background: #eff6ff; }
.alert-item-icon { font-size: 1.4rem; flex-shrink: 0; }
.alert-item-body { flex: 1; min-width: 0; }
.alert-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.alert-item-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.alert-item-meta {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.sev-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.sev-tag-critical { background: #ef4444; color: white; }
.sev-tag-warning  { background: #f59e0b; color: white; }
.sev-tag-info     { background: #3b82f6; color: white; }
.aud-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
}
.alert-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
}
.toast {
  background: white;
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-left: 4px solid #3b82f6;
  font-size: 0.9rem;
  min-width: 260px;
  max-width: 360px;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-critical { border-left-color: #ef4444; }
.toast-warning  { border-left-color: #f59e0b; }
