/* ==========================================================================
   DASHBOARD STYLES - ROLES: DUEÑO DE TIENDA & SUPER ADMIN
   Moderno, Limpio, Profesional
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #f2722b;
  --primary-hover: #e05e16;
  --primary-light: #fff2ea;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #1e293b;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0284c7;
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

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

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

/* Sidebar */
.dash-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand span {
  color: var(--primary);
}

.sidebar-menu {
  padding: 20px 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.menu-item a:hover, .menu-item.active a {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.menu-item.active a {
  background-color: var(--primary);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Main Content */
.dash-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dash-header {
  background-color: #ffffff;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-title h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
}

.dash-title p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 14px;
}

.plan-pill {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Dashboard Body */
.dash-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Metrics KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.kpi-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kpi-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.kpi-icon-box.orange { background-color: var(--primary-light); color: var(--primary); }
.kpi-icon-box.green { background-color: #dcfce7; color: #16a34a; }
.kpi-icon-box.blue { background-color: #e0f2fe; color: #0284c7; }
.kpi-icon-box.purple { background-color: #f3e8ff; color: #9333ea; }

/* Content Cards & Tables */
.dash-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

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

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.dash-table th {
  background-color: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.dash-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.dash-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-badge.pending { background-color: #fef3c7; color: #b45309; }
.status-badge.processing { background-color: #e0e7ff; color: #4338ca; }
.status-badge.shipped { background-color: #e0f2fe; color: #0369a1; }
.status-badge.delivered { background-color: #dcfce7; color: #15803d; }

.btn-action-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.btn-action-sm:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Modal Detalle de Envío */
.shipping-detail-box {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

/* Upgrade Plan Alert Box */
.plan-limit-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.plan-progress-bar {
  width: 100%;
  height: 8px;
  background-color: #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.plan-progress-fill {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.4s ease;
}

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

@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow-x: hidden;
  }
  .dash-sidebar {
    width: 100%;
  }
  .dash-header {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-badges {
    width: 100%;
    justify-content: space-between;
  }
  .dash-content {
    padding: 16px;
    gap: 20px;
  }
  .plan-limit-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .plan-limit-box button {
    width: 100%;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .dash-card {
    padding: 16px;
  }
}
