/* =====================================================================
   Operation Hub - Stylesheet
   Fixes for: bottom-of-tab visual issues, sidebar overlap with content,
   footer placement, scroll padding, table overflow, modal layout
   ===================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-bg: linear-gradient(180deg, #1e3a5f 0%, #0f2847 100%);
  --sidebar-w: 240px;
  --header-h: 0px;
  --footer-h: 48px;
}
html, body { height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }

.hidden { display: none !important; }

/* ============================== AUTH ============================== */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  padding: 40px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-logo {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px;
  background: var(--sidebar-bg); color: #fff; font-weight: 700; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.auth-brand h1 { font-size: 22px; }
.auth-brand p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.auth-card h2 { font-size: 18px; margin-bottom: 8px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.auth-info-line { font-size: 13px; margin-bottom: 8px; }
.auth-footnote { font-size: 12px; color: var(--text-muted); margin-top: 20px; line-height: 1.5; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.auth-icon-warning, .auth-icon-error {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.auth-icon-warning { background: #fef3c7; color: #92400e; }
.auth-icon-error { background: #fee2e2; color: #991b1b; }
.btn-google {
  width: 100%; padding: 12px 16px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: all 0.15s;
}
.btn-google:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 8px; margin-top: 8px; }

/* ============================== APP SHELL ============================== */
.app { display: flex; min-height: 100vh; }

/* Sidebar — fixed, full height, internal scroll */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: #fff;
  position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column;
  /* Important: allow nav scroll without pushing user-info */
}
.brand { padding: 24px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.brand h1 { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.brand p { font-size: 11px; opacity: 0.7; margin-top: 4px; }

/* Nav: scrollable middle area; takes all leftover vertical space */
nav#navList {
  flex: 1; overflow-y: auto; padding: 12px 0;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px; cursor: pointer; transition: all 0.15s;
  font-size: 14px; border-left: 3px solid transparent; color: rgba(255,255,255,0.85);
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(59,130,246,0.18); border-left-color: var(--primary); color: #93c5fd; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; opacity: 0.85; }

/* User info: pinned at bottom inside sidebar flex column */
.user-info {
  flex-shrink: 0; padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.1); object-fit: cover;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .role { font-size: 11px; opacity: 0.7; }
.btn-icon {
  background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.1);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); }

/* Main: offset by sidebar, with bottom padding to clear footer */
.main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
  padding: 24px 32px 0; /* Bottom padding handled by .page-footer spacing */
  min-width: 0; /* Prevent flex children (charts/tables) from overflowing into sidebar */
  overflow-x: hidden; /* Hard-stop horizontal overflow that caused chart-sidebar overlap */
}

/* Chart containers — enforce containment so Chart.js canvas does not bleed past sidebar */
.chart-container, .chart-wrap, canvas {
  max-width: 100%;
}

/* Sync banner */
.sync-banner {
  background: #eff6ff; color: #1e40af; padding: 8px 16px; border-radius: 8px;
  font-size: 12px; margin-bottom: 16px;
}

/* Page container — flex grow so footer stays at bottom */
#pageContainer { flex: 1; padding-bottom: 32px; }

/* Footer — sticks to bottom of main, never overlaps tab content */
.page-footer {
  margin-top: auto; padding: 14px 0;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-muted);
  background: var(--bg);
}

/* ============================== PAGE LAYOUT ============================== */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: #475569; border: 1px solid var(--border); }
.btn-secondary:hover { background: #f8fafc; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Cards */
.card { background: var(--surface); border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid var(--border-soft); }
.card-title { font-size: 13px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }

/* Grids */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Stat cards */
.stat-card { padding: 16px 18px; }
.stat-card .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--text); margin-top: 6px; line-height: 1.2; }
.stat-card .sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-card.stat-warn { border-left: 3px solid var(--warn); }
.stat-card.stat-danger { border-left: 3px solid var(--danger); }
.stat-card.clickable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.stat-card.clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: var(--primary); }
.stat-card.clickable::after { content: '↗'; float: right; color: var(--text-muted); font-size: 14px; opacity: 0.5; }
.stat-card.clickable:hover::after { color: var(--primary); opacity: 1; }
.big-num { font-size: 32px; font-weight: 700; color: var(--text); margin-top: 8px; }

/* Live dot */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{ opacity: 1 } 50%{ opacity: 0.4 } }

