/* ============================================================
   KUKS & CO — Dashboard Stylesheet
   ============================================================ */

/* ── Dashboard Layout ───────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--midnight);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--dur-base) var(--ease);
  z-index: 200;
}
.sidebar.collapsed { width: 72px; }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,254,255,0.1); }

.sidebar__header {
  padding: var(--space-6);
  border-bottom: 1px solid rgba(255,254,255,0.07);
  display: flex; align-items: center;
  justify-content: space-between;
  min-height: 72px;
}
.sidebar__logo {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 500;
  color: var(--offwhite);
  white-space: nowrap;
}
.sidebar__logo span { color: var(--champagne); }
.sidebar__collapse-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); font-size: 14px;
  background: rgba(255,254,255,0.05);
  transition: background var(--dur-fast), color var(--dur-fast);
  flex-shrink: 0;
}
.sidebar__collapse-btn:hover { background: rgba(255,254,255,0.1); color: var(--offwhite); }

/* Sidebar Nav */
.sidebar__nav { flex: 1; padding: var(--space-4) 0; }
.sidebar__section-title {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(214,181,133,0.5);
  padding: var(--space-5) var(--space-5) var(--space-2);
  white-space: nowrap; overflow: hidden;
}
.collapsed .sidebar__section-title { opacity: 0; }

.sidebar__nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-5);
  font-size: 13px; font-weight: 400;
  color: rgba(255,254,255,0.55);
  cursor: pointer; position: relative;
  transition: color var(--dur-fast), background var(--dur-fast);
  white-space: nowrap;
  border: none; width: 100%; text-align: left;
  background: none;
}
.sidebar__nav-item:hover {
  color: var(--offwhite);
  background: rgba(255,254,255,0.05);
}
.sidebar__nav-item.active {
  color: var(--champagne);
  background: rgba(214,181,133,0.08);
}
.sidebar__nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--champagne);
  border-radius: 0 2px 2px 0;
}
.sidebar__nav-icon {
  font-size: 16px; flex-shrink: 0; width: 20px; text-align: center;
}
.sidebar__nav-label { flex: 1; }
.sidebar__nav-badge {
  background: var(--champagne); color: var(--midnight);
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.collapsed .sidebar__nav-label,
.collapsed .sidebar__nav-badge { display: none; }

/* Sidebar submenu */
.sidebar__nav-sub {
  padding-left: var(--space-10);
  max-height: 0; overflow: hidden;
  transition: max-height var(--dur-base) var(--ease);
}
.sidebar__nav-sub.open { max-height: 300px; }
.sidebar__nav-sub-item {
  display: block; padding: 7px var(--space-5) 7px 0;
  font-size: 12px; color: rgba(255,254,255,0.4);
  cursor: pointer; transition: color var(--dur-fast);
  border: none; width: 100%; text-align: left; background: none;
}
.sidebar__nav-sub-item:hover { color: var(--offwhite); }
.sidebar__nav-sub-item.active { color: var(--champagne); }

.sidebar__footer {
  padding: var(--space-5);
  border-top: 1px solid rgba(255,254,255,0.07);
}
.sidebar__user {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--dur-fast);
}
.sidebar__user:hover { background: rgba(255,254,255,0.05); }
.sidebar__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); display: flex;
  align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  color: var(--champagne); flex-shrink: 0;
  border: 2px solid rgba(214,181,133,0.3);
}
.sidebar__user-name {
  font-size: 13px; font-weight: 500;
  color: var(--offwhite); white-space: nowrap;
}
.sidebar__user-role {
  font-size: 11px; color: var(--gray-400);
  letter-spacing: 0.04em; white-space: nowrap;
}
.collapsed .sidebar__user-name,
.collapsed .sidebar__user-role { display: none; }

/* ── Dashboard Main Content ─────────────────────────────────── */
.dashboard-main {
  flex: 1;
  overflow-x: hidden;
  min-width: 0;
}
.dashboard-topbar {
  background: var(--offwhite);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 var(--space-8);
  height: 64px;
  display: flex; align-items: center;
  justify-content: space-between; gap: var(--space-6);
  position: sticky; top: 0; z-index: 100;
}
.dashboard-topbar__title {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 400; color: var(--midnight);
}
.dashboard-topbar__actions { display: flex; align-items: center; gap: var(--space-3); }
.dashboard-topbar__search {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 8px 14px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: var(--radius-pill);
  font-size: 13px; color: var(--gray-400); cursor: text;
  transition: border-color var(--dur-fast);
}
.dashboard-topbar__search:hover { border-color: var(--gray-300); }

