/* ═══════════════════════════════════════════════════════════
   Sainatha Admin Panel — Premium CSS v2
   ═══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-b: rgba(255, 255, 255, 0.07);
  --glow: rgba(59, 130, 246, 0.08);
  --border: rgba(255, 255, 255, 0.07);
  --border-h: rgba(255, 255, 255, 0.12);
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --green: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --purple: #8b5cf6;
  --slate: #64748b;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --sidebar: 220px;
  --radius: 14px;
  --radius-sm: 10px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(59, 130, 246, .3);
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .1);
  border-radius: 5px;
}

/* ── Utilities ───────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.muted {
  color: var(--text-2);
}

.mono-sm {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  letter-spacing: -.3px;
}

/* ─────────────────────────── LOGIN ─────────────────────── */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}

.orb1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #3b82f6, transparent);
  top: -150px;
  left: -150px;
}

.orb2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #8b5cf6, transparent);
  bottom: -120px;
  right: -100px;
}

.orb3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #06b6d4, transparent);
  top: 40%;
  left: 55%;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 420px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-h);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .1);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, .35);
  flex-shrink: 0;
}

.logo-icon span {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.logo-icon.sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.logo-icon.sm span {
  font-size: 15px;
}

.login-brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.login-brand-text p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.field-wrap {
  margin-bottom: 16px;
}

.field-wrap label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
}

.input-icon-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255, 255, 255, .04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s, background .2s;
}

.input-icon-wrap input:focus {
  border-color: var(--blue);
  background: rgba(59, 130, 246, .05);
}

.input-icon-wrap input::placeholder {
  color: var(--text-3);
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all .2s;
  box-shadow: 0 6px 24px rgba(59, 130, 246, .35);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, .5);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
}

.login-error {
  color: #f87171;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

.login-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.pulse {
  animation: dotpulse 2s infinite;
}

@keyframes dotpulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .4);
  }

  50% {
    opacity: .8;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

/* ─────────────────────────── APP SHELL ─────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─────────────────────────── SIDEBAR ───────────────────── */
.sidebar {
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width .25s ease;
}

.sidebar.collapsed {
  width: 68px;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-pill,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .user-meta,
.sidebar.collapsed .logout-btn span {
  display: none;
}

.sidebar.collapsed .sidebar-top {
  justify-content: center;
  padding: 20px 0;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}

.sidebar.collapsed .sidebar-bottom {
  padding: 12px 0;
  align-items: center;
}

.sidebar.collapsed .logout-btn {
  width: 44px;
  padding: 10px;
  justify-content: center;
}

.sidebar.collapsed .user-card {
  justify-content: center;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--glass);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
}

.sidebar-toggle:hover {
  background: var(--glass-b);
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-2);
  fill: none;
  stroke-width: 2;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 18px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--glass-b);
  color: var(--text);
}

.nav-item:hover .nav-icon svg {
  stroke: var(--text);
}

.nav-item.active {
  background: rgba(59, 130, 246, .12);
  color: var(--blue);
}

.nav-item.active .nav-icon {
  background: rgba(59, 130, 246, .15);
}

.nav-item.active .nav-icon svg {
  stroke: var(--blue);
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .18s;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 1.8;
  transition: stroke .18s;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
}

.nav-pill {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(59, 130, 246, .15);
  color: var(--blue);
}

.nav-pill.warn {
  background: rgba(245, 158, 11, .15);
  color: var(--amber);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  overflow: hidden;
}

.user-ava {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-meta {
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, .06);
  border: 1px solid rgba(244, 63, 94, .15);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  overflow: hidden;
}

.logout-btn:hover {
  background: rgba(244, 63, 94, .12);
  border-color: rgba(244, 63, 94, .25);
}

.logout-btn svg {
  width: 15px;
  height: 15px;
  stroke: #f87171;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* ─────────────────────── MAIN AREA ─────────────────────── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.breadcrumb-parent {
  font-size: 13px;
  color: var(--text-3);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-left svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
}

.breadcrumb-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 240px;
}

.topbar-search svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  width: 100%;
}

