:root {
  --bg: #F4F7FB;
  --sidebar: #111827;
  --sidebar-soft: #1F2937;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #FFFFFF;
  --text: #111827;
  --text-soft: #6B7280;
  --border: #E5E7EB;
  --primary: #1D2D8C;
  --accent: #355CFF;
  --green: #8DD63E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
  --soft-shadow: 0 10px 28px rgba(29, 45, 140, 0.08);
  --primary-gradient: linear-gradient(135deg, #1D2D8C, #355CFF);
  --accent-gradient: linear-gradient(135deg, #8DD63E, #5DA9FF);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, 'Plus Jakarta Sans', Poppins, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top right, rgba(53, 92, 255, 0.08), transparent 22%),
    radial-gradient(circle at bottom left, rgba(141, 214, 62, 0.08), transparent 20%),
    var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* Sidebar independent */
.sidebar {
  width: 272px;
  height: 100vh;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #fff;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}


.brand-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 7px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-copy p {
  margin: 4px 0 0;
  color: rgba(255,255,255,0.62);
  font-size: 12px;
}

.nav-section-title {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 12px 8px;
}

.nav-link,
.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: rgba(255,255,255,0.78);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.nav-link:hover,
.logout-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.08);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(53, 92, 255, 0.35), rgba(29, 45, 140, 0.35));
  border-color: rgba(93, 169, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.nav-icon,
.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  flex-shrink: 0;
}
.nav-dot.blue { background: #60A5FA; }
.nav-dot.indigo { background: #818CF8; }
.nav-dot.green { background: var(--green); }
.nav-dot.cyan { background: #22D3EE; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-help {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
}
.sidebar-help h4 {
  margin: 0 0 6px;
  font-size: 14px;
}
.sidebar-help p {
  margin: 0;
  color: rgba(255,255,255,0.68);
  font-size: 12px;
  line-height: 1.5;
}

.main-area {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  margin-left: 272px;
  padding: 22px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar-title small {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 6px;
}
.topbar-title h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: var(--soft-shadow);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  font-weight: 600;
}
.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.page-grid,
.stats-grid,
.two-col-grid,
.three-col-grid {
  display: grid;
  gap: 18px;
}
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col-grid { grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); }
.three-col-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel,
.metric-card,
.glass-card {
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.metric-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: '';
  position: absolute;
  inset: auto -30px -30px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(53, 92, 255, 0.08);
}
.metric-label {
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.metric-label strong { color: var(--text); font-weight: 600; }
.metric-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  color: var(--text);
}
.metric-sub {
  color: var(--text-soft);
  font-size: 13px;
}
.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(141, 214, 62, 0.14);
  color: #3f7e0d;
  font-size: 12px;
  font-weight: 700;
}

.hero-card {
  background: var(--primary-gradient);
  color: #fff;
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 20px 40px rgba(29,45,140,0.24);
}
.hero-card h3 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.hero-card p {
  margin: 0;
  max-width: 620px;
  color: rgba(255,255,255,0.84);
  line-height: 1.6;
}
.hero-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-title h3, .panel-title h4 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.panel-title p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-primary {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 14px 28px rgba(53, 92, 255, 0.22);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary {
  color: var(--primary);
  background: rgba(53, 92, 255, 0.08);
  border: 1px solid rgba(53, 92, 255, 0.12);
}
.btn-success {
  color: #18310b;
  background: linear-gradient(135deg, rgba(141,214,62,0.95), rgba(93,169,255,0.65));
}
.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #EF4444, #DC2626);
}
.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
}
.btn-block { width: 100%; }

.kpi-list,
.quick-links,
.detail-list {
  display: grid;
  gap: 12px;
}
.kpi-row,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(17,24,39,0.06);
}
.kpi-row:last-child,
.detail-row:last-child { border-bottom: none; }
.kpi-row small,
.detail-label { color: var(--text-soft); }
.kpi-row strong,
.detail-value { color: var(--text); font-weight: 700; }

.table-card {
  overflow: hidden;
  padding: 0;
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 0;
  flex-wrap: wrap;
}
.table-toolbar .panel-title { padding-bottom: 10px; }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 0 22px 22px;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(17,24,39,0.03);
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(17,24,39,0.06);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,0.55); }

.thumb {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: rgba(17,24,39,0.03);
}
.thumb.lg { width: 88px; height: 88px; }
.image-empty {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--text-soft);
  font-size: 11px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.65);
}

