/* ============================================================
   Teazovo Admin — style.css
   Dark theme · Green accent #22c55e · Glassmorphism
   ============================================================ */

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

:root {
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --green-glow:  rgba(34,197,94,.22);
  --bg:          #060b08;
  --bg2:         #0a100d;
  --sidebar-w:   260px;
  --topbar-h:    68px;
  --surface:     rgba(255,255,255,.035);
  --surface2:    rgba(255,255,255,.06);
  --border:      rgba(255,255,255,.07);
  --text:        #f0fdf4;
  --text-muted:  #6b7280;
  --text-sub:    #9ca3af;
  --radius:      14px;
  --radius-sm:   10px;
  --shadow:      0 8px 32px rgba(0,0,0,.5);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  overflow: hidden;
}

/* scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(34,197,94,.3); border-radius: 4px; }

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w); height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto; overflow-x: hidden;
  padding: 0 0 16px;
  position: fixed; left: 0; top: 0; z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg2); z-index: 1;
}
.brand-icon { font-size: 1.5rem; filter: drop-shadow(0 0 8px rgba(34,197,94,.5)); }
.brand-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--green), #86efac);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; flex: 1; }
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 6px; transition: color .2s; }
.sidebar-close:hover { color: var(--text); }

.sidebar-section-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  color: var(--text-muted); padding: 18px 20px 8px;
}

.sidebar-nav { display: flex; flex-direction: column; padding: 0 12px; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-sub);
  font-size: .875rem; font-weight: 500;
  transition: all .2s; position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: rgba(34,197,94,.12);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.2);
}
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px rgba(34,197,94,.5)); }
.danger-item:hover { background: rgba(239,68,68,.08); color: #fca5a5; }

.nav-icon { font-size: 1rem; flex-shrink: 0; }
.nav-text { flex: 1; }
.nav-badge {
  font-size: .65rem; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; flex-shrink: 0;
}
.new-badge    { background: rgba(34,197,94,.15); color: var(--green); }
.count-badge  { background: rgba(60,130,246,.15); color: #60a5fa; }
.online-badge { background: rgba(245,158,11,.12); color: #fbbf24; }

/* Sidebar footer */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  margin: auto 12px 0; padding: 14px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-top: 24px;
}
.admin-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #0a0f0d; flex-shrink: 0;
}
.admin-info { flex: 1; overflow: hidden; }
.admin-name  { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-email { font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34,197,94,.3); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(34,197,94,.3); } 50% { box-shadow: 0 0 0 5px rgba(34,197,94,.1); } }

/* ═══════════════════════════════════════
   MAIN WRAPPER
   ═══════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  transition: margin-left .3s;
}

/* ─ TOP BAR ─ */
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; gap: 16px;
  background: rgba(6,11,8,.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.page-title-wrap { display: flex; flex-direction: column; }
.page-title { font-size: 1.2rem; font-weight: 700; line-height: 1; }
.breadcrumb { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.menu-btn {
  display: none; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 1.2rem; padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all .2s;
}
.menu-btn:hover { background: var(--surface2); border-color: rgba(34,197,94,.3); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: rgba(34,197,94,.4); }
.search-icon { font-size: .85rem; }
.search-input {
  background: none; border: none; outline: none; color: var(--text);
  font-family: inherit; font-size: .85rem; width: 200px;
}
.search-input::placeholder { color: var(--text-muted); }
.icon-btn {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 1rem; padding: 9px 12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all .2s;
}
.icon-btn:hover { background: var(--surface2); border-color: rgba(34,197,94,.3); }
.notif-dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2px rgba(34,197,94,.3);
}
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #0a0f0d; cursor: pointer;
}

/* ─ CONTENT PAGES ─ */
.content {
  flex: 1; overflow-y: auto; padding: 28px;
  display: flex; flex-direction: column; gap: 24px;
}
.content.hidden { display: none !important; }

/* Welcome Banner */
.welcome-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(22,163,74,.04));
  border: 1px solid rgba(34,197,94,.15); border-radius: var(--radius);
  animation: fadeUp .4s ease;
}
@keyframes fadeUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }
.welcome-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.welcome-sub   { font-size: .875rem; color: var(--text-muted); }
.welcome-date  { font-size: .8rem; color: var(--text-sub); text-align: right; line-height: 1.6; }

