/* ========================================
   AWAKE ADMIN - Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Awake Palette */
  --lime: #EDF46B;
  --cream: #F2EBE2;
  --espresso: #603F39;
  --cortado: #7D4B44;
  --cream-dark: #E8DFD4;
  --cream-light: #F8F4EF;
  --white: #FFFFFF;
  --black: #1A1A1A;

  /* Semantic */
  --bg-primary: var(--cream-light);
  --bg-sidebar: var(--espresso);
  --bg-card: var(--white);
  --text-primary: var(--espresso);
  --text-secondary: var(--cortado);
  --text-muted: #9B8A85;
  --text-on-dark: var(--cream);
  --accent: var(--lime);
  --border: rgba(96, 63, 57, 0.1);
  --border-strong: rgba(96, 63, 57, 0.2);

  /* Status */
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #F44336;
  --info: #2196F3;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 60px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(96, 63, 57, 0.06);
  --shadow-md: 0 4px 12px rgba(96, 63, 57, 0.08);
  --shadow-lg: 0 8px 24px rgba(96, 63, 57, 0.12);

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --header-h: 64px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */

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

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

a { color: var(--cortado); text-decoration: none; }
a:hover { color: var(--espresso); }

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card .logo {
  width: 160px;
  margin: 0 auto 12px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

/* ========================================
   LAYOUT - SIDEBAR + CONTENT
   ======================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.3s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-header .logo-sm {
  width: 36px;
  height: 36px;
  background: var(--lime);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--espresso);
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-header .brand {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.sidebar-header .badge {
  font-size: 10px;
  background: rgba(237,244,107,0.15);
  color: var(--lime);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-weight: 600;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.sidebar-nav .nav-section {
  margin-bottom: 24px;
}

.sidebar-nav .nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 0 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-weight: 500;
  font-size: 13.5px;
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(237,244,107,0.12);
  color: var(--lime);
}

/* Lime active indicator bar */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--lime);
  border-radius: 0 3px 3px 0;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active .icon { opacity: 1; }

/* Focus-visible for keyboard navigation */
.nav-item:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.nav-item .badge-count {
  margin-left: auto;
  background: rgba(237,244,107,0.2);
  color: var(--lime);
  font-size: 11px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.3s var(--ease);
}

.top-bar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar .page-title {
  font-size: 18px;
  font-weight: 700;
}

.top-bar .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content {
  padding: 28px;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 24px;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
}

.card-title svg {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================
   STAT CARDS
   ======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  animation: fadeInUp 0.4s var(--ease) both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }

/* Top gradient bar */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cortado), var(--espresso));
  opacity: 0.3;
  transition: opacity 0.25s var(--ease);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card:hover::before {
  background: var(--lime);
  opacity: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.lime { background: rgba(237,244,107,0.2); color: var(--espresso); }
.stat-icon.green { background: rgba(76,175,80,0.12); color: var(--success); }
.stat-icon.blue { background: rgba(33,150,243,0.12); color: var(--info); }
.stat-icon.orange { background: rgba(255,152,0,0.12); color: var(--warning); }

.stat-info { flex: 1; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========================================
   TABLES
   ======================================== */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

tbody tr {
  transition: background 0.15s var(--ease);
  cursor: default;
}

tbody tr:hover { background: rgba(237,244,107,0.08); }

tbody tr:last-child td { border-bottom: none; }

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--white);
  transition: all 0.2s var(--ease);
  outline: none;
}

.form-input:focus {
  border-color: var(--cortado);
  box-shadow: 0 0 0 3px rgba(125,75,68,0.1);
}

.form-input:focus-visible {
  outline: none;
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239B8A85' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--lime);
  color: var(--espresso);
}

