:root {
  --bg-0: #0a0f1c;
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --bg-3: #334155;
  --surface: rgba(30, 41, 59, 0.6);
  --surface-2: rgba(15, 23, 42, 0.7);
  --border: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.3);
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #10b981;
  --accent-3: #a78bfa;
  --danger: #f43f5e;
  --warn: #f59e0b;
  --success: #10b981;
  --gradient-1: linear-gradient(135deg, #38bdf8, #818cf8);
  --gradient-2: linear-gradient(135deg, #10b981, #38bdf8);
  --gradient-3: linear-gradient(135deg, #f43f5e, #a78bfa);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-0);
  background-image:
    radial-gradient(at 20% 0%, rgba(56,189,248,0.15) 0, transparent 50%),
    radial-gradient(at 80% 100%, rgba(167,139,250,0.12) 0, transparent 50%),
    radial-gradient(at 0% 100%, rgba(16,185,129,0.1) 0, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }

/* ===== Auth ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}
.auth-sub { color: var(--text-muted); margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; padding: 9px 12px; border: 0; background: transparent; color: var(--text-muted);
  border-radius: 7px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.auth-tabs button.active { background: var(--bg-1); color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }

/* ===== Form ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 11px 13px; background: var(--bg-1); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  transition: all 0.2s;
}
.form-row textarea { resize: vertical; min-height: 80px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border: 0; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.18s;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  font-family: inherit;
}
.btn:hover { background: var(--bg-3); transform: translateY(-1px); }
.btn-primary { background: var(--gradient-1); border: 0; color: #fff; }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 18px rgba(56,189,248,0.3); }
.btn-success { background: var(--gradient-2); border: 0; color: #fff; }
.btn-danger { background: var(--danger); border: 0; color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ===== Layout ===== */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface-2); backdrop-filter: blur(16px);
  border-right: 1px solid var(--border); padding: 22px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo {
  font-size: 20px; font-weight: 800;
  background: var(--gradient-1); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 8px 18px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: var(--text-dim);
  cursor: pointer; font-weight: 500; margin-bottom: 3px; transition: all 0.15s;
  font-size: 13.5px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(56,189,248,0.12); color: var(--accent); }
.nav-icon { width: 18px; flex-shrink: 0; }
.sidebar-footer {
  margin-top: auto; padding: 14px 8px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface-2);
}
.sidebar-footer .who { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.sidebar-footer .name { font-weight: 600; color: var(--text); margin-bottom: 8px; word-break: break-all; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}

.main { padding: 28px 30px; }
@media (max-width: 600px) { .main { padding: 18px 14px; } }

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

/* ===== Cards ===== */
.card {
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.card-hover { transition: all 0.2s; cursor: pointer; }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-1);
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.menu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.menu-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.menu-card .ic {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-1); margin-bottom: 12px; font-size: 20px;
}
.menu-card .t { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.menu-card .d { color: var(--text-muted); font-size: 12.5px; }

/* ===== Lists / Items ===== */
.list-item {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 10px; align-items: center; cursor: pointer; transition: all 0.18s;
}
.list-item:hover { border-color: var(--border-strong); transform: translateX(2px); }
.list-item .name { font-weight: 600; font-size: 15px; }
.list-item .meta { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(56,189,248,0.15); color: var(--accent); text-transform: capitalize;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--accent-2); }
.badge-warn { background: rgba(245,158,11,0.15); color: var(--warn); }
.badge-danger { background: rgba(244,63,94,0.15); color: var(--danger); }
.badge-muted { background: rgba(148,163,184,0.15); color: var(--text-muted); }

/* ===== Filter bar ===== */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 16px;
}
.filters input, .filters select {
  background: var(--bg-1); color: var(--text); border: 1px solid var(--border);
  padding: 8px 11px; border-radius: 8px; font-size: 13px; font-family: inherit;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fadeIn 0.18s;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 18px;
  width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 22px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close {
  background: transparent; border: 0; color: var(--text-muted); font-size: 22px; cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
}
.modal-close:hover { background: var(--bg-2); color: var(--text); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Toast ===== */
#toast-root { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-2); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px;
  box-shadow: var(--shadow-md); animation: slideIn 0.25s; max-width: 360px; font-size: 13.5px;
  border-left: 3px solid var(--accent);
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Detail view ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 14px 0; }
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid .k { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.detail-grid .v { font-size: 14px; word-break: break-word; }

.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin: 22px 0 10px 0;
}

.empty {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty .big { font-size: 38px; margin-bottom: 8px; }

.talk-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 10px;
}
.talk-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.talk-card .subj { font-weight: 600; font-size: 15px; }
.talk-card .meta { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.talk-card .summary { margin-top: 10px; color: var(--text-dim); font-size: 13.5px; white-space: pre-wrap; }

/* Carryover badge for auto-rescheduled ("Yesterday's Pile") talks */
.carryover-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245, 158, 11, 0.15); color: #d97706;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.talk-card.carryover { border-left: 3px solid #f59e0b; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.prev-talks {
  background: var(--bg-2); border-left: 2px solid var(--accent);
  padding: 10px 14px; margin-top: 12px; border-radius: 0 8px 8px 0;
}
.prev-talks .ph { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 8px; }
.prev-talks .pi { font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.prev-talks .pi:last-child { border-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 40px; }

/* ═══════════════════════════════════════════════════ */
/* ===== INSIGHTS SECTION ===== */
/* ═══════════════════════════════════════════════════ */

.insights-loader { display: flex; justify-content: center; padding: 60px; }
.insights-loader-inner { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 14px; }

/* Tabs */
.insights-tabs {
  display: flex; gap: 4px; padding: 5px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none;
}
.insights-tabs::-webkit-scrollbar { display: none; }
.insights-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; border: none; border-radius: 10px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-weight: 600; font-size: 13px; font-family: inherit;
  transition: all 0.2s; white-space: nowrap;
}
.insights-tab:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.insights-tab.active {
  background: var(--gradient-1); color: #fff;
  box-shadow: 0 4px 15px rgba(56,189,248,0.3);
}
.tab-icon { font-size: 15px; }
.tab-label { font-size: 12.5px; }

