/* ============================================================
   NTLF MEDICAL – Admin Dashboard Styles  (style-admin.css)
   Design: dark navy sidebar + clean white main area.
   ============================================================ */

:root {
  --navy: #0a2540;
  --navy-light: #0d3561;
  --blue: #1a56db;
  --blue-dark: #1341b4;
  --blue-light: #e8f0fe;
  --green: #0d9e6e;
  --green-light: #e6f9f2;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --red: #e53e3e;
  --red-light: #fff5f5;
  --purple: #7c3aed;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #475569;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;
  --font-display: "Sora", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --mobile-bar-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}
input,
select,
textarea {
  font-family: var(--font-body);
}
img {
  max-width: 100%;
  display: block;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: var(--gray-800);
  color: #fff;
  padding: 13px 22px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  max-width: 340px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  background: var(--green);
}
.toast.error {
  background: var(--red);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), #1e40af);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 86, 219, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(26, 86, 219, 0.4);
}
.btn-ghost {
  border-color: var(--border);
  color: var(--text-muted);
  background: var(--surface);
}
.btn-ghost:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}
.btn-danger {
  background: rgba(229, 62, 62, 0.1);
  color: var(--red);
  border: none;
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    145deg,
    #060f1e,
    var(--navy) 45%,
    var(--navy-light)
  );
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.login-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}
.logo-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.logo-circle {
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--blue), var(--navy));
}
.logo-lines {
  position: absolute;
  inset: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.logo-lines span {
  display: block;
  height: 2px;
  border-radius: var(--r-full);
  background: #fff;
}
.logo-lines span:nth-child(1) {
  width: 100%;
}
.logo-lines span:nth-child(2) {
  width: 70%;
}
.logo-lines span:nth-child(3) {
  width: 45%;
}
.logo-mark.small {
  width: 34px;
  height: 34px;
}
.logo-mark.small .logo-circle {
  width: 34px;
  height: 34px;
}
.logo-mark.small .logo-lines {
  inset: 8px;
  gap: 3px;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.logo-ntlf {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy);
}
.logo-medical {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.6rem;
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.login-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--blue-light);
  color: var(--blue);
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 14px;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 6px;
}
.login-card > p {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 7px;
}
.pass-wrap {
  position: relative;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--gray-50);
  color: var(--text);
  font-size: 0.9rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}
.pass-wrap input {
  padding-right: 46px;
}
.pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 0.95rem;
  padding: 4px;
  transition: color var(--transition);
}
.pass-toggle:hover {
  color: var(--blue);
}
.login-error {
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 8px;
  text-align: center;
  display: block;
}
.login-btn {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 0.95rem;
}
.login-demo {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 16px;
  background: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--r-sm);
  padding: 10px;
}
.login-demo code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--gray-800);
}
.login-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color var(--transition);
}
.login-back:hover {
  color: var(--blue-dark);
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
════════════════════════════════════════════════════════════ */
.admin-dash {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 200;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-ntlf {
  color: #fff;
}
.sidebar-logo .logo-medical {
  color: var(--green);
}
.sidebar-logo .logo-circle {
  background: linear-gradient(135deg, var(--blue), var(--green));
}
.sidebar-close {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  display: none;
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.admin-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.anav-btn {
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-display);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.anav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.anav-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
}
.anav-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  background: var(--green);
  border-radius: 0 3px 3px 0;
}
.anav-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  transition: all var(--transition);
}
.anav-btn:hover .anav-icon,
.anav-btn.active .anav-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.anav-btn.active .anav-icon {
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
}
.anav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}
.anav-btn-text {
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 600;
  font-family: var(--font-display);
  transition: color var(--transition);
}
.anav-btn-text:hover {
  color: var(--blue-dark);
}
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-logout {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: rgba(229, 62, 62, 0.12);
  color: #fca5a5;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: none;
}
.btn-logout i {
  font-size: 0.88rem;
  flex-shrink: 0;
}
.btn-logout:hover {
  background: rgba(229, 62, 62, 0.25);
}
.btn-back-site {
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  padding: 8px;
  transition: color var(--transition);
}
.btn-back-site:hover {
  color: #fff;
}

/* Mobile header */
.admin-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  height: var(--mobile-bar-h);
  background: var(--navy);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}
.sidebar-open-btn {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition);
}
.sidebar-open-btn:hover {
  color: #fff;
}
.mobile-title {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  text-align: center;
}
.btn-logout-mini {
  color: #fca5a5;
  font-size: 0.9rem;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition);
}
.btn-logout-mini:hover {
  color: #fff;
}