/* Date/period range */
.date-range { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.date-range select, .date-range input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 600px; }
table th { text-align: left; padding: 10px 12px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; border-bottom: 2px solid var(--border); background: #f8fafc; white-space: nowrap; }
table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #f8fafc; }
table .num { text-align: right; font-variant-numeric: tabular-nums; }
table .empty { text-align: center; color: var(--text-muted); padding: 32px 16px; }

/* Sub-tabs */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; flex-wrap: nowrap; }
.sub-tab {
  /* Reset browser default button styles aggressively */
  appearance: none; -webkit-appearance: none;
  background: none !important; background-color: transparent !important;
  border: none !important; border-radius: 0 !important;
  box-shadow: none !important; outline: none !important;
  margin: 0; font-family: inherit; line-height: normal;

  /* Apply consistent tab styling */
  padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent !important;
  white-space: nowrap; transition: color 0.15s, border-color 0.15s;
  display: inline-flex; align-items: center;
}
.sub-tab:hover { color: var(--text); background: none !important; }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary) !important; background: none !important; }
.sub-tab:focus { outline: none !important; box-shadow: none !important; }
.sub-tab:focus-visible { outline: none !important; }
.sub-tab::-moz-focus-inner { border: 0; padding: 0; }
.subpage-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-purple  { background: #ede9fe; color: #6b21a8; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* Form */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; transition: border-color 0.15s; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-control.inline { display: inline-block; width: auto; padding: 4px 8px; font-size: 12px; }

/* Actions row */
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-muted); font-size: 12px; line-height: 1.6; }

/* Chart wrap — REMOVED extra padding/margin issues at bottom */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { max-width: 100% !important; }

/* Permissions table inside modal */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: 13px; }

