:root {
  --bg: #0c1513;
  --surface: #13221e;
  --surface-2: #192d28;
  --border: #25413a;
  --text: #e8f4ef;
  --muted: #93b0a6;
  --accent: #10b981;
  --accent-hi: #34d399;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-2: #e9f2ee;
  --border: #cfe0d8;
  --text: #10241e;
  --muted: #4b695f;
  --accent: #059669;
  --accent-hi: #047857;
  --shadow: 0 8px 22px rgba(16, 36, 30, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: rgba(12, 21, 19, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.92); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span.sub { font-weight: 500; font-size: 0.78rem; color: var(--muted); display: block; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.86rem;
  cursor: pointer; transition: 0.15s ease;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #062118; }
.btn-primary:hover { background: var(--accent-hi); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.btn-danger { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }

.shell { max-width: 1120px; margin: 0 auto; padding: 18px 16px 80px; }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 9px 15px; border-radius: 10px 10px 0 0; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap;
}
.tab-btn.active { background: var(--surface); border-color: var(--border); border-bottom-color: var(--surface); color: var(--accent-hi); }

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

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h2, .card h3 { margin: 0 0 10px; font-size: 1.08rem; letter-spacing: -0.01em; }
.muted { color: var(--muted); font-size: 0.88rem; }

.stat-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px;
}
.stat-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat-val { font-size: 1.45rem; font-weight: 800; margin: 4px 0 2px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; }
.badge-ok { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.badge-warn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-danger { background: rgba(239, 68, 68, 0.22); color: #f87171; }
.badge-info { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }

label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.92rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }

.result-box {
  background: var(--surface-2); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; margin-top: 12px;
}
.result-box.warn { border-left-color: var(--warn); }
.result-box.danger { border-left-color: var(--danger); }

.drop-checker-dot {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; margin-right: 6px;
  border: 2px solid rgba(255,255,255,0.4);
}

.chart-wrap { width: 100%; overflow-x: auto; margin-top: 10px; }
svg.trend-svg { width: 100%; min-width: 320px; height: 220px; display: block; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.shop-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.shop-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f4f5f7; }
.shop-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.shop-card-body h3 { margin: 4px 0 6px; font-size: 1rem; }

.footer {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted); text-align: center;
}