.topbar-search input::placeholder {
  color: var(--text-3);
}

.topbar-notif {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.topbar-notif:hover {
  background: var(--glass-b);
}

.topbar-notif svg {
  width: 17px;
  height: 17px;
  stroke: var(--text-2);
  fill: none;
  stroke-width: 1.8;
}

.notif-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid var(--surface);
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

/* ─────────────────────── PAGES ─────────────────────────── */
.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 40px;
}

.page {
  display: none;
  animation: fadeUp .3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.page-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.date-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
}

.date-chip svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-2);
  fill: none;
  stroke-width: 2;
}

/* ── Glass Card ──────────────────────────────────────────── */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  transition: border-color .2s;
}

.glass-card:hover {
  border-color: var(--border-h);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-actions {
  display: flex;
  gap: 6px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.link-btn:hover {
  color: #60a5fa;
}

.chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .2s;
}

.chip.active,
.chip:hover {
  background: rgba(59, 130, 246, .12);
  border-color: rgba(59, 130, 246, .3);
  color: var(--blue);
}

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s, transform .2s;
}

.kpi-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-wrap svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

.kpi-trend.warn {
  color: var(--amber);
}

.kpi-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

.kpi-bar {
  height: 3px;
  background: rgba(255, 255, 255, .06);
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
}

.kpi-bar div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
  border-radius: 3px;
}

/* ── Charts ──────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-bottom: 20px;
}

.donut-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.legend-item span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Data Table ──────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
  text-align: left;
}

.data-table td {
  padding: 13px 14px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background .15s;
  cursor: default;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .025);
}

.mono-tag {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-2);
}

.mono-tag.sm {
  font-size: 11px;
  padding: 3px 6px;
}

.cell-with-ava {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-ava {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.mini-ava.grad {
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
}

.mini-ava.blue-av {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.mini-ava.purple-av {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}

.mini-ava.gray-av {
  background: rgba(100, 116, 139, .3);
}

.prog-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.prog-bar {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, .07);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.prog-bar div {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 4px;
}

.prog-wrap span {
  font-size: 12px;
  color: var(--text-2);
}

/* ── Status chips ────────────────────────────────────────── */
.chip-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-status.blue {
  background: rgba(59, 130, 246, .12);
  color: #60a5fa;
}

.chip-status.green {
  background: rgba(16, 185, 129, .12);
  color: #34d399;
}

.chip-status.amber {
  background: rgba(245, 158, 11, .12);
  color: #fbbf24;
}

.chip-status.rose {
  background: rgba(244, 63, 94, .12);
  color: #fb7185;
}

.chip-status.purple {
  background: rgba(139, 92, 246, .12);
  color: #a78bfa;
}

.chip-status.cyan {
  background: rgba(6, 182, 212, .12);
  color: #22d3ee;
}

.chip-status.slate {
  background: rgba(100, 116, 139, .1);
  color: #94a3b8;
}

.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 4px;
  vertical-align: middle;
  animation: dotpulse 2s infinite;
}

/* ── Action buttons ──────────────────────────────────────── */
.act-cell {
  white-space: nowrap;
}

.act-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .18s;
  margin-right: 5px;
}

.act-btn:hover {
  background: var(--glass-b);
  color: var(--text);
}

.act-btn.success {
  border-color: rgba(16, 185, 129, .25);
  color: #34d399;
}

.act-btn.success:hover {
  background: rgba(16, 185, 129, .08);
}

.act-btn.danger {
  border-color: rgba(244, 63, 94, .25);
  color: #fb7185;
}

.act-btn.danger:hover {
  background: rgba(244, 63, 94, .08);
}

/* ── Primary button ──────────────────────────────────────── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(59, 130, 246, .3);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, .45);
}

.primary-btn svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
}

/* ── Controls ────────────────────────────────────────────── */
.select-ctrl {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
}

.select-ctrl.sm {
  padding: 6px 10px;
  font-size: 12px;
}

.ctrl-input {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  width: 100%;
}

.ctrl-input:focus,
.select-ctrl:focus {
  border-color: rgba(59, 130, 246, .5);
}