/* ============================== MODAL ============================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  background: #fff; border-radius: 12px; width: 100%; max-width: 600px;
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-header .btn-icon { background: var(--border-soft); color: var(--text); border: none; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 8px; background: #f8fafc; }

/* ============================== TOAST ============================== */
#toastRoot { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 8px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateX(120%); opacity: 0; transition: all 0.25s;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.toast-success { background: #059669; }
.toast.toast-error { background: #dc2626; }
.toast.toast-warn { background: #d97706; }
.toast.toast-info { background: var(--primary-dark); }

/* ============================== EMPTY PAGE ============================== */
.empty-page { padding: 60px 20px; text-align: center; color: var(--text-muted); }

/* ============================== MOBILE HAMBURGER ============================== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 1001;
  background: rgba(30, 58, 95, 0.95);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
}
.mobile-menu-btn:active { transform: scale(0.95); background: rgba(15, 40, 71, 1); }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-backdrop.active { opacity: 1; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  /* Show hamburger button */
  .mobile-menu-btn { display: flex; }

  /* Sidebar slide-in from left */
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.active { display: block; }

  /* Main content full-width, leave space at top for hamburger */
  .main {
    margin-left: 0;
    padding: 64px 16px 0;
  }

  /* Grids collapse */
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-2.grid-2-mobile { grid-template-columns: repeat(2, 1fr); }

  /* Smaller heading on mobile */
  .page-title { font-size: 18px; }
  .page-header { gap: 12px; margin-bottom: 16px; }

  /* Stat cards tighter on mobile */
  .stat-card { padding: 14px 16px; }
  .stat-card .value { font-size: 20px; }
  .big-num { font-size: 26px; }

  /* Cards padding tighter */
  .card { padding: 14px 16px; }

  /* Buttons larger touch targets */
  .btn { padding: 10px 18px; font-size: 14px; min-height: 40px; }
  .btn-sm { padding: 7px 12px; font-size: 12px; min-height: 32px; }
  .btn-icon { width: 38px; height: 38px; }

  /* Sub-tabs scrollable */
  .sub-tabs { gap: 0; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .sub-tab { padding: 12px 14px; font-size: 13px; }

  /* Form inputs — 16px font prevents iOS zoom on focus */
  .form-control { font-size: 16px; padding: 12px; min-height: 44px; }
  select.form-control { font-size: 16px; }
  textarea.form-control { font-size: 16px; min-height: 80px; }

  /* Modal full-screen on mobile */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: 100%;
    max-height: 92vh;
    width: 100%;
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .modal-header { padding: 14px 16px; position: sticky; top: 0; background: #fff; z-index: 2; }
  .modal-body { padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal-footer {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    background: #f8fafc;
    z-index: 2;
    flex-wrap: wrap;
  }
  .modal-footer .btn { flex: 1; min-width: 100px; }

  /* Tables — keep horizontal scroll, hint shadow on edges */
  .table-wrap {
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
  }
  table { font-size: 12px; }
  table th { padding: 8px 10px; font-size: 10px; }
  table td { padding: 8px 10px; font-size: 12px; }

  /* Toast — bottom center on mobile */
  #toastRoot {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 16px;
    left: 16px;
  }
  .toast { width: 100%; }

  /* Footer at bottom */
  .page-footer { font-size: 10px; padding: 12px 0; flex-wrap: wrap; gap: 4px; }

  /* User info bigger touch */
  .user-info { padding: 14px 18px; }
  .user-avatar { width: 38px; height: 38px; }

  /* Nav items bigger touch */
  .nav-item { padding: 14px 24px; font-size: 14px; min-height: 48px; }

  /* Compliance widget mobile */
  .compl-label { min-width: 90px; font-size: 12px; }
  .compl-tag { font-size: 10px; padding: 2px 8px; }

  /* Card-row stack */
  .card-row { flex-direction: column; align-items: stretch; }
  .card-row .btn { width: 100%; }

  /* Actions row full-width buttons */
  .actions-row { flex-direction: column; }
  .actions-row .btn { width: 100%; }

  /* Safe area for iOS notch */
  body { padding-bottom: env(safe-area-inset-bottom); }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Small phones (iPhone SE, etc) */
@media (max-width: 380px) {
  .main { padding: 60px 12px 0; }
  .page-title { font-size: 16px; }
  .stat-card .value { font-size: 18px; }
  .card { padding: 12px 14px; }
}

/* ===== v2 additions ===== */

/* Badge aliases */
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }

/* Card row (header + button) */
.card-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.card-row .card-title { margin: 0; padding: 0; border: none; }

/* Compliance widget */
.compliance-widget { border-left: 3px solid var(--primary); }
.compliance-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; }
.compl-label { font-weight: 600; color: var(--text); margin-right: 8px; min-width: 120px; }
.compl-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.compl-ok { background: #d1fae5; color: #065f46; }
.compl-pending { background: #fef3c7; color: #92400e; }

/* Live dot indicator */
.live-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: #10b981;
  margin-right: 6px; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Filter bar */
.filter-bar { display: flex; gap: 6px; align-items: center; }

/* Form grid - alternative form layout */
.form-grid { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 12px; font-weight: 600; color: #475569; }
.form-row .input, .input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; background: #fff;
}
.input:focus { outline: none; border-color: var(--primary); }

/* Multi-row containers */
.multi-row, .multi-rows { display: flex; flex-direction: column; gap: 6px; }
.mo-item-row, .po-item-row, .pr-mat-row {
  display: flex; gap: 6px; align-items: center;
}

/* Mini stat (compact stat in widgets) */
.mini-stat { padding: 8px 12px; border-radius: 8px; background: #f8fafc; text-align: center; }
.mini-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.mini-value { font-size: 18px; font-weight: 700; }
.big-num { font-size: 22px; font-weight: 700; }
.mini-stat.clickable { cursor: pointer; transition: transform 0.12s, background 0.12s; }
.mini-stat.clickable:hover { transform: translateY(-1px); background: #eff6ff; }

/* SO variance cells */
.variance-cell.text-warn { color: #92400e; font-weight: 700; }
.variance-cell.text-success { color: #065f46; }
.variance-cell.text-danger { color: #991b1b; font-weight: 700; }
.text-warn { color: #92400e; }
.text-success { color: #065f46; }
.text-danger { color: #991b1b; }

/* Numeric column alignment */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* SO physical input */
.physical-input { width: 80px; padding: 4px 8px; }
.system-stock { color: var(--text-muted); font-style: italic; }

/* Misc */
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #f1f5f9; font-size: 11px; color: #475569;
}
.hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.full { width: 100%; }
.link-icon { text-decoration: none; }
.warn { color: #92400e; }
.danger { color: #991b1b; }

/* Permission table */
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td {
  padding: 6px 10px; text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

/* Date range filter */
.date-range { display: flex; gap: 6px; align-items: center; }

/* Chart wrap */
.chart-wrap { position: relative; height: 280px; }

/* Empty state */
.empty {
  text-align: center; color: var(--text-muted);
  padding: 24px; font-style: italic;
}

/* Muted */
.muted { color: var(--text-muted); }


/* Batch pills (Stock at Location, Tier 3) */
.batch-pill {
  display: inline-block;
  padding: 6px 10px;
  margin: 2px 4px 2px 0;
  background: #f1f5f9;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}
.batch-pill b { color: var(--text); }
.muted-sm {
  font-size: 12px;
  color: var(--text-muted);
}

/* Card row helper */
.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
