@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0c11;
  --bg-elevated: #0d1016;
  --surface: #12151d;
  --surface-2: #171b25;
  --border: #232836;
  --border-strong: #2e3546;
  --text: #eaecf1;
  --text-secondary: #9aa1b5;
  --text-tertiary: #5c6376;

  --accent: #3d7fff;
  --accent-strong: #2f68e0;
  --accent-soft: rgba(61, 127, 255, 0.14);
  --accent-text: #bcd2ff;

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning: #e2a53a;
  --warning-soft: rgba(226, 165, 58, 0.14);
  --danger: #ef4b4b;
  --danger-soft: rgba(239, 75, 75, 0.14);
  --price: #eab54d;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #e2e4ea;
  --border-strong: #ccd0da;
  --text: #14161c;
  --text-secondary: #565d6e;
  --text-tertiary: #868da0;

  --accent: #2f68e0;
  --accent-strong: #1f4fbf;
  --accent-soft: rgba(47, 104, 224, 0.08);
  --accent-text: #1f4fbf;

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.1);
  --warning: #b7791f;
  --warning-soft: rgba(183, 121, 31, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --price: #b7791f;

  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06);
  --shadow-md: 0 10px 30px -14px rgba(20, 22, 28, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  direction: rtl;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-weight: 700;
  margin: 0 0 6px;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.site-header .bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 16px 0;
  gap: 12px;
  width: 100%;
}

.logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 10px;
  white-space: nowrap;
  letter-spacing: -0.01em;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo .icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.logo span {
  color: var(--accent-text);
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  flex: none;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.theme-toggle .icon {
  width: 16px;
  height: 16px;
}

.theme-icon-dark {
  display: none;
}

:root[data-theme="light"] .theme-icon-light {
  display: none;
}

:root[data-theme="light"] .theme-icon-dark {
  display: block;
}

.cart-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  transition: 0.15s;
  flex: none;
}

.cart-pill:hover {
  border-color: var(--accent);
}

.cart-pill .icon {
  color: var(--accent);
}

.badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Hamburger + sidebar drawer ---------- */
.hamburger-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  flex: none;
}

.hamburger-btn:hover {
  border-color: var(--accent);
}

.hamburger-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  padding: 0 5px;
  font-size: 10.5px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 90;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 84vw;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 95;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow-y: auto;
  box-shadow: -12px 0 30px -12px rgba(0, 0, 0, 0.5);
}

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

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
}

.sidebar-link:hover {
  background: var(--surface-2);
}

.sidebar-link .icon {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex: none;
}

body.sidebar-locked {
  overflow: hidden;
}

@media (max-width: 520px) {
  .site-header .bar {
    padding: 12px 0;
    gap: 6px;
  }

  .hamburger-btn {
    width: 34px;
    height: 34px;
  }

  .logo {
    font-size: 14.5px;
    gap: 6px;
  }

  .logo .icon {
    width: 18px;
    height: 18px;
  }

  .logo-station {
    display: none;
  }

  .cart-pill {
    padding: 7px 10px;
    font-size: 12.5px;
    gap: 5px;
  }

  .cart-pill-label {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(61, 127, 255, 0.55);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-accent {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-accent:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-gold {
  background: var(--surface-2);
  color: var(--price);
  border: 1px solid var(--border-strong);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 75, 75, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* زر لعبة ما تكفيها المساحة — يبقى قابل للضغط عمداً حتى يظهر تحذير SweetAlert بدل ما يبقى بدون رد فعل */
.js-insufficient {
  opacity: 0.5;
  border: 1px dashed var(--danger);
  background: transparent;
  color: var(--danger);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 72px 0 36px;
}

.hero h1 {
  font-size: 34px;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero h1 .accent {
  color: var(--accent-text);
}

.hero p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- Timeline strip ---------- */
.era-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.era-strip span {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- Platform grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 10px 0 60px;
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: 0.18s;
  position: relative;
  overflow: hidden;
}

.platform-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-color, var(--accent));
}

.platform-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.platform-card .icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card-color, var(--accent)) 18%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.platform-card .icon-wrap .icon {
  width: 24px;
  height: 24px;
  color: var(--card-color, var(--accent));
}

.platform-card h3 {
  font-size: 15px;
  margin: 4px 0 6px;
  color: var(--text);
}

.platform-card p {
  color: var(--text-tertiary);
  font-size: 13px;
  margin: 0;
}

/* ---------- Game grid ---------- */
.games-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0;
}

.games-toolbar form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.games-toolbar input,
.games-toolbar select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
}

.game-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: 0.15s;
  position: relative;
}

.game-card:hover {
  border-color: var(--border-strong);
}

.game-card .cover {
  aspect-ratio: 3 / 4;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  overflow: hidden;
}

.game-card .cover .icon {
  width: 30px;
  height: 30px;
}

.game-card h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: 2.7em;
}