/* ── Form grid ───────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}

/* ── Batch stack ─────────────────────────────────────────── */
.batch-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, .025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.batch-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.batch-icon.bottle {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.batch-icon.box {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}

.batch-icon.master {
  background: linear-gradient(135deg, #f59e0b, #f43f5e);
}

.batch-info {
  flex: 1;
}

.batch-info b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.batch-info span {
  font-size: 11px;
  color: var(--text-3);
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 12px 18px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-h);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  animation: toastIn .3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
}

.toast.removing {
  animation: toastOut .3s ease forwards;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* -- Modal ------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}

.modal-card {
  width: 560px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .15);
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) }
  to { opacity: 1; transform: translateY(0) }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.modal-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}

.modal-close:hover {
  background: #e2e8f0;
}

.modal-close svg {
  width: 15px;
  height: 15px;
  stroke: #64748b;
  fill: none;
  stroke-width: 2;
}

.modal-body {
  padding: 20px 24px;
}

.modal-body .field-wrap label {
  color: #475569;
}

.modal-body .select-ctrl,
.modal-body .ctrl-input {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #0f172a;
}

.modal-body .select-ctrl:focus,
.modal-body .ctrl-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}

.modal-body .ctrl-input::placeholder {
  color: #94a3b8;
}

.modal-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#excel-import-modal {
  padding: 16px;
  overflow-y: auto;
}

#excel-import-modal .excel-modal-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .18);
  overflow: hidden;
}

#excel-import-modal .modal-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, .85);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

#excel-import-modal .excel-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 24px 20px;
}

#excel-import-modal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  flex-wrap: wrap;
}

#excel-import-modal .modal-close {
  position: sticky;
  top: 0;
}

.add-line-btn {
  background: rgba(59, 130, 246, .1);
  border: 1px solid rgba(59, 130, 246, .25);
  color: #3b82f6;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.add-line-btn:hover {
  background: rgba(59, 130, 246, .18);
}

.line-item-row {
  display: grid;
  grid-template-columns: 1fr 90px 100px 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.line-item-row select,
.line-item-row input {
  padding: 8px 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #0f172a;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.line-item-row select:focus,
.line-item-row input:focus {
  border-color: #3b82f6;
  background: #fff;
}

.line-item-row select option {
  background: #fff;
  color: #0f172a;
}

.line-item-row .line-remark-input {
  grid-column: 1 / 4;
}

.remove-line-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(244, 63, 94, .2);
  background: rgba(244, 63, 94, .06);
  color: #f87171;
  border-radius: 7px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.remove-line-btn:hover {
  background: rgba(244, 63, 94, .14);
}

/* ═══════════════════════ EXCEL IMPORT ═══════════════════════ */
.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--blue);
  background: transparent;
  color: var(--blue);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.secondary-btn:hover {
  background: rgba(59,130,246,.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.secondary-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.secondary-btn svg {
  width: 16px;
  height: 16px;
}

.excel-drop-zone {
  border: 2px dashed var(--border-h);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  background: var(--glass);
}
.excel-drop-zone:hover,
.excel-drop-zone.drag-over {
  border-color: var(--blue);
  background: rgba(59,130,246,.04);
}
.excel-drop-zone.drag-over {
  transform: scale(1.01);
}
.excel-drop-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 6px;
}
.excel-drop-sub {
  font-size: 12.5px;
  color: var(--text-3);
}

.excel-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius-sm);
  background: rgba(59,130,246,.04);
  margin-top: 16px;
}
.excel-file-icon { font-size: 28px; }
.excel-file-meta { flex: 1; min-width: 0; }
.excel-file-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.excel-file-size {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.excel-file-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(244,63,94,.08);
  color: var(--rose);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.excel-file-remove:hover {
  background: rgba(244,63,94,.18);
}

.excel-processing {
  text-align: center;
  padding: 40px 0;
}
.excel-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-h);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: excel-spin 0.8s linear infinite;
}
@keyframes excel-spin {
  to { transform: rotate(360deg); }
}
.excel-processing-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.excel-processing-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 4px;
}