.tag,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}
.badge,
.tag {
  background: rgba(53,92,255,0.08);
  color: var(--primary);
}
.status-pill.pending { background: rgba(245,158,11,0.14); color: #9A6200; }
.status-pill.confirmed,
.status-pill.paid,
.status-pill.active,
.status-pill.delivered { background: rgba(141,214,62,0.16); color: #467B15; }
.status-pill.packed,
.status-pill.shipped { background: rgba(53,92,255,0.14); color: var(--primary); }
.status-pill.cancelled,
.status-pill.failed,
.status-pill.inactive { background: rgba(239,68,68,0.14); color: #B91C1C; }
.status-pill.cod { background: rgba(17,24,39,0.08); color: #374151; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}
.form-control,
textarea.form-control,
select.form-control {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(17,24,39,0.02);
}
.form-control:focus,
textarea.form-control:focus,
select.form-control:focus {
  outline: none;
  border-color: rgba(53,92,255,0.4);
  box-shadow: 0 0 0 4px rgba(53,92,255,0.12);
}
textarea.form-control { min-height: 130px; resize: vertical; }
.form-hint {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
}
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.notice {
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.notice.info {
  background: rgba(53,92,255,0.08);
  color: var(--primary);
  border: 1px solid rgba(53,92,255,0.12);
}
.notice.danger {
  background: rgba(239,68,68,0.08);
  color: #B91C1C;
  border: 1px solid rgba(239,68,68,0.12);
}

.preview-grid,
.thumb-wrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.image-card {
  width: 106px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 8px 20px rgba(17,24,39,0.04);
}
.image-card.removed { display: none; }
.image-card img {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  margin: 0 auto 8px;
  border: 1px solid rgba(17,24,39,0.06);
}
.file-name {
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.remove-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: rgba(239,68,68,0.12);
  color: #B91C1C;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
}
.remove-btn:hover { background: rgba(239,68,68,0.18); }

.product-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
}
.main-product-image {
  width: 100%;
  height: 420px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(17,24,39,0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.main-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.product-thumbs .thumb {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.product-thumbs .thumb.active,
.product-thumbs .thumb:hover {
  outline: 3px solid rgba(53,92,255,0.18);
  transform: translateY(-1px);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(360px, 0.95fr);
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.74);
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(17,24,39,0.12);
  overflow: hidden;
  backdrop-filter: blur(18px);
}
.auth-visual {
  padding: 36px;
  background: linear-gradient(135deg, rgba(29,45,140,0.98), rgba(53,92,255,0.9));
  color: #fff;
  position: relative;
}
.auth-visual::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(141,214,62,0.18);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.auth-brand .logo-box {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255,255,255,0.16);
  display: grid;
  place-items: center;
}
.auth-brand img { width: 78%; height: 78%; object-fit: contain; }
.auth-visual h1 {
  margin: 0 0 12px;
  font-size: 34px;
  letter-spacing: -0.03em;
}
.auth-visual p {
  margin: 0;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
}
.auth-points {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}
.auth-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
}
.auth-form-wrap {
  padding: 38px;
}
.auth-form-wrap h2 { margin: 0 0 8px; font-size: 28px; }
.auth-form-wrap p { margin: 0 0 22px; color: var(--text-soft); }
.demo-box {
  margin-top: 18px;
  border-radius: 18px;
  background: rgba(53,92,255,0.06);
  border: 1px solid rgba(53,92,255,0.12);
  padding: 14px 16px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}
.demo-box strong { color: var(--text); }

.text-muted { color: var(--text-soft); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col-grid,
  .product-layout { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: auto;
    position: static;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .main-area {
    margin-left: 0;
    padding: 16px;
    min-height: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .three-col-grid,
  .stats-grid,
  .auth-shell {
    grid-template-columns: 1fr;
  }
}


.master-toggle {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.master-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.08);
}

.master-toggle-label {
  flex: 1;
  text-align: left;
}

.masters-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 13px;
  opacity: 0.75;
}

.masters-arrow.open {
  transform: rotate(180deg);
}

.masters-submenu {
  display: none;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.12);
  margin-top: 4px;
  margin-bottom: 8px;
}

.masters-submenu.show {
  display: block;
}

.nav-link.sub-link {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 14px;
}

.admin-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d2d8c, #355cff);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(53, 92, 255, 0.22);
}

.admin-profile-info {
  min-width: 0;
}

.admin-profile-info h4 {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.admin-profile-info p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.logout-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.16);
  background: rgba(239, 68, 68, 0.10);
  color: #fecaca;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-action:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.logout-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(239, 68, 68, 0.18);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.logout-text {
  font-size: 14px;
  font-weight: 700;
}


