/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #f0f2f8;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: linear-gradient(180deg, #1e2a3a, #15202e);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.logo span {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.nav-label {
  padding: 0 20px;
  margin-top: 16px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-left-color: #22d3ee;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 40px;
}

/* ===== Top Bar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.date-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  margin-left: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-right svg {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ===== Content Area ===== */
.content {
  padding: 0 32px;
}

/* ===== Top Grid (Stats + Revenue) ===== */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: start;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ===== Stat Cards ===== */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 8px;
}

.stat-card .change {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11px;
}

.stat-card .change.up   { color: #10b981; }
.stat-card .change.down { color: #f43f5e; }
.stat-card .change .sub { color: #94a3b8; margin-left: 4px; }

.arrow-up::before   { content: "↑"; }
.arrow-down::before { content: "↓"; }

/* ===== Revenue Card ===== */
.revenue-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.revenue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.revenue-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.revenue-legend {
  display: flex;
  gap: 24px;
  margin: 12px 0 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-val {
  font-weight: 700;
  color: #1e293b;
  margin-left: 4px;
}

/* ===== Bottom Grid (Table + Pie) ===== */
.bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* ===== Table Card ===== */
.table-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.table-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #f43f5e;
  font-weight: 600;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

tbody td {
  padding: 12px 0;
  font-size: 13px;
  color: #64748b;
  border-bottom: 1px solid #f8fafc;
}

tbody td:first-child { color: #334155; }
tbody td:last-child  { color: #334155; font-weight: 600; }
tbody tr:hover       { background: #f8fafc; }

/* ===== Pie Card ===== */
.pie-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pie-card h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.pie-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.pie-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
}

.pie-legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pie-legend-item .val {
  font-weight: 600;
  color: #334155;
}

/* ===== Shared Page Components ===== */

/* Stat Row (4-col) */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green  { background: #ecfdf5; color: #10b981; }
.badge-yellow { background: #fffbeb; color: #f59e0b; }
.badge-red    { background: #fef2f2; color: #f43f5e; }
.badge-gray   { background: #f1f5f9; color: #64748b; }

/* Primary Button */
.btn-primary {
  padding: 8px 18px;
  background: #4361ee;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-primary:hover { background: #3451d1; }

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Info Cards */
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.info-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.info-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 14px;
}
.info-card p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}
.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Code inline */
code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #4361ee;
  font-family: 'DM Sans', monospace;
}

/* Sidebar links reset */
a.nav-item {
  text-decoration: none;
}

/* ===== User Menu (Topbar) ===== */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.user-menu img.avatar {
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #94a3b8;
  transition: all 0.2s;
  text-decoration: none;
}

.logout-btn:hover {
  background: #fef2f2;
  color: #f43f5e;
}

::-webkit-scrollbar { display:none; }
* { -ms-overflow-style:none; scrollbar-width:none; }