/* Alerts */
.insights-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.insights-alert {
  padding: 10px 14px; border-radius: 10px; font-size: 13px;
  border-left: 4px solid; animation: slideIn 0.3s;
}
.insights-alert-warning { background: rgba(245,158,11,0.1); border-left-color: var(--warn); color: var(--text-dim); }
.insights-alert-danger { background: rgba(244,63,94,0.1); border-left-color: var(--danger); color: var(--text-dim); }
.insights-alert-success { background: rgba(16,185,129,0.1); border-left-color: var(--success); color: var(--text-dim); }
.insights-alert-info { background: rgba(56,189,248,0.1); border-left-color: var(--accent); color: var(--text-dim); }

/* KPI Grid */
.insights-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.insights-kpi {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.insights-kpi::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-1); opacity: 0; transition: opacity 0.3s;
}
.insights-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.insights-kpi:hover::after { opacity: 1; }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kpi-body { flex: 1; }
.kpi-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.kpi-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-top: 2px; }

/* Info Grid */
.insights-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 700px) { .insights-info-grid { grid-template-columns: 1fr; } }

.card-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

/* Chart Row */
.insights-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 700px) { .insights-chart-row { grid-template-columns: 1fr; } }
.insights-chart-card { display: flex; flex-direction: column; align-items: center; }
.insights-chart-card canvas { max-height: 260px; }

/* Tables */
.insights-table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 16px;
  scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent;
}
.insights-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.insights-table th {
  padding: 10px 12px; text-align: left; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 11px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; white-space: nowrap;
}
.insights-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  color: var(--text-dim); white-space: nowrap;
}
.insights-table tbody tr { transition: background 0.15s; }
.insights-table tbody tr:hover { background: rgba(56,189,248,0.04); }
.insights-table tbody tr:last-child td { border-bottom: none; }

/* Segment Cards */
.insights-seg-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.insights-seg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-align: center;
  transition: all 0.2s;
}
.insights-seg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.seg-icon { font-size: 26px; margin-bottom: 6px; }
.seg-count { font-size: 28px; font-weight: 800; line-height: 1.2; }
.seg-label { font-size: 13px; font-weight: 700; margin-top: 2px; }
.seg-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Recommendation Cards */
.insights-rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.insights-rec-card { transition: all 0.2s; }
.insights-rec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rec-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rec-icon { font-size: 22px; }
.rec-items { padding: 8px 12px; background: var(--bg-2); border-radius: 8px; list-style: none; }
.rec-items li {
  padding: 5px 0; font-size: 12.5px; color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
}
.rec-items li:last-child { border-bottom: none; }
.rec-items li::before { content: '→ '; color: var(--accent); font-weight: 600; }