/* ─ KPI GRID ─ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  animation: fadeUp .4s ease backwards;
  cursor: default;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(34,197,94,.2); }

.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 1.2rem;
}
.orders-color    { background: rgba(34,197,94,.12); }
.users-color     { background: rgba(59,130,246,.12); }
.revenue-color   { background: rgba(245,158,11,.12); }
.riders-color    { background: rgba(168,85,247,.12); }
.sellers-color   { background: rgba(236,72,153,.12); }
.commission-color{ background: rgba(20,184,166,.12); }

.kpi-trend { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.trend-up      { background: rgba(34,197,94,.12); color: var(--green); }
.trend-down    { background: rgba(239,68,68,.12); color: #f87171; }
.trend-neutral { background: rgba(107,114,128,.12); color: var(--text-muted); }

.kpi-value { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: .8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-sub   { font-size: .75rem; color: rgba(34,197,94,.8); margin-top: 6px; }

/* ─ CHARTS ROW ─ */
.charts-row { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.chart-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px;
}
.chart-title { font-size: 1rem; font-weight: 700; margin-bottom: 3px; }
.chart-sub   { font-size: .78rem; color: var(--text-muted); }

/* Bar chart */
.bar-chart {
  display: flex; align-items: flex-end; gap: 8px;
  height: 160px; padding: 0 4px;
}
.bar {
  flex: 1; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--green), rgba(34,197,94,.4));
  position: relative; transition: opacity .2s;
  min-height: 8px;
}
.bar:hover { opacity: .8; }
.bar.secondary { background: linear-gradient(180deg, #3b82f6, rgba(59,130,246,.3)); }
.bar-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: rgba(15,23,18,.95); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 6px; font-size: .7rem; white-space: nowrap; pointer-events: none;
}
.chart-x-labels { display: flex; gap: 8px; margin-top: 8px; padding: 0 4px; }
.chart-x-labels span { flex: 1; text-align: center; font-size: .68rem; color: var(--text-muted); }

.chart-tabs { display: flex; gap: 4px; }
.chart-tab {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); font-size: .78rem; font-family: inherit;
  cursor: pointer; transition: all .2s;
}
.chart-tab.active { background: rgba(34,197,94,.12); color: var(--green); border-color: rgba(34,197,94,.3); }

/* Donut */
.donut-wrap { display: flex; justify-content: center; margin: 4px 0 16px; }
.donut-svg { width: 140px; height: 140px; }
.donut-seg { transition: opacity .3s; }
.donut-seg:hover { opacity: .7; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-sub); }
.legend-dot  { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-item strong { margin-left: auto; color: var(--text); }

/* ─ TABLE ─ */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; overflow: hidden;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.view-all-btn {
  font-size: .8rem; color: var(--green); background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.2); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-family: inherit;
  transition: all .2s; text-decoration: none;
}
.view-all-btn:hover { background: rgba(34,197,94,.15); }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: .72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 13px 14px; font-size: .85rem; border-bottom: 1px solid rgba(255,255,255,.03); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.status-delivered  { background: rgba(34,197,94,.12);  color: #86efac; }
.status-pending    { background: rgba(245,158,11,.12); color: #fcd34d; }
.status-cancelled  { background: rgba(239,68,68,.12);  color: #fca5a5; }
.status-preparing  { background: rgba(59,130,246,.12); color: #93c5fd; }
.status-on-the-way { background: rgba(168,85,247,.12); color: #d8b4fe; }

/* ─ BOTTOM GRID ─ */
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.list-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rank-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
  transition: background .2s;
}
.rank-list li:hover { background: var(--surface2); }
.rank-num { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; background: rgba(34,197,94,.1); color: var(--green); flex-shrink: 0; }
.rank-info { flex: 1; }
.rank-name   { font-size: .85rem; font-weight: 600; }
.rank-orders { font-size: .72rem; color: var(--text-muted); }
.rank-amount { font-size: .85rem; font-weight: 700; color: var(--green); }

.quick-stats { display: flex; flex-direction: column; gap: 10px; }
.quick-stat-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
}
.qs-icon  { font-size: 1.2rem; }
.qs-label { font-size: .75rem; color: var(--text-muted); }
.qs-value { font-size: .9rem; font-weight: 700; }

/* Placeholder pages */
.placeholder-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; text-align: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 60px 32px;
}
.placeholder-icon { font-size: 4rem; filter: drop-shadow(0 0 16px var(--green-glow)); }
.placeholder-page h3 { font-size: 1.4rem; font-weight: 700; }
.placeholder-page p { font-size: .9rem; color: var(--text-muted); max-width: 480px; line-height: 1.7; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main-wrapper { margin-left: 0; }
  .menu-btn { display: flex; }
  .search-box { display: none; }
  .content { padding: 16px; gap: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .welcome-date { display: none; }
  .topbar { padding: 0 16px; }
}

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