/* ShopKeeper Owner Dashboard */
:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --orange: #f97316;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --success: #22c55e;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
body {
  background: radial-gradient(ellipse at top, #1e293b 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  padding: 20px;
  margin: 0 auto;
  max-width: 720px;
  line-height: 1.5;
}

.dashboard-container { display: flex; flex-direction: column; gap: 18px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
h1 {
  font-size: 1.45rem;
  margin: 0;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.track-banner {
  font-size: 0.75rem;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
}

.section-title {
  font-size: 1.05rem;
  margin: 8px 0 4px;
  border-left: 4px solid var(--purple);
  padding-left: 10px;
}
.section-hint { font-size: 0.8rem; color: var(--muted); margin: 0 0 8px; }

.health-card { background: var(--card); padding: 20px; border-radius: 14px; border: 1px solid var(--border); }
.health-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.score { font-size: 1.5rem; font-weight: bold; }
.tag { font-size: 0.75rem; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.tag-good { background: var(--success); color: white; }
.tag-fair { background: var(--orange); color: white; }
.tag-attention { background: var(--danger); color: white; }
.tag-impact-high { background: #3b82f6; color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; }
.tag-impact-medium { background: #eab308; color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; }
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width 0.5s;
}
.health-details { display: flex; gap: 15px; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }

.summary-card { background: var(--card); padding: 16px; border-radius: 12px; text-align: center; border: 1px solid var(--border); }
.summary-card .label { font-size: 0.75rem; color: var(--muted); display: block; }
.summary-card .value { font-size: 1.2rem; font-weight: bold; margin-top: 4px; }
.green { color: var(--success); }

.chart-card {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.or-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.or-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: #0f172a;
  border-radius: 8px;
  font-size: 0.9rem;
}
.or-meta { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.status-pill { font-size: 0.7rem; padding: 3px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase; }
.status-critical { background: #7f1d1d; color: #fca5a5; }
.status-warn { background: #78350f; color: #fcd34d; }
.status-ok { background: #064e3b; color: #6ee7b7; }
.status-info { background: #1e3a5f; color: #93c5fd; }
.order-qty { font-size: 0.75rem; color: var(--cyan); }
.insight-item { padding: 10px; background: #0f172a; border-radius: 8px; border-left: 3px solid var(--orange); }
.muted { color: var(--muted); }

.advice-list { background: var(--card); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); }
.advice-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: #0f172a; border-radius: 8px; border-left: 4px solid var(--cyan); }
.advice-icon { font-size: 1.5rem; }

.sim-card, .panel {
  background: var(--card);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.sim-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sim-row select, .sim-row input { flex: 1; min-width: 120px; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: #0f172a; color: var(--text); }
.sim-result { margin-top: 12px; color: var(--muted); font-size: 0.9rem; }

.budget-card { background: var(--card); border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.budget-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.budget-item.total { border-bottom: none; font-weight: bold; font-size: 1.1rem; margin-top: 8px; }
.safe-limit { margin-top: 12px; background: #064e3b; padding: 8px; border-radius: 8px; color: #6ee7b7; text-align: center; }

.scroll-list { max-height: 280px; overflow-y: auto; margin-top: 12px; }

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-sm { padding: 8px 12px; font-size: 0.8rem; }
.btn-primary { background: linear-gradient(135deg, #2563eb, var(--purple)); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); text-decoration: none; display: inline-flex; align-items: center; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; margin-bottom: 12px; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--border);
}
.modal h2 { margin-bottom: 16px; font-size: 1.25rem; }
.modal .form-group { margin-bottom: 12px; }
.modal .form-group label { display: block; font-size: 0.85rem; margin-bottom: 4px; color: var(--muted); }
.modal .form-group input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #0f172a; color: var(--text); }
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

code { font-size: 0.85em; color: var(--cyan); }
