/* ==========================================================================
   FoodMarket SaaS Admin Design System (Obsidian & Emerald Enterprise UI)
   ========================================================================== */

:root {
  --bg-base: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #131d35;
  --bg-card-hover: #172342;
  --bg-glass: rgba(19, 29, 53, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.16);
  
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  
  --accent-gold: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-blue: #38bdf8;
  --danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* App Layout */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 270px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 24px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}
.brand-tag {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 12px 10px 6px 10px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item a:hover {
  color: #fff;
  background-color: var(--bg-card);
}

.nav-item.active a {
  color: #fff;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 10px;
  padding-right: 10px;
}

/* Main Workspace */
.app-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header */
.app-topbar {
  height: 70px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.topbar-title h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Content Container */
.app-content {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & Containers */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 28px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Metric / Stat Widgets */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
}

.stat-box.amber::before { background: var(--accent-gold); }
.stat-box.purple::before { background: var(--accent-purple); }
.stat-box.blue::before { background: var(--accent-blue); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.stat-number {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-subtext {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.app-table th {
  padding: 14px 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(255, 255, 255, 0.02);
}

.app-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.app-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-bright);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background-color: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Wizard Steps */
.wizard-steps {
  display: flex;
  margin-bottom: 32px;
  position: relative;
  justify-content: space-between;
}

.wizard-step {
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.wizard-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 8px auto;
  transition: all 0.2s ease;
}

.wizard-step.active .wizard-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

.wizard-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-step.active .wizard-label {
  color: #fff;
}
