/* ─── Admin Dashboard ─── */
.admin-shell { display: flex; min-height: 100vh; background: #f8fafc; }
.admin-sidebar {
  width: 260px; background: #0f172a; color: #e2e8f0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 50;
  border-right: 1px solid #1e293b;
}
.admin-sidebar__brand { padding: 24px 20px; border-bottom: 1px solid #1e293b; display: flex; align-items: center; gap: 12px; }
.admin-sidebar__brand-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: #0f172a; display: grid; place-items: center; font-weight: 800; font-size: 16px; letter-spacing: 0.08em; }
.admin-sidebar__nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #94a3b8; font-size: 14px; font-weight: 600; text-decoration: none; transition: all .15s;
}
.admin-sidebar__link:hover { background: #1e293b; color: #f1f5f9; text-decoration: none; }
.admin-sidebar__link.active { background: #1e40af; color: #fff; box-shadow: 0 4px 12px rgba(30,64,175,.3); }
.admin-sidebar__link .ic { width: 20px; text-align: center; font-size: 16px; }
.admin-sidebar__footer { padding: 16px; border-top: 1px solid #1e293b; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 64px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center;
  gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.admin-topbar__title { font-weight: 800; font-size: 18px; color: #0f172a; }
.admin-topbar__search { flex: 1; max-width: 380px; position: relative; }
.admin-topbar__search input { width: 100%; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 10px; padding: 10px 14px 10px 38px; font-size: 14px; }
.admin-topbar__search input:focus { outline: none; border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 3px #dbeafe; }
.admin-topbar__search .s-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.admin-content { padding: 24px; flex: 1; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.admin-stat {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.admin-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.admin-stat__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.admin-stat__value { font-size: 28px; font-weight: 800; color: #0f172a; line-height: 1; }
.admin-stat__sub { font-size: 12px; color: #94a3b8; }
.admin-stat__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; }
.admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; }
.admin-card__head { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-card__title { font-weight: 700; font-size: 15px; color: #0f172a; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.admin-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:hover td { background: #f8fafc; }
.admin-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-badge-pending { background: #fef3c7; color: #92400e; }
.admin-badge-paid { background: #dbeafe; color: #1e40af; }
.admin-badge-confirmed { background: #e0e7ff; color: #3730a3; }
.admin-badge-processing { background: #fce7f3; color: #9d174d; }
.admin-badge-shipped { background: #e0f2fe; color: #0c4a6e; }
.admin-badge-delivered { background: #dcfce7; color: #166534; }
.admin-badge-cancelled { background: #fee2e2; color: #991b1b; }
.admin-badge-low { background: #fef3c7; color: #92400e; }
.admin-badge-out { background: #fee2e2; color: #991b1b; }
.admin-search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin-input { border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.admin-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px #dbeafe; }
.admin-select { border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.admin-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.admin-btn-primary { background: #1e40af; color: #fff; }
.admin-btn-primary:hover { background: #1e3a8a; }
.admin-btn-ghost { background: #f1f5f9; color: #334155; }
.admin-btn-ghost:hover { background: #e2e8f0; }
.admin-btn-danger { background: #dc2626; color: #fff; }
.admin-btn-danger:hover { background: #b91c1c; }
.admin-pagination { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 16px; }
.admin-empty { text-align: center; padding: 40px 20px; color: #64748b; }
.admin-mobile-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; }
.admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
.admin-overlay.open { display: block; }
@media (max-width: 900px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-topbar { padding: 0 12px; }
  .admin-content { padding: 16px; }
  .admin-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-mobile-toggle { display: grid; place-items: center; }
}
@media (max-width: 640px) {
  .admin-cards { grid-template-columns: 1fr; }
  .admin-topbar__search { display: none; }
}
@media (max-width: 480px) {
  .admin-login-wrap { padding: 16px; }
  .admin-login-card { padding: 20px; border-radius: 16px; }
  .admin-login-card h2 { font-size: 20px; }
  .admin-topbar__title { font-size: 16px; }
  .admin-content { padding: 12px; }
}
/* ── Admin responsive — ensure no horizontal overflow on mobile ── */
.admin-main, .admin-content, .admin-card, .admin-table-wrap { max-width: 100%; overflow-x: hidden; }
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-search-row .admin-input, .admin-search-row .admin-select { min-width: 0; flex: 1 1 auto; }
@media (max-width: 480px) {
  .admin-search-row { gap: 8px; }
  .admin-search-row > div { flex: 1 1 100%; max-width: 100% !important; }
  .admin-table th, .admin-table td { padding: 10px 12px; font-size: 13px; }
}
.admin-login-wrap { min-height: 100vh; display: grid; place-items: center; background: #f1f5f9; padding: 24px; }
.admin-login-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 32px; box-shadow: 0 20px 40px rgba(0,0,0,.08); }
.admin-login-card h2 { color: #0f172a !important; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.admin-login-card p.muted { color: #475569 !important; font-size: 13px; line-height: 1.5; }
.admin-login-card label { color: #0f172a !important; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.admin-login-card .admin-input { border: 1.5px solid #cbd5e1; background: #fff; color: #0f172a; font-size: 14px; font-weight: 500; }
.admin-login-card .admin-input::placeholder { color: #94a3b8; }
.admin-login-card .admin-input:focus { border-color: #1e40af; box-shadow: 0 0 0 3px #dbeafe; background: #fff; }
.admin-login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 20px; }
.admin-login-brand .logo { width: 44px; height: 44px; border-radius: 12px; background: #0f172a; color: #fff; display: grid; place-items: center; font-weight: 800; }

/* modal overrides for admin — high contrast, no overlap */
.overlay { background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); }
.modal { background: #ffffff !important; color: #0f172a !important; border: 1px solid #e2e8f0; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal h1, .modal h2, .modal h3, .modal h4 { color: #0f172a !important; }
.modal .muted { color: #64748b !important; }
.modal .admin-input, .modal .admin-select { background: #fff; color: #0f172a; border-color: #cbd5e1; }
.admin-modal { max-width: 720px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .admin-form-grid { grid-template-columns: 1fr; } }

/* Ensure admin content text is always visible on light background — isolated from dark tokens */
.admin-content { background: #f8fafc; color: #0f172a !important; }
.admin-content h1, .admin-content h2, .admin-content h3, .admin-content h4, .admin-content h5 { color: #0f172a !important; }
.admin-content .muted { color: #64748b !important; }
.admin-card, .admin-stat { color: #0f172a; }
.admin-table th { background: #f1f5f9; color: #334155 !important; }
.admin-table td { background: #fff; color: #0f172a !important; }
.admin-card__title { color: #0f172a !important; }
.admin-stat__value { color: #0f172a !important; }
.admin-stat__label { color: #64748b !important; }
.admin-stat__sub { color: #94a3b8 !important; }
/* Badge semantic colors must not be overridden generically */
.admin-badge-pending { background: #fef3c7; color: #92400e !important; }
.admin-badge-low { background: #fef3c7; color: #92400e !important; }
.admin-badge-paid { background: #dbeafe; color: #1e40af !important; }
.admin-badge-confirmed { background: #e0e7ff; color: #3730a3 !important; }
.admin-badge-processing { background: #fce7f3; color: #9d174d !important; }
.admin-badge-shipped { background: #e0f2fe; color: #0c4a6e !important; }
.admin-badge-delivered { background: #dcfce7; color: #166534 !important; }
.admin-badge-cancelled { background: #fee2e2; color: #991b1b !important; }
.admin-badge-out { background: #fee2e2; color: #991b1b !important; }