/* Toggle button for expandable items */
.rec-toggle-btn {
  margin-top: 8px; font-size: 12px; color: var(--accent);
  background: rgba(56,189,248,0.08); border: 1px solid rgba(56,189,248,0.2);
  cursor: pointer; transition: all 0.2s;
}
.rec-toggle-btn:hover { background: rgba(56,189,248,0.15); }

/* Allow product list cells to wrap */
.insights-table td.wrap-cell { white-space: normal; max-width: 350px; line-height: 1.5; }

/* Insights content area */
.insights-content { animation: fadeIn 0.3s; }

/* ═══════════════════════════════════════════════════ */
/* ===== CLICKABLE TALK CARDS ===== */
/* ═══════════════════════════════════════════════════ */

.talk-card-clickable { cursor: pointer; transition: all 0.2s; }
.talk-card-clickable:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56,189,248,0.12);
}

/* Talk Detail Modal */
.talk-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px;
  padding: 16px; background: var(--bg-2); border-radius: 12px; margin-bottom: 16px;
}
@media (max-width: 600px) { .talk-detail-grid { grid-template-columns: 1fr; } }
.talk-detail-item {}
.talk-detail-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 600; margin-bottom: 3px;
}
.talk-detail-value { font-size: 14px; color: var(--text); word-break: break-word; }
.talk-detail-section {
  background: var(--bg-2); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px;
}
.talk-detail-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.talk-detail-text {
  font-size: 14px; color: var(--text-dim); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.talk-detail-timestamps {
  font-size: 11px; color: var(--text-muted); padding: 10px 0 0;
  border-top: 1px dashed var(--border); margin-top: 4px;
}

/* ═══════════════════════════════════════════════════ */
/* ===== REDESIGNED ACTIONS TAB ===== */
/* ═══════════════════════════════════════════════════ */

.actions-header-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.actions-header-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
  position: relative; overflow: hidden;
}
.actions-header-kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.actions-header-kpi.kpi-total::before { background: var(--gradient-1); }
.actions-header-kpi.kpi-high::before { background: linear-gradient(135deg, #f43f5e, #fb923c); }
.actions-header-kpi.kpi-revenue::before { background: var(--gradient-2); }
.actions-header-kpi .ahk-icon { font-size: 22px; margin-bottom: 4px; }
.actions-header-kpi .ahk-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.actions-header-kpi .ahk-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-top: 3px; }

.actions-category {
  margin-bottom: 24px;
}
.actions-category-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.actions-category-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.actions-category-icon.cat-protect { background: linear-gradient(135deg, rgba(244,63,94,0.2), rgba(251,146,60,0.2)); }
.actions-category-icon.cat-grow { background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(129,140,248,0.2)); }
.actions-category-icon.cat-optimize { background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(56,189,248,0.2)); }
.actions-category-title { font-size: 16px; font-weight: 700; }
.actions-category-desc { font-size: 12px; color: var(--text-muted); }

.action-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
  border-left: 4px solid transparent; transition: all 0.25s;
  position: relative; overflow: hidden;
}
.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action-card.priority-high { border-left-color: var(--danger); }
.action-card.priority-medium { border-left-color: var(--warn); }
.action-card.priority-low { border-left-color: var(--accent-2); }

.action-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.action-card-title-row { display: flex; align-items: center; gap: 10px; }
.action-card-icon { font-size: 22px; }
.action-card-title { font-size: 15px; font-weight: 700; }

.priority-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 10px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.priority-badge.pb-high { background: rgba(244,63,94,0.15); color: var(--danger); }
.priority-badge.pb-medium { background: rgba(245,158,11,0.15); color: var(--warn); }
.priority-badge.pb-low { background: rgba(16,185,129,0.15); color: var(--accent-2); }

.action-card-detail { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; }

.action-impact-row {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px;
}
.action-impact {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; background: var(--bg-2); border-radius: 8px; font-size: 12px;
}
.action-impact-icon { font-size: 14px; }
.action-impact-value { font-weight: 700; color: var(--text); }
.action-impact-label { color: var(--text-muted); }

