@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,600;1,300&family=Jost:wght@300;400;500&display=swap');

:root {
  --admin-bg: #0f0f0f;
  --admin-surface: #161616;
  --admin-surface2: #1e1e1e;
  --admin-border: #2a2a2a;
  --admin-gold: #c9a84c;
  --admin-gold-dim: rgba(201, 168, 76, 0.15);
  --admin-text: #e8e4dc;
  --admin-muted: #666;
  --admin-green: #2d7a4f;
  --admin-red: #8b1a1a;
  --admin-blue: #1a4a7a;
}

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

body {
  font-family: 'Jost', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-weight: 300;
  min-height: 100vh;
  display: flex;
}

/* ─── SIDEBAR ─── */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--admin-text);
}

.sidebar-logo a span {
  color: var(--admin-gold);
}

.sidebar-logo p {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--admin-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav {
  padding: 20px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--admin-muted);
  padding: 16px 28px 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 28px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--admin-muted);
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--admin-text);
  background: var(--admin-surface2);
}

.sidebar-nav a.active {
  color: var(--admin-gold);
  border-left-color: var(--admin-gold);
  background: var(--admin-gold-dim);
}

.sidebar-nav a .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-bottom {
  padding: 20px 28px;
  border-top: 1px solid var(--admin-border);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--admin-gold-dim);
  border: 1px solid var(--admin-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--admin-gold);
}

.admin-user-info p {
  font-size: 0.78rem;
}

.admin-user-info span {
  font-size: 0.65rem;
  color: var(--admin-muted);
  letter-spacing: 0.1em;
}

/* ─── MAIN ─── */
.admin-main {
  margin-left: 240px;
  flex: 1;
}

.admin-topbar {
  height: 64px;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 300;
}

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

.btn-admin {
  padding: 9px 20px;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn-admin-primary {
  background: var(--admin-gold);
  color: var(--admin-bg);
}

.btn-admin-primary:hover {
  background: #e8d5a3;
}

.btn-admin-secondary {
  background: var(--admin-surface2);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
}

.btn-admin-secondary:hover {
  border-color: var(--admin-gold);
  color: var(--admin-gold);
}

.btn-admin-danger {
  background: transparent;
  color: #e05555;
  border: 1px solid #e05555;
}

.btn-admin-danger:hover {
  background: #e05555;
  color: white;
}

/* ─── CONTENT ─── */
.admin-content {
  padding: 36px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
}

.page-header p {
  font-size: 0.8rem;
  color: var(--admin-muted);
  margin-top: 6px;
}

/* ─── STAT CARDS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: var(--admin-gold);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--admin-gold);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 12px;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 300;
  margin-bottom: 8px;
}

.stat-change {
  font-size: 0.75rem;
}

.stat-change.up {
  color: #5aad7a;
}

.stat-change.down {
  color: #e05555;
}

.stat-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 1.8rem;
  opacity: 0.15;
}

/* ─── TABLES ─── */
.table-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
}

.search-input {
  padding: 8px 14px;
  background: var(--admin-surface2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  outline: none;
  min-width: 220px;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--admin-gold);
}

.search-input::placeholder {
  color: var(--admin-muted);
}

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

thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface2);
}

tbody tr {
  border-bottom: 1px solid var(--admin-border);
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--admin-surface2);
}

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

td {
  padding: 16px 20px;
  font-size: 0.82rem;
  vertical-align: middle;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.product-cell img {
  width: 44px;
  height: 56px;
  object-fit: cover;
  background: #2a2a2a;
}

.product-cell-info p {
  font-size: 0.75rem;
  color: var(--admin-muted);
  margin-top: 2px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 0;
}

.badge-green {
  background: rgba(45, 122, 79, 0.2);
  color: #5aad7a;
  border: 1px solid rgba(45, 122, 79, 0.3);
}

.badge-yellow {
  background: rgba(201, 168, 76, 0.15);
  color: var(--admin-gold);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.badge-red {
  background: rgba(139, 26, 26, 0.2);
  color: #e05555;
  border: 1px solid rgba(139, 26, 26, 0.3);
}

.badge-blue {
  background: rgba(26, 74, 122, 0.2);
  color: #5a9ae0;
  border: 1px solid rgba(26, 74, 122, 0.3);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  background: var(--admin-surface2);
  border: 1px solid var(--admin-border);
  color: var(--admin-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--admin-gold);
  color: var(--admin-gold);
}

.icon-btn.danger:hover {
  border-color: #e05555;
  color: #e05555;
}

/* ─── CHARTS ─── */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  padding: 24px;
}

.chart-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 20px;
  color: var(--admin-text);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-bottom: 28px;
  position: relative;
}