.dashboard-content { padding: var(--space-8); }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}
.stat-card {
  background: var(--offwhite);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-100);
  position: relative; overflow: hidden;
  transition: box-shadow var(--dur-base), transform var(--dur-base);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: var(--space-4);
}
.stat-card__icon--navy   { background: rgba(28,49,99,0.08); }
.stat-card__icon--gold   { background: rgba(214,181,133,0.15); }
.stat-card__icon--green  { background: rgba(45,122,79,0.08); }
.stat-card__icon--coral  { background: rgba(192,57,43,0.08); }
.stat-card__value {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 400;
  color: var(--midnight); line-height: 1;
  margin-bottom: var(--space-2);
}
.stat-card__label {
  font-size: 12px; font-weight: 400;
  color: var(--gray-500); letter-spacing: 0.04em;
}
.stat-card__change {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 500;
  margin-top: var(--space-3); padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.stat-card__change--up { background: #D4EDDA; color: var(--success); }
.stat-card__change--down { background: #FDECEA; color: var(--danger); }
.stat-card__accent {
  position: absolute; bottom: 0; right: 0;
  width: 80px; height: 80px;
  background: var(--cream); border-radius: 50%;
  transform: translate(30%, 30%);
  opacity: 0.5;
}

/* ── Dashboard Panels ───────────────────────────────────────── */
.dashboard-panel {
  background: var(--offwhite);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-100);
  margin-bottom: var(--space-6);
}
.dashboard-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-100);
}
.dashboard-panel__title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 400; color: var(--midnight);
}
.dashboard-panel__body { padding: var(--space-6); }
.dashboard-panel__body--flush { padding: 0; }

/* ── Data Table ─────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray-400); padding: var(--space-3) var(--space-5);
  text-align: left; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100); white-space: nowrap;
}
.data-table td {
  padding: var(--space-4) var(--space-5);
  font-size: 13px; color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table__product { display: flex; align-items: center; gap: var(--space-3); }
.data-table__thumb {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--gray-100); flex-shrink: 0;
}
.data-table__name { font-weight: 500; color: var(--midnight); margin-bottom: 2px; }
.data-table__sub { font-size: 11px; color: var(--gray-400); }
.data-table__actions { display: flex; gap: var(--space-2); }
.data-table__action {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--gray-500);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.data-table__action:hover { background: var(--gray-100); color: var(--midnight); }
.data-table__action--danger:hover { background: #FDECEA; color: var(--danger); }

/* ── Chart Container ────────────────────────────────────────── */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { max-width: 100%; }

/* ── Two-column dashboard layout ────────────────────────────── */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.dashboard-row--3 { grid-template-columns: 2fr 1fr; }
.dashboard-row--13 { grid-template-columns: 1fr 3fr; }

/* ── Tabs ───────────────────────────────────────────────────── */
.dash-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 var(--space-6);
}
.dash-tab {
  padding: var(--space-4) var(--space-5);
  font-size: 13px; font-weight: 400;
  color: var(--gray-500); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color var(--dur-fast);
  white-space: nowrap;
  background: none; border-left: none; border-right: none; border-top: none;
}
.dash-tab:hover { color: var(--midnight); }
.dash-tab.active {
  color: var(--midnight); font-weight: 500;
  border-bottom-color: var(--champagne);
}
.dash-tab-panel { display: none; }
.dash-tab-panel.active { display: block; }

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--gray-50); border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 400;
  color: var(--gray-600); cursor: pointer;
  background: var(--offwhite);
  transition: all var(--dur-fast);
}
.filter-chip:hover { border-color: var(--navy); color: var(--navy); }
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: var(--offwhite); }

/* ── Order Status Timeline ──────────────────────────────────── */
.order-timeline { display: flex; align-items: flex-start; gap: 0; position: relative; }
.order-timeline::before {
  content: ''; position: absolute; top: 16px; left: 16px; right: 16px;
  height: 2px; background: var(--gray-200); z-index: 0;
}
.timeline-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1; text-align: center;
}
.timeline-step__dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-bottom: var(--space-3);
  border: 2px solid var(--gray-200);
  background: var(--offwhite);
  transition: all var(--dur-base);
}
.timeline-step.done .timeline-step__dot {
  background: var(--navy); border-color: var(--navy); color: var(--offwhite);
}
.timeline-step.active .timeline-step__dot {
  background: var(--champagne); border-color: var(--champagne); color: var(--midnight);
}
.timeline-step__label { font-size: 11px; color: var(--gray-500); }
.timeline-step.done .timeline-step__label,
.timeline-step.active .timeline-step__label { color: var(--midnight); font-weight: 500; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row { grid-template-columns: 1fr; }
  .dashboard-row--3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .dashboard-content { padding: var(--space-5); }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .dashboard-topbar { padding: 0 var(--space-5); }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
}