.action-urgency-bar {
  height: 4px; border-radius: 4px; background: var(--bg-2); margin-bottom: 12px; overflow: hidden;
}
.action-urgency-fill {
  height: 100%; border-radius: 4px; transition: width 0.8s ease;
}
.action-urgency-fill.urg-high { background: linear-gradient(90deg, #f43f5e, #fb923c); }
.action-urgency-fill.urg-medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.action-urgency-fill.urg-low { background: linear-gradient(90deg, #10b981, #38bdf8); }

.action-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  background: rgba(56,189,248,0.1); color: var(--accent);
  border: 1px solid rgba(56,189,248,0.2);
}
.action-btn:hover { background: rgba(56,189,248,0.2); transform: translateY(-1px); }
.action-btn.action-btn-primary { background: var(--gradient-1); color: #fff; border: none; }
.action-btn.action-btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 12px rgba(56,189,248,0.3); }

.action-scope-note {
  margin-top: 16px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}
/* ═══════════════════════════════════════════════════ */
/* ===== STOCK MANAGEMENT SECTION ===== */
/* ═══════════════════════════════════════════════════ */

.stk-wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.stk-wh-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: all 0.25s; position: relative; overflow: hidden;
}
.stk-wh-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-2); }
.stk-wh-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.stk-wh-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.stk-wh-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.stk-wh-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stk-pwd-input {
  flex: 1; min-width: 120px; padding: 8px 12px; background: var(--bg-1); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit;
}
.stk-pwd-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.stk-content { animation: fadeIn 0.3s; }
.stk-alerts { margin-bottom: 16px; }
.stk-settings-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.stk-stab-active { background: var(--gradient-1) !important; color: #fff !important; border-color: transparent !important; }

/* Tab locked state for employee */
.tab-locked { opacity: 0.5; }
.tab-locked:hover { opacity: 0.7; }

/* Badges for admin panel */
.badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; background:var(--surface); border:1px solid var(--border); }
.badge-success { background:rgba(34,197,94,0.15); color:#22c55e; border-color:rgba(34,197,94,0.3); }
.badge-danger { background:rgba(239,68,68,0.15); color:#ef4444; border-color:rgba(239,68,68,0.3); }
.badge-warn { background:rgba(234,179,8,0.15); color:#eab308; border-color:rgba(234,179,8,0.3); }
.btn-success { background:linear-gradient(135deg,#22c55e,#16a34a) !important; color:#fff !important; border:none !important; }
.btn-danger { background:linear-gradient(135deg,#ef4444,#dc2626) !important; color:#fff !important; border:none !important; }

/* ═══ Task Cards ═══ */
.task-card {
  background: var(--bg-1, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.task-card:hover { border-color: var(--primary, #818cf8); }
.task-card.task-overdue { border-left: 3px solid #f43f5e; }
.task-card.task-completed { opacity: 0.6; }
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.task-subject { font-weight: 600; font-size: 1em; margin-bottom: 4px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.85em; color: var(--text-dim, #94a3b8); }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.task-desc {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #334155);
  color: var(--text-dim, #94a3b8);
  font-size: 0.9em;
  white-space: pre-wrap;
}
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-danger { background: rgba(244,63,94,0.15); color: #f43f5e; }

/* ═══ Low Stock Alerts Grid ═══ */
.low-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.low-stock-item {
  background: var(--bg-1, #1e293b);
  border: 1px solid rgba(245,158,11,0.3);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
}
.low-stock-name { font-weight: 600; font-size: 0.95em; margin-bottom: 4px; }
.low-stock-details { display: flex; gap: 12px; font-size: 0.85em; color: var(--text-dim, #94a3b8); }
.low-stock-current { color: #f43f5e; font-weight: 500; }
.low-stock-buffer { color: #f59e0b; }
.low-stock-wh { color: var(--text-dim, #94a3b8); }

/* Sampling module */
.sample-lines { display:flex; flex-direction:column; gap:10px; margin:12px 0; }
.sample-item-row { display:grid; grid-template-columns:minmax(220px,3fr) minmax(100px,1fr) minmax(70px,0.7fr) auto; align-items:center; gap:10px; }
.sample-item-row input { width:100%; min-width:0; }
@media(max-width:680px) {
  .sample-item-row { grid-template-columns:minmax(0,1fr) minmax(85px,100px); }
  .sample-item-row .page-subtitle { align-self:center; }
  .sample-item-row button { justify-self:start; }
}