.bar-chart::after {
  content: '';
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--admin-border);
}

.bar {
  flex: 1;
  background: var(--admin-gold-dim);
  border: 1px solid rgba(201, 168, 76, 0.3);
  position: relative;
  transition: background 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar:hover {
  background: var(--admin-gold-dim);
  border-color: var(--admin-gold);
}

.bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -22px;
  font-size: 0.6rem;
  color: var(--admin-muted);
  letter-spacing: 0.1em;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(to top, var(--admin-gold), rgba(201, 168, 76, 0.4));
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.donut {
  width: 140px;
  height: 140px;
  position: relative;
}

.donut svg {
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
}

.donut-center p {
  font-size: 0.6rem;
  color: var(--admin-muted);
  letter-spacing: 0.1em;
}

.donut-legend {
  width: 100%;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  width: 560px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s;
}

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

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--admin-surface);
  z-index: 1;
}

.modal-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 400;
}

.modal-close {
  background: none;
  border: none;
  color: var(--admin-muted);
  font-size: 1.5rem;
}

.modal-close:hover {
  color: var(--admin-text);
}

.modal-body {
  padding: 28px;
}

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

/* ─── FORM ─── */
.admin-form-group {
  margin-bottom: 20px;
}

.admin-form-group label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 8px;
}

.admin-input,
.admin-select,
.admin-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--admin-surface2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
  border-color: var(--admin-gold);
}

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

