/* ============================================================
   TRIPLE O SUPERMARKET — BASE CSS
   Variables, Reset, Typography, Utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Brand Colors */
  --green:        #16A34A;
  --green-light:  #DCFCE7;
  --green-dark:   #15803D;
  --green-dim:    rgba(22, 163, 74, 0.08);

  /* Backgrounds */
  --bg:           #FFFFFF;
  --surface:      #F7F8FA;
  --surface2:     #F0F2F5;

  /* Borders */
  --border:       #E5E7EB;
  --border-dark:  #D1D5DB;

  /* Text */
  --text:         #111827;
  --text-secondary: #6B7280;
  --text-muted:   #9CA3AF;

  /* Status */
  --danger:       #DC2626;
  --danger-light: #FEE2E2;
  --warning:      #D97706;
  --warning-light: #FEF3C7;
  --info:         #2563EB;
  --info-light:   #DBEAFE;

  /* Typography */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Spacing */
  --radius-sm:    6px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);

  /* Transitions */
  --transition:   all 0.15s ease;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { display: block; max-width: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem;   font-weight: 600; line-height: 1.4; }
h5 { font-size: 0.875rem; font-weight: 600; }
h6 { font-size: 0.75rem;  font-weight: 600; }

p { color: var(--text-secondary); line-height: 1.6; }

.text-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ─── LAYOUT UTILITIES ───────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

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

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── LOADING SPINNER ────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.spinner-sm {
  width: 14px; height: 14px;
  border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
  gap: 8px;
}
.empty-state-icon { font-size: 32px; opacity: 0.4; margin-bottom: 4px; }
.empty-state-text { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.empty-state-sub { font-size: 12px; color: var(--text-muted); }

/* ─── STATUS DOTS ────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--danger); }
.status-dot.amber { background: var(--warning); }
.status-dot.blue { background: var(--info); }
.status-dot.pulse { animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.animate-fade-up { animation: fadeUp 0.3s ease both; }
.animate-fade-in { animation: fadeIn 0.2s ease both; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}
