/* RevKitchenOS — Partner Command Center */
/* Dark theme, Space Grotesk + IBM Plex Mono */

:root {
  --bg-primary: #0c0c0f;
  --bg-secondary: #141418;
  --bg-card: #1a1a20;
  --bg-card-hover: #1e1e26;
  --bg-input: #111115;
  --border: #2a2a32;
  --border-focus: #f97316;
  --text-primary: #f0f0f2;
  --text-secondary: #9b9ba8;
  --text-muted: #6b6b78;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.12);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --sidebar-width: 240px;
  --radius: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #000;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}

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

.nav-links li a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-links li.active a {
  background: rgba(249, 115, 22, 0.1);
  color: var(--accent);
}

.nav-links li.active a svg { stroke: var(--accent); }

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

.logout-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.logout-link:hover { color: var(--red); }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 32px;
  max-width: 1200px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-green { color: var(--green); font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.font-medium { font-weight: 500; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent); }
.stat-card.accent-green:hover { border-color: var(--green); }
.stat-card.accent-amber:hover { border-color: var(--amber); }
.stat-card.accent-blue:hover { border-color: var(--blue); }

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

.stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card.accent-green .stat-value { color: var(--green); }
.stat-card.accent-amber .stat-value { color: var(--amber); }
.stat-card.accent-blue .stat-value { color: var(--blue); }

.stat-detail {
  font-size: 12px;
  color: var(--text-muted);
}

/* Activity Grid */
.activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.link-subtle {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.link-subtle:hover { text-decoration: underline; }

.card-body { padding: 0; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.table tbody tr:hover { background: var(--bg-card-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.badge-active { background: var(--green-dim); color: var(--green); }
.badge-pending, .badge-onboarding { background: var(--amber-dim); color: var(--amber); }
.badge-prospect { background: var(--blue-dim); color: var(--blue); }
.badge-churned, .badge-inactive { background: var(--red-dim); color: var(--red); }
.badge-available { background: var(--green-dim); color: var(--green); }
.badge-limited { background: var(--amber-dim); color: var(--amber); }
.badge-full { background: var(--red-dim); color: var(--red); }

/* Status Select */
.status-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.status-select:focus { border-color: var(--accent); }
.status-select.status-active { color: var(--green); border-color: var(--green); }
.status-select.status-onboarding { color: var(--amber); border-color: var(--amber); }
.status-select.status-prospect { color: var(--blue); border-color: var(--blue); }
.status-select.status-churned { color: var(--red); border-color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--text-muted); color: var(--text-primary); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-dim);
}

.btn-danger:hover { background: var(--red-dim); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.partner-form { padding: 20px; }
.edit-inline { padding: 16px; background: rgba(249, 115, 22, 0.03); }

.inline-form { display: inline; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.2); }
.alert-error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Utility */
.hidden { display: none !important; }
.edit-row td { padding: 0 !important; border-bottom: 1px solid var(--border) !important; }

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center top, #1a1520 0%, var(--bg-primary) 60%);
}

.login-container {
  width: 100%;
  max-width: 380px;
  padding: 0 20px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .logo-mark {
  width: 52px;
  height: 52px;
  font-size: 18px;
  margin: 0 auto 16px;
}

.login-brand h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.login-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.login-form .form-group { margin-bottom: 16px; }
.login-form .btn { margin-top: 4px; padding: 12px; font-size: 14px; }

/* Brands Grid */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.brand-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.brand-card:hover { border-color: var(--accent); }

.brand-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.brand-card-header h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-category {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.brand-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.brand-stats {
  display: flex;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.brand-stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  display: block;
}

.brand-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { border-bottom: none; }
  .nav-links { display: flex; padding: 0 8px; }
  .sidebar-footer { margin-left: auto; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  body { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; }
}