.admin-select option {
  background: var(--admin-surface2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 0.7rem;
  color: var(--admin-muted);
  margin-top: 6px;
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  font-size: 0.75rem;
  color: var(--admin-muted);
}

.page-btns {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  background: var(--admin-surface2);
  border: 1px solid var(--admin-border);
  color: var(--admin-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
  border-color: var(--admin-gold);
  color: var(--admin-gold);
}

/* ─── MISC ─── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-title-admin {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--admin-text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 20px;
}

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

.empty-state p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* ─── RESPONSIVE ADMIN DASHBOARD ─── */

/* ────── LARGE DESKTOPS (1280px+) ────── */
@media (min-width: 1280px) {
  .admin-sidebar {
    width: 280px;
  }

  .admin-main {
    margin-left: 280px;
  }

  .admin-content {
    padding: 40px;
  }

  .topbar-title {
    font-size: 1.6rem;
  }

  .stat-card {
    padding: 28px 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }

  .charts-grid {
    grid-template-columns: 2fr 1fr;
    gap: 20px;
  }

  table {
    font-size: 0.82rem;
  }

  thead th {
    padding: 16px 24px;
  }

  td {
    padding: 18px 24px;
  }

  .modal {
    width: 600px;
  }
}

/* ────── DESKTOPS & LARGE TABLETS (1024px - 1279px) ────── */
@media (min-width: 1024px) and (max-width: 1279px) {
  .admin-sidebar {
    width: 240px;
  }

  .admin-main {
    margin-left: 240px;
  }

  .admin-content {
    padding: 32px;
  }

  .stat-card {
    padding: 22px 26px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .charts-grid {
    grid-template-columns: 2fr 1fr;
    gap: 14px;
  }

  .table-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .modal {
    width: 540px;
  }

  table {
    font-size: 0.8rem;
  }
}

/* ────── TABLETS (768px - 1023px) ────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .admin-sidebar {
    width: 200px;
  }

  .admin-main {
    margin-left: 200px;
  }

  .admin-topbar {
    padding: 0 20px;
    height: 56px;
  }

  .topbar-title {
    font-size: 1.2rem;
  }

  .admin-content {
    padding: 24px;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 18px 22px;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .bar-chart {
    height: 140px;
  }

  .donut {
    width: 120px;
    height: 120px;
  }

  .table-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .search-input {
    min-width: 100%;
  }

  table {
    font-size: 0.75rem;
  }

  thead th {
    padding: 10px 14px;
  }

  td {
    padding: 12px 14px;
  }

  .product-cell {
    gap: 10px;
  }

  .product-cell img {
    width: 40px;
    height: 50px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal {
    width: 90vw;
    max-width: 480px;
  }

  .modal-header {
    padding: 18px 22px;
  }

  .modal-body {
    padding: 20px;
  }

  .sidebar-logo {
    padding: 20px 16px 18px;
  }

  .sidebar-logo a {
    font-size: 1.3rem;
  }

  .sidebar-nav a {
    padding: 10px 16px;
    font-size: 0.7rem;
    gap: 10px;
  }

  .nav-icon {
    font-size: 0.9rem;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hamburger {
    display: none;
  }
}

/* ────── SMALL TABLETS & LARGE PHONES (480px - 767px) ────── */
@media (min-width: 480px) and (max-width: 767px) {
  body {
    flex-direction: column;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

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

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

  .admin-topbar {
    padding: 0 12px;
    height: 50px;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .topbar-actions {
    gap: 6px;
  }

  .admin-hamburger {
    display: flex !important;
  }

  .admin-content {
    padding: 16px;
  }

  .page-header h1 {
    font-size: 1.3rem;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-label {
    font-size: 0.6rem;
    margin-bottom: 8px;
  }

  .stat-value {
    font-size: 1.5rem;
    margin-bottom: 6px;
  }

  .stat-change {
    font-size: 0.7rem;
  }

  .stat-icon {
    font-size: 1.4rem;
    top: 12px;
    right: 12px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-card h3 {
    font-size: 0.95rem;
    margin-bottom: 16px;
  }

  .bar-chart {
    height: 120px;
    gap: 6px;
  }

  .donut {
    width: 100px;
    height: 100px;
  }

  .donut-center span {
    font-size: 1.3rem;
  }

  table {
    font-size: 0.7rem;
  }

  thead th {
    padding: 8px 10px;
    font-size: 0.55rem;
  }

  td {
    padding: 10px 8px;
  }

  .table-header {
    flex-direction: column;
    gap: 10px;
  }

  .search-input {
    width: 100%;
    min-width: unset;
    font-size: 14px;
  }

  .product-cell {
    gap: 8px;
  }

  .product-cell img {
    width: 36px;
    height: 45px;
  }

  .product-cell-info p {
    font-size: 0.65rem;
  }

  thead th:nth-child(3),
  thead th:nth-child(4),
  td:nth-child(3),
  td:nth-child(4) {
    display: none;
  }

  .table-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-form-group {
    margin-bottom: 16px;
  }

  .admin-input,
  .admin-select,
  .admin-textarea {
    padding: 9px 12px;
    font-size: 14px;
  }

  .admin-textarea {
    min-height: 80px;
  }

  .modal {
    width: 95vw;
    padding: 0;
    max-height: 90vh;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 14px 16px;
    gap: 8px;
  }

  .btn-admin {
    padding: 8px 16px;
    font-size: 0.65rem;
  }

  .pagination {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .page-btns {
    width: 100%;
    gap: 2px;
  }

  .page-btn {
    flex: 1;
    height: 28px;
    font-size: 0.65rem;
  }

  .section-title-admin {
    font-size: 1rem;
  }

  .empty-state {
    padding: 40px 16px;
  }

  .empty-state p {
    font-size: 1.2rem;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 499;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .sidebar-logo {
    padding: 16px 14px 14px;
  }

  .sidebar-logo a {
    font-size: 1.1rem;
    letter-spacing: 0.05em;
  }

  .sidebar-logo p {
    font-size: 0.6rem;
    margin-top: 2px;
  }

  .nav-section-label {
    padding: 12px 14px 6px;
    font-size: 0.5rem;
  }

  .sidebar-nav a {
    padding: 9px 14px;
    font-size: 0.65rem;
    gap: 8px;
  }

  .nav-icon {
    font-size: 0.85rem;
  }

  .sidebar-bottom {
    padding: 14px;
  }

  .admin-user-info p {
    font-size: 0.7rem;
  }

  .admin-user-info span {
    font-size: 0.6rem;
  }

  .admin-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ────── PHONES (320px - 479px) ────── */
@media (max-width: 479px) {
  body {
    flex-direction: column;
    overflow-x: hidden;
  }

  html {
    font-size: 13px;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 200px;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

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

  .admin-main {
    margin-left: 0;
    width: 100%;
  }

  .admin-topbar {
    padding: 0 10px;
    height: 48px;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .topbar-actions {
    gap: 4px;
  }

  .admin-hamburger {
    display: flex !important;
  }

  .admin-content {
    padding: clamp(12px, 3vw, 16px);
  }

  .page-header h1 {
    font-size: 1.2rem;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-label {
    font-size: 0.55rem;
    margin-bottom: 6px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-change {
    font-size: 0.65rem;
  }

  .stat-icon {
    font-size: 1.2rem;
    top: 8px;
    right: 8px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .chart-card {
    padding: 14px;
  }

  .chart-card h3 {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .bar-chart {
    height: 100px;
    gap: 4px;
    padding-bottom: 20px;
  }

  .bar::after {
    font-size: 0.55rem;
    bottom: -18px;
  }

  .donut {
    width: 80px;
    height: 80px;
  }

  .donut-center span {
    font-size: 1.1rem;
  }

  .donut-center p {
    font-size: 0.55rem;
  }

  table {
    font-size: 0.65rem;
  }

  thead {
    display: none;
  }

  tbody {
    display: block;
  }

  tr {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-bottom: 2px solid var(--admin-border);
    margin-bottom: 12px;
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    min-width: 100px;
  }

  .table-header {
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
  }

  .search-input {
    width: 100%;
    font-size: 14px;
    padding: 7px 10px;
  }

  .product-cell {
    display: block;
    gap: 0;
  }

  .product-cell img {
    width: 100%;
    height: auto;
    margin-bottom: 6px;
  }

  .table-actions {
    gap: 3px;
  }

  .icon-btn {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-form-group {
    margin-bottom: 14px;
  }

  .admin-input,
  .admin-select,
  .admin-textarea {
    padding: 8px 10px;
    font-size: 14px;
  }

  .admin-textarea {
    min-height: 70px;
  }

  .form-hint {
    font-size: 0.65rem;
  }

  .modal {
    width: 96vw;
    max-height: 85vh;
  }

  .modal-header {
    padding: 14px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-footer {
    padding: 12px 14px;
    flex-direction: column;
    gap: 8px;
  }

  .btn-admin {
    padding: 7px 12px;
    font-size: 0.6rem;
    min-height: 40px;
    min-width: 40px;
  }

  .pagination {
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
  }

  .page-btns {
    width: 100%;
    gap: 1px;
  }

  .page-btn {
    flex: 1;
    height: 26px;
    font-size: 0.6rem;
  }

  .section-title-admin {
    font-size: 0.95rem;
  }

  .empty-state {
    padding: 30px 14px;
  }

  .empty-state p {
    font-size: 1.1rem;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 499;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .sidebar-logo {
    padding: 14px 12px 12px;
  }

  .sidebar-logo a {
    font-size: 1rem;
    letter-spacing: 0.04em;
  }

  .sidebar-logo p {
    font-size: 0.55rem;
  }

  .nav-section-label {
    padding: 10px 12px 4px;
    font-size: 0.5rem;
  }

  .sidebar-nav a {
    padding: 8px 12px;
    font-size: 0.6rem;
    gap: 8px;
  }

  .nav-icon {
    font-size: 0.8rem;
    width: 18px;
  }

  .sidebar-bottom {
    padding: 12px;
  }

  .admin-user-info p {
    font-size: 0.65rem;
  }

  .admin-user-info span {
    font-size: 0.55rem;
  }

  .admin-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.65rem;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ────── HAMBURGER TOGGLE BUTTON ────── */
.admin-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
  z-index: 600;
}

.admin-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--admin-text);
  transition: all 0.3s ease;
}

.admin-hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.admin-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.admin-hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ────── REDUCE MOTION ────── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ────── PRINT STYLES ────── */
@media print {

  .admin-sidebar,
  .admin-topbar,
  .modal-overlay {
    display: none !important;
  }

  body {
    font-size: 11pt;
  }

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

  table {
    font-size: 10pt;
  }
}