.game-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.game-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .game-card {
    padding: 8px;
    gap: 6px;
  }

  .game-card h4 {
    font-size: 12.5px;
  }

  .game-meta {
    font-size: 10.5px;
  }
}

.badge-featured {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--warning-soft);
  color: var(--price);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  align-self: flex-start;
}

.badge-featured .icon {
  width: 12px;
  height: 12px;
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  font-size: 13.5px;
  font-weight: 600;
}

.alert .icon {
  flex: none;
}

.alert-success {
  background: var(--success-soft);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.alert-error {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 75, 75, 0.3);
  color: var(--danger);
}

/* ---------- Storage meter ---------- */
.storage-meter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 20px 0;
}

.storage-meter-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  padding: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  margin: 0;
  box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, 0.5);
  /* يمنع اختفاء/اهتزاز الشريط الثابت أثناء التمرير في متصفحات الموبايل
     بإجباره على طبقة GPU مستقلة بدل إعادة رسمه مع كل حركة تمرير */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  padding-bottom: env(safe-area-inset-bottom);
}

.storage-meter-fixed .container {
  padding: 10px 16px 8px;
}

.storage-meter-fixed .meter-labels {
  font-size: 11.5px;
  margin-bottom: 6px;
}

.storage-meter-fixed .meter-bar {
  height: 5px;
}

.meter-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.meter-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  font-size: 10.5px;
  line-height: 1.1;
  border-radius: 10px;
  white-space: nowrap;
}

.meter-actions .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.meter-actions .btn .icon {
  width: 15px;
  height: 15px;
}

.games-page-spacer {
  height: 118px;
}

@media (max-width: 720px) {
  .games-page-spacer {
    height: 108px;
  }

  .storage-meter-fixed .container {
    padding: 8px 12px 6px;
  }

  .storage-meter-fixed .meter-labels {
    font-size: 11px;
    margin-bottom: 5px;
  }

  .meter-actions .btn {
    padding: 5px 2px;
    font-size: 10px;
    border-radius: 9px;
  }

  .meter-actions .btn .icon {
    width: 14px;
    height: 14px;
  }
}

.meter-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ---------- Cart list ---------- */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-bottom: 8px;
}

.cart-item .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item .info small {
  color: var(--text-tertiary);
}

.storage-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.storage-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
  color: var(--text);
}

.storage-option:hover {
  border-color: var(--border-strong);
}

.storage-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.storage-option .icon {
  width: 26px;
  height: 26px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.storage-option.active .icon {
  color: var(--accent);
}

.storage-option h4 {
  margin: 4px 0;
  font-size: 14px;
}

.storage-option .price {
  color: var(--price);
  font-weight: 800;
  font-size: 13.5px;
}

/* ---------- Forms ---------- */
.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 640px;
  margin: 20px auto;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

/* ---------- Social / contact links ---------- */
.social-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 24px 0;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}

a.social-link:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  transform: translateY(-2px);
}

/* ---------- Confirmation ---------- */
.confirmation-box {
  text-align: center;
  padding: 70px 0;
}

.confirmation-box .icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.confirmation-box .icon-badge .icon {
  width: 32px;
  height: 32px;
  color: var(--success);
}

.order-number {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-text);
  margin: 16px 0;
  letter-spacing: 0.02em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  margin-top: 60px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ---------- Admin ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  padding: 22px 14px;
  flex: none;
}

.admin-sidebar .logo {
  margin-bottom: 26px;
  padding: 0 10px;
  font-size: 16px;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  border-right: 2px solid transparent;
}

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

.admin-sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-right-color: var(--accent);
}

.admin-content {
  flex: 1;
  padding: 32px;
  max-width: 100%;
  overflow-x: hidden;
}

.admin-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-topbar .logo {
  margin-bottom: 0;
  padding: 0;
  font-size: 15px;
}

.sidebar-toggle,
.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  flex: none;
}

.sidebar-close {
  display: none;
}

.admin-sidebar-head {
  display: none;
}

.admin-sidebar-backdrop {
  display: none;
}

.admin-content h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

.admin-content h3 {
  font-size: 16px;
  margin: 26px 0 12px;
  color: var(--text-secondary);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-card .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.stat-card .label {
  color: var(--text-tertiary);
  font-size: 12.5px;
  margin-top: 4px;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

table.data-table th,
table.data-table td {
  padding: 13px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  white-space: nowrap;
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: var(--surface-2);
}

table.data-table th {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-preparing { background: var(--accent-soft); color: var(--accent-text); }
.status-ready { background: var(--success-soft); color: var(--success); }
.status-shipped { background: rgba(147, 141, 255, 0.14); color: #b3aeff; }
.status-delivered { background: var(--success-soft); color: var(--success); }
.status-cancelled { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }

  .admin-topbar { display: flex; }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 40;
  }

  .admin-sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 82%;
    max-width: 300px;
    border-left: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 50;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  }

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

  .admin-sidebar > .logo {
    display: none;
  }

  .admin-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }

  .sidebar-close {
    display: flex;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .admin-content {
    padding: 20px 16px;
  }
}