.btn-primary:hover {
  background: #e0ec5a;
  box-shadow: 0 4px 12px rgba(237,244,107,0.3);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--cortado);
  background: var(--cream-light);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover { background: #e53935; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: rgba(96,63,57,0.06);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   BADGES & TAGS
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(76,175,80,0.1); color: var(--success); }
.badge-warning { background: rgba(255,152,0,0.1); color: var(--warning); }
.badge-danger { background: rgba(244,67,54,0.1); color: var(--danger); }
.badge-info { background: rgba(33,150,243,0.1); color: var(--info); }
.badge-neutral { background: rgba(96,63,57,0.08); color: var(--text-secondary); }

/* ========================================
   SEARCH & FILTERS
   ======================================== */

.search-box {
  position: relative;
}

.search-box .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.search-box input {
  padding-left: 40px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.3s var(--ease);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--cream-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}

.modal-close:hover { background: var(--cream-dark); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ========================================
   TOAST / NOTIFICATIONS
   ======================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn 0.3s var(--ease);
  border-left: 3px solid var(--info);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================================
   LOADING
   ======================================== */

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--cortado);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--cream-dark) 25%, var(--cream) 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer { to { background-position: -200% 0; } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* ========================================
   TOGGLE / SWITCH
   ======================================== */

.toggle {
  width: 44px;
  height: 24px;
  background: var(--border-strong);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  border: none;
  padding: 0;
}

.toggle::after {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle.active {
  background: var(--lime);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-content { padding: 16px; }
  .top-bar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-card { padding: 32px 24px; }
}

/* ========================================
   UTILITIES
   ======================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.relative { position: relative; }

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

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Product image thumb */
.product-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--cream);
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--espresso);
  flex-shrink: 0;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s var(--ease);
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--espresso);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--lime);
  border-radius: 1px;
}

/* Chart placeholder */
.chart-area {
  width: 100%;
  height: 240px;
  background: var(--cream-light);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ========================================
   MICRO-INTERACTIONS & ACCESSIBILITY
   ======================================== */

/* Sidebar header logo pulse on hover */
.sidebar-header .logo-sm {
  transition: transform 0.2s var(--ease);
}
.sidebar-header .logo-sm:hover {
  transform: scale(1.08);
}

/* Smooth page transitions */
.page-content {
  animation: fadeIn 0.3s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Top bar subtle shadow on scroll (via JS or just always subtle) */
.top-bar {
  box-shadow: 0 1px 3px rgba(96, 63, 57, 0.04);
}

/* Badge pulse for danger items */
.badge-danger {
  position: relative;
}

/* Stat icon subtle float */
.stat-icon {
  transition: transform 0.25s var(--ease);
}
.stat-card:hover .stat-icon {
  transform: scale(1.08);
}

/* Login card entrance */
.login-card {
  animation: fadeInUp 0.5s var(--ease);
}

/* Toggle with smooth active effect */
.toggle:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

/* Modal close focus */
.modal-close:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

/* Tab btn focus */
.tab-btn:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

/* Skeleton improvement - smoother */
.skeleton {
  border-radius: var(--r-md);
}

/* ========================================
   PREFERS REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   AFFILIATE PORTAL LAYOUT
   ======================================== */

.affiliate-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.affiliate-navbar {
  height: 60px;
  background: var(--espresso);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(96, 63, 57, 0.15);
}

.affiliate-navbar .logo-sm {
  width: 32px;
  height: 32px;
  background: var(--lime);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--espresso);
  font-size: 14px;
  flex-shrink: 0;
}

.affiliate-navbar .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--cream);
}

.affiliate-nav {
  display: flex;
  gap: 4px;
}

.aff-nav-item {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.aff-nav-item:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.08);
}

.aff-nav-item.active {
  background: rgba(237,244,107,0.15);
  color: var(--lime);
}

.affiliate-content {
  flex: 1;
  padding: 24px;
}

.affiliate-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Additional button styles */
.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover { background: #f57c00; }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { background: #43a047; }

/* Mobile affiliate portal */
@media (max-width: 768px) {
  .affiliate-navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 8px;
  }

  .affiliate-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .aff-nav-item {
    font-size: 12px;
    padding: 6px 12px;
  }

  .affiliate-content {
    padding: 16px;
  }

  .affiliate-container {
    max-width: 100%;
  }
}