.excel-result-icon {
  text-align: center;
  font-size: 48px;
  margin-top: 12px;
}
.excel-result-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 20px;
}
.excel-result-sub {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: -10px 0 18px;
}
.excel-alert-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.excel-alert {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid transparent;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}
.excel-alert.info {
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.18);
}
.excel-alert.success {
  background: rgba(16,185,129,.09);
  border-color: rgba(16,185,129,.2);
}
.excel-alert.warn {
  background: rgba(245,158,11,.11);
  border-color: rgba(245,158,11,.22);
}
.excel-alert.error {
  background: rgba(244,63,94,.1);
  border-color: rgba(244,63,94,.22);
}
.excel-alert-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 5px;
}
.excel-alert-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  font-weight: 600;
}
.excel-alert-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text);
}
.excel-alert-list li {
  margin: 4px 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.excel-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.excel-stat-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-b);
  border: 1px solid var(--border);
}
.excel-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.excel-stat-label {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.excel-preview-section {
  margin-top: 18px;
  border-top: 1px solid var(--border-h);
  padding-top: 18px;
}
.excel-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.excel-preview-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.excel-preview-caption {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.excel-preview-list {
  display: grid;
  gap: 12px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.excel-preview-card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,252,.88));
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.05);
}
.excel-preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.excel-preview-po {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.excel-preview-party {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}
.excel-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.excel-status-chip.create {
  color: #047857;
  background: rgba(16,185,129,.12);
}
.excel-status-chip.update {
  color: #1d4ed8;
  background: rgba(59,130,246,.12);
}
.excel-status-chip.skip {
  color: #be123c;
  background: rgba(244,63,94,.12);
}
.excel-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.excel-meta-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.05);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
}
.excel-preview-logistics {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(59,130,246,.05);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.excel-preview-items {
  display: grid;
  gap: 8px;
}
.excel-preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248,250,252,.95);
  border: 1px solid rgba(148,163,184,.14);
}
.excel-preview-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.excel-preview-item-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 3px;
}
.excel-preview-item-qty {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.excel-preview-issues {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(244,63,94,.08);
  border: 1px solid rgba(244,63,94,.18);
}
.excel-preview-issues-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--rose);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .35px;
}
.excel-preview-issues ul {
  margin: 0;
  padding-left: 18px;
}
.excel-preview-issues li {
  margin: 4px 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .excel-stats-grid {
    grid-template-columns: 1fr;
  }

  .excel-preview-top {
    flex-direction: column;
  }

  .excel-preview-item {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════ LOADING PROGRESS ═══════════════════════ */
.tabs-container {
  display: flex;
  gap: 24px;
}

.tab {
  padding: 0 0 12px 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.loading-trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
}

@media (max-width: 768px) {
  .loading-trips-grid {
    grid-template-columns: 1fr;
  }
}

details summary::-webkit-details-marker {
  display: none;
}

/* ─────────────────────── DYNAMIC FORMS ─────────────────────── */
.form-section-head {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  margin-top: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-h);
  padding-bottom: 6px;
}

.nested-fields-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  background: rgba(248, 250, 252, 0.5);
  border: 1px dashed var(--border-h);
  padding: 16px;
  border-radius: 12px;
  margin-top: 8px;
}

.qr-product-summary {
  margin: 2px 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .10), rgba(6, 182, 212, .08));
  border: 1px solid rgba(59, 130, 246, .18);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.qr-product-summary strong {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 4px;
}

.qr-batch-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .56);
  overflow: hidden;
}

.qr-batch-panel summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(15, 23, 42, .02), rgba(59, 130, 246, .04));
}

.qr-batch-panel summary::-webkit-details-marker {
  display: none;
}

.qr-batch-panel summary strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.qr-batch-panel-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 4px;
}

.qr-batch-panel-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, .18);
  background: rgba(59, 130, 246, .08);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.qr-batch-grid {
  padding: 0 20px 20px;
}

@media (max-width: 768px) {
  .qr-batch-panel summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .qr-batch-panel-tag {
    white-space: normal;
  }
}