/* Main */
.admin-main {
  grid-column: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.topbar-left h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-time {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-tab {
  display: none;
  padding: 28px 32px;
  flex: 1;
}
.admin-tab.active {
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   OVERVIEW
════════════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.sc-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  color: #fff;
  transition: transform var(--transition);
}
.stat-card:hover .sc-icon {
  transform: scale(1.08);
}
.sc-blue {
  background: linear-gradient(135deg, var(--blue), #1e40af);
  box-shadow: 0 6px 18px rgba(26, 86, 219, 0.3);
}
.sc-green {
  background: linear-gradient(135deg, var(--green), #0a7a52);
  box-shadow: 0 6px 18px rgba(13, 158, 110, 0.3);
}
.sc-amber {
  background: linear-gradient(135deg, var(--amber), #d97706);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}
.sc-purple {
  background: linear-gradient(135deg, var(--purple, #7c3aed), #6d28d9);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}
.sc-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sc-body strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.sc-body span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-blue strong {
  color: var(--blue);
}
.stat-green strong {
  color: var(--green);
}
.stat-amber strong {
  color: var(--amber);
}
.stat-purple strong {
  color: var(--purple);
}
.ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.dash-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dash-card-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}
.empty-msg {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cat-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.85rem;
}
.cat-stat-row:last-child {
  border: none;
}
.cat-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.cat-stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  margin: 0 12px;
}
.cat-stat-bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--blue), var(--green));
}
.cat-stat-count {
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-display);
  min-width: 28px;
  text-align: right;
}
.admin-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 0.88rem;
}
.notice-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.admin-notice p {
  color: #92400e;
  line-height: 1.6;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.mini-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.mini-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.mini-table tr:last-child td {
  border: none;
}
.mini-table tr:hover td {
  background: var(--gray-50);
}
.order-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.status-pending {
  background: var(--amber-light);
  color: #92400e;
}
.status-complete {
  background: var(--green-light);
  color: var(--green);
}

/* ═══════════════════════════════════════════════════════════
   ADD PRODUCT FORM
════════════════════════════════════════════════════════════ */
.form-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  max-width: 880px;
}
.form-card-header {
  margin-bottom: 28px;
}
.form-card-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-card-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.req {
  color: var(--red);
}
.field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--red);
  min-height: 18px;
  margin-top: 4px;
  font-weight: 500;
}
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 4px;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  padding: 12px 16px;
  background: var(--gray-50);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--transition);
}
.check-label:hover {
  border-color: var(--blue);
}
.check-label input[type="checkbox"] {
  display: none;
}
.check-custom {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition);
}
.check-label input:checked + .check-custom {
  background: var(--blue);
  border-color: var(--blue);
}
.check-label input:checked + .check-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.product-preview {
  background: var(--gray-50);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 20px;
  margin-top: 4px;
}
.product-preview h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.preview-img {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--blue), #1e40af);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(26, 86, 219, 0.3);
}
.preview-cat {
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.preview-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.preview-price {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--green);
  font-size: 1.05rem;
}
.preview-unit {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* ═══════════════════════════════════════════════════════════
   MANAGE PRODUCTS
════════════════════════════════════════════════════════════ */
.manage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
.manage-topbar h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}
.manage-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.manage-search,
.manage-filter-select {
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--text);
  transition: border-color var(--transition);
}
.manage-search {
  min-width: 220px;
}
.manage-search:focus,
.manage-filter-select:focus {
  outline: none;
  border-color: var(--blue);
}
.manage-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.table-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-scroll {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  padding: 13px 16px;
  text-align: left;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.87rem;
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border: none;
}
.admin-table tr:hover td {
  background: var(--gray-50);
}
.tbl-product {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tbl-img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(
    135deg,
    var(--blue-light),
    rgba(26, 86, 219, 0.05)
  );
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1px solid var(--blue-light);
}
.tbl-name {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.88rem;
  line-height: 1.3;
}
.tbl-cat {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.badge-source {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.badge-default {
  background: var(--blue-light);
  color: var(--blue);
}
.badge-custom {
  background: var(--green-light);
  color: var(--green);
}
.tbl-actions {
  display: flex;
  gap: 6px;
}
.btn-tbl {
  padding: 6px 13px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  transition: all var(--transition);
}
.btn-tbl-edit {
  background: var(--blue-light);
  color: var(--blue);
}
.btn-tbl-edit:hover {
  background: var(--blue);
  color: #fff;
}
.btn-tbl-del {
  background: rgba(229, 62, 62, 0.1);
  color: var(--red);
}
.btn-tbl-del:hover {
  background: var(--red);
  color: #fff;
}
.builtin-tag {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   ORDERS TAB
════════════════════════════════════════════════════════════ */
.admin-order-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.admin-order-card:hover {
  box-shadow: var(--shadow-md);
}
.ao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.ao-id {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--navy);
  font-size: 0.95rem;
}
.ao-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ao-customer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.ao-customer strong {
  color: var(--text);
  font-weight: 600;
}
.ao-items {
  font-size: 0.85rem;
}
.ao-items-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.ao-item-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.84rem;
}
.ao-item-row:last-child {
  border: none;
}
.ao-item-name {
  color: var(--text);
  flex: 1;
}
.ao-item-price {
  color: var(--blue);
  font-weight: 600;
  white-space: nowrap;
}
.ao-total {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px dashed var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.ao-total span:last-child {
  color: var(--green);
  font-size: 1.05rem;
}
.ao-notes {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  border-left: 3px solid var(--blue);
}

/* ═══════════════════════════════════════════════════════════
   EDIT MODAL
════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  animation: slideModal 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideModal {
  from {
    transform: translateY(30px);
    opacity: 0.2;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  margin-bottom: 24px;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--navy);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.modal-close:hover {
  background: var(--red);
  color: #fff;
}
.modal-box form {
  padding: 0 28px 28px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .ov-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .admin-dash {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: none;
  }
  .admin-mobile-header {
    display: flex;
  }
  .admin-main {
    grid-column: 1;
    padding-top: var(--mobile-bar-h);
  }
  .admin-topbar {
    display: none;
  }
  .admin-tab {
    padding: 20px 16px;
  }
  .sidebar-close {
    display: block;
  }
}
@media (max-width: 680px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .manage-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .manage-search {
    min-width: unset;
    width: 100%;
  }
  .form-card {
    padding: 22px 18px;
  }
  .ao-customer {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 32px 24px;
  }
}
@media (max-width: 420px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ── Admin identity in topbar ── */
.topbar-identity {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.topbar-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy);
}
.topbar-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Login form role select ── */
#adminRole {
  cursor: pointer;
}
