/* ============================================================
   SEED PROCESSING MANAGEMENT SYSTEM — Global Styles v2.0
   Premium UI Overhaul — Dark Mode, Glassmorphism, Animations
   Fully Responsive: 320px → 1600px+
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,400&display=swap');

/* ── CSS Variables & Claymorphism Tokens ────────────────────── */
:root {
  /* Background layers - Deep tactile dark clay palette */
  --clr-bg: #0a0f18;
  --clr-surface: #111a28;
  --clr-surface-2: #162234;
  --clr-surface-3: #1c2b42;
  --clr-border: #1f3047;
  --clr-border-soft: #172436;

  /* Brand colors */
  --clr-primary: #00e074;
  --clr-primary-dim: #02381b;
  --clr-primary-glow: rgba(0, 224, 116, 0.3);
  --clr-accent: #4fa1ff;
  --clr-accent-dim: #0f2d57;
  --clr-accent-glow: rgba(79, 161, 255, 0.25);

  /* Semantic colors */
  --clr-warning: #f7ab2e;
  --clr-warning-dim: rgba(247, 171, 46, .12);
  --clr-danger: #ff5252;
  --clr-danger-dim: rgba(255, 82, 82, .12);
  --clr-success: #00e074;
  --clr-success-dim: rgba(0, 224, 116, .12);
  --clr-purple: #b39bfa;
  --clr-purple-dim: rgba(179, 155, 250, .14);

  /* Text */
  --clr-text: #e6eef8;
  --clr-text-muted: #798ea8;
  --clr-text-subtle: #4a5d78;

  /* Sidebar */
  --clr-sidebar: #070c14;
  --clr-sidebar-w: 265px;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Clay Radius Hierarchy */
  --clay-radius-xs: 8px;
  --clay-radius-sm: 12px;
  --clay-radius: 18px;
  --clay-radius-xl: 24px;
  --clay-radius-full: 9999px;

  --radius-xs: var(--clay-radius-xs);
  --radius-sm: var(--clay-radius-sm);
  --radius: var(--clay-radius);
  --radius-xl: var(--clay-radius-xl);
  --radius-full: var(--clay-radius-full);

  /* Clay Surfaces & Cards (Inflated 3D Appearance) */
  --clay-card-bg: linear-gradient(145deg, #141e2e 0%, #0e1624 100%);
  --clay-card-shadow:
    0 12px 28px -4px rgba(0, 0, 0, 0.6),
    0 4px 10px -2px rgba(0, 0, 0, 0.4),
    inset 1px 1px 2px rgba(255, 255, 255, 0.12),
    inset -2px -2px 6px rgba(0, 0, 0, 0.55);
  --clay-card-hover-shadow:
    0 18px 38px -4px rgba(0, 0, 0, 0.7),
    0 6px 14px -2px rgba(0, 0, 0, 0.45),
    inset 1px 1px 2px rgba(255, 255, 255, 0.18),
    inset -2px -2px 6px rgba(0, 0, 0, 0.6);

  /* Clay Inset (Debossed / Sunken Wells for Inputs, Dropdowns, Trays) */
  --clay-inset-bg: #080d15;
  --clay-inset-shadow:
    inset 3px 3px 6px rgba(0, 0, 0, 0.65),
    inset -2px -2px 4px rgba(255, 255, 255, 0.04);
  --clay-inset-focus-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.5),
    inset -1px -1px 3px rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(0, 224, 116, 0.28);

  /* Clay Raised Buttons */
  --clay-btn-primary-bg: linear-gradient(145deg, #02e675 0%, #00b355 100%);
  --clay-btn-primary-shadow:
    0 8px 18px -3px rgba(0, 210, 106, 0.42),
    0 3px 6px -2px rgba(0, 0, 0, 0.4),
    inset 2px 2px 3px rgba(255, 255, 255, 0.45),
    inset -2px -3px 5px rgba(0, 80, 40, 0.5);
  --clay-btn-primary-hover-shadow:
    0 12px 26px -3px rgba(0, 210, 106, 0.55),
    0 4px 10px -2px rgba(0, 0, 0, 0.45),
    inset 2px 2px 3px rgba(255, 255, 255, 0.55),
    inset -2px -3px 5px rgba(0, 80, 40, 0.6);
  --clay-btn-primary-active-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 3px 3px 6px rgba(0, 60, 30, 0.7),
    inset -1px -1px 2px rgba(255, 255, 255, 0.3);

  --clay-btn-secondary-bg: linear-gradient(145deg, #1a263b 0%, #111a28 100%);
  --clay-btn-secondary-shadow:
    0 6px 16px -3px rgba(0, 0, 0, 0.5),
    0 2px 6px -2px rgba(0, 0, 0, 0.3),
    inset 1px 1px 2px rgba(255, 255, 255, 0.15),
    inset -2px -2px 5px rgba(0, 0, 0, 0.55);
  --clay-btn-secondary-hover-shadow:
    0 10px 22px -3px rgba(0, 0, 0, 0.6),
    0 3px 8px -2px rgba(0, 0, 0, 0.4),
    inset 1px 1px 2px rgba(255, 255, 255, 0.22),
    inset -2px -2px 5px rgba(0, 0, 0, 0.65);
  --clay-btn-secondary-active-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 3px 3px 6px rgba(0, 0, 0, 0.65),
    inset -1px -1px 2px rgba(255, 255, 255, 0.08);

  --clay-btn-danger-bg: linear-gradient(145deg, #ff5757 0%, #d92d2d 100%);
  --clay-btn-danger-shadow:
    0 8px 18px -3px rgba(255, 77, 77, 0.38),
    0 3px 6px -2px rgba(0, 0, 0, 0.4),
    inset 2px 2px 3px rgba(255, 255, 255, 0.4),
    inset -2px -3px 5px rgba(110, 10, 10, 0.55);
  --clay-btn-danger-hover-shadow:
    0 12px 24px -3px rgba(255, 77, 77, 0.5),
    0 4px 10px -2px rgba(0, 0, 0, 0.45),
    inset 2px 2px 3px rgba(255, 255, 255, 0.5),
    inset -2px -3px 5px rgba(110, 10, 10, 0.6);
  --clay-btn-danger-active-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 3px 3px 6px rgba(100, 10, 10, 0.7),
    inset -1px -1px 2px rgba(255, 255, 255, 0.25);

  /* Clay Pills / Badges */
  --clay-pill-shadow:
    0 3px 8px -1px rgba(0, 0, 0, 0.35),
    inset 1px 1px 2px rgba(255, 255, 255, 0.22),
    inset -1px -2px 3px rgba(0, 0, 0, 0.35);

  /* Floating Clay Modal */
  --clay-modal-shadow:
    0 24px 60px -8px rgba(0, 0, 0, 0.8),
    0 8px 24px -4px rgba(0, 0, 0, 0.5),
    inset 1px 1px 2px rgba(255, 255, 255, 0.16),
    inset -3px -3px 8px rgba(0, 0, 0, 0.65);

  /* Classic Shadows fallback */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-md: var(--clay-card-shadow);
  --shadow-lg: var(--clay-card-hover-shadow);
  --shadow-xl: var(--clay-modal-shadow);
  --shadow-glow-green: 0 0 20px rgba(0, 224, 116, .25), 0 0 60px rgba(0, 224, 116, .1);
  --shadow-glow-blue: 0 0 20px rgba(79, 161, 255, .25);

  /* Transitions */
  --transition: .2s cubic-bezier(.4, 0, .2, 1);
  --transition-slow: .35s cubic-bezier(.4, 0, .2, 1);

  /* Gradient presets */
  --grad-primary: var(--clay-btn-primary-bg);
  --grad-accent: linear-gradient(135deg, #4fa1ff 0%, #1a6ef7 100%);
  --grad-surface: var(--clay-card-bg);
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 900px 500px at 15% 10%, rgba(0, 224, 116, .05) 0%, transparent 60%),
    radial-gradient(ellipse 800px 500px at 85% 85%, rgba(79, 161, 255, .05) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(179, 155, 250, .025) 0%, transparent 70%),
    linear-gradient(180deg, #0b1018 0%, #070c13 100%);
  background-attachment: fixed;
}

a {
  color: var(--clr-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #7ab8ff;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Login Page (Claymorphism) ─────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 900px 600px at 30% 20%, rgba(0, 224, 116, .08) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 80% 80%, rgba(79, 161, 255, .07) 0%, transparent 60%),
    #080d15;
  padding: 20px;
}

.login-card {
  background: var(--clay-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--clay-radius-xl);
  padding: 46px 38px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--clay-modal-shadow), 0 0 80px rgba(0, 224, 116, .06);
  animation: fadeUp .5s ease both;
}

@media (max-width: 480px) {
  .login-card {
    padding: 30px 22px;
    border-radius: var(--clay-radius);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 76px;
  height: 76px;
  background: var(--clay-btn-primary-bg);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 16px;
  box-shadow: 0 10px 24px -2px rgba(0, 224, 116, 0.45), inset 2px 2px 3px rgba(255, 255, 255, 0.5), inset -2px -3px 5px rgba(0, 80, 40, 0.5);
  animation: float 3s ease-in-out infinite;
}

.login-logo h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.login-logo p {
  color: var(--clr-text-muted);
  font-size: 13px;
  margin-top: 5px;
}

/* ── Forms (Claymorphic Inset Wells & Selects) ─────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}

.form-control,
.form-select,
textarea.form-control,
select.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--clay-inset-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--clay-radius-sm);
  color: var(--clr-text);
  font-family: var(--font);
  font-size: 16px;
  box-shadow: var(--clay-inset-shadow);
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 768px) {
  .form-control,
  .form-select,
  textarea.form-control,
  select.form-control {
    font-size: 14px;
    padding: 11px 15px;
  }
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus,
select.form-control:focus {
  background: #0c1320;
  border-color: rgba(0, 224, 116, 0.5);
  box-shadow: var(--clay-inset-focus-shadow);
  color: #fff;
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus),
textarea.form-control:hover:not(:focus),
select.form-control:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.72), inset -2px -2px 5px rgba(255, 255, 255, 0.05);
}

.form-control::placeholder,
textarea.form-control::placeholder {
  color: var(--clr-text-subtle);
  font-weight: 400;
}

/* Custom Clay Dropdown with 3D Arrow Indicator */
.form-select,
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300e074' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 42px;
  cursor: pointer;
}

.form-select option,
select option {
  background: #0e1624;
  color: var(--clr-text);
  padding: 10px;
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
  opacity: .7;
  cursor: not-allowed;
  background: #070b12;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Password field wrapper */
.pwd-wrap {
  position: relative;
}

.pwd-wrap .form-control {
  padding-right: 46px;
}

.pwd-wrap #togglePwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.pwd-wrap #togglePwd:hover {
  color: var(--clr-text);
}

/* TomSelect Claymorphism Overrides */
.ts-wrapper .ts-control {
  background: var(--clay-inset-bg) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: var(--clay-radius-sm) !important;
  padding: 10px 14px !important;
  box-shadow: var(--clay-inset-shadow) !important;
  color: var(--clr-text) !important;
  font-family: var(--font) !important;
  transition: all var(--transition) !important;
}

.ts-wrapper.focus .ts-control {
  background: #0c1320 !important;
  border-color: rgba(0, 224, 116, 0.5) !important;
  box-shadow: var(--clay-inset-focus-shadow) !important;
}

.ts-control > input {
  color: var(--clr-text) !important;
}

.ts-dropdown {
  background: var(--clay-card-bg) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--clay-radius) !important;
  box-shadow: var(--clay-modal-shadow) !important;
  color: var(--clr-text) !important;
  overflow: hidden !important;
  padding: 6px !important;
  z-index: 1050 !important;
}

.ts-dropdown .option {
  padding: 10px 14px !important;
  border-radius: 8px !important;
  margin: 2px 0 !important;
  transition: all var(--transition) !important;
}

.ts-dropdown .option:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.ts-dropdown .option.active {
  background: linear-gradient(145deg, rgba(0, 224, 116, 0.2) 0%, rgba(0, 224, 116, 0.08) 100%) !important;
  color: var(--clr-primary) !important;
  font-weight: 700 !important;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.1), inset -1px -1px 2px rgba(0, 0, 0, 0.4) !important;
}

/* ── Buttons (Raised 3D Claymorphic Extrusions) ──────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--clay-radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
  min-height: 44px;
  touch-action: manipulation;
  text-decoration: none;
  letter-spacing: .01em;
  position: relative;
}

/* Primary & Success Button (Puffed Emerald Clay) */
.btn-primary,
.btn-success {
  background: var(--clay-btn-primary-bg);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: var(--clay-btn-primary-shadow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  letter-spacing: .02em;
}

.btn-primary:hover,
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-btn-primary-hover-shadow);
  color: #ffffff;
}

.btn-primary:active,
.btn-success:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: var(--clay-btn-primary-active-shadow);
}

/* Secondary Button (Tactile Slate Clay) */
.btn-secondary {
  background: var(--clay-btn-secondary-bg);
  color: var(--clr-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--clay-btn-secondary-shadow);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--clay-btn-secondary-hover-shadow);
}

.btn-secondary:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: var(--clay-btn-secondary-active-shadow);
}

/* Danger Button (Puffed Crimson Clay) */
.btn-danger {
  background: var(--clay-btn-danger-bg);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--clay-btn-danger-shadow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-btn-danger-hover-shadow);
  color: #ffffff;
}

.btn-danger:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: var(--clay-btn-danger-active-shadow);
}

/* Small Button */
.btn-sm {
  padding: 7px 15px;
  font-size: 12px;
  min-height: 36px;
  border-radius: var(--clay-radius-xs);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--clay-radius-xs);
}

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--clr-sidebar-w);
  background: var(--clr-sidebar);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--clr-border) transparent;
  background-image: linear-gradient(180deg, rgba(0, 210, 106, .025) 0%, transparent 40%);
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--grad-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-green);
}

.brand-text {
  min-width: 0;
}

.brand-text h2 {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.3px;
}

.brand-text span {
  font-size: 11px;
  color: var(--clr-text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0 8px;
}

.nav-section-title {
  padding: 14px 18px 5px;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--clr-text-subtle);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 16px;
  margin: 1px 8px;
  color: var(--clr-text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  min-height: 40px;
  touch-action: manipulation;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .04);
  color: var(--clr-text);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(0, 210, 106, .1);
  color: var(--clr-primary);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--clr-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--clr-primary);
}

.nav-item .nav-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  opacity: .8;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-item .nav-badge {
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(0, 210, 106, .12);
  color: var(--clr-primary);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: .3px;
  border: 1px solid rgba(0, 210, 106, .2);
}

.nav-item.active .nav-badge {
  background: rgba(0, 210, 106, .2);
  border-color: rgba(0, 210, 106, .4);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--clr-border);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--grad-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(77, 159, 255, .3);
}

.user-meta {
  min-width: 0;
}

.user-meta h4 {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  font-size: 11px;
  color: var(--clr-text-muted);
  text-transform: capitalize;
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--clr-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(8, 12, 16, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--clr-border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99;
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h2 {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.3px;
}

.topbar-title span {
  font-size: 12px;
  color: var(--clr-text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Cards (Raised 3D Clay Surfaces) ────────────────────────── */
.card {
  background: var(--clay-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--clay-radius);
  overflow: hidden;
  box-shadow: var(--clay-card-shadow);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: rgba(0, 224, 116, .15);
  box-shadow: var(--clay-card-hover-shadow);
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
}

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.2px;
}

.card-body {
  padding: 24px;
}

/* ── Grid Utilities ─────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ── Hamburger button (Raised 3D Clay) ──────────────────────── */
.hamburger-btn {
  display: none;
  background: var(--clay-btn-secondary-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--clay-radius-sm);
  color: var(--clr-text);
  padding: 0;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  box-shadow: var(--clay-btn-secondary-shadow);
}

.hamburger-btn:hover {
  background: linear-gradient(145deg, #1f2f47 0%, #142032 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--clay-btn-secondary-hover-shadow);
  color: #fff;
  transform: translateY(-2px);
}

.hamburger-btn:active {
  transform: translateY(2px) scale(.96);
  box-shadow: var(--clay-btn-secondary-active-shadow);
}

/* ── Sidebar overlay ────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 150;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.sidebar-overlay.visible {
  display: block;
}

/* ── Tablet/Mobile ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl), 4px 0 60px rgba(0, 0, 0, .6);
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-content {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .page-content {
    padding: 12px;
  }

  .card-body {
    padding: 16px;
  }

  .card-header {
    padding: 14px 16px;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }

  .topbar-title {
    width: 100%;
    flex: none;
    order: 3;
    margin-top: 10px;
  }

  .topbar-title h2 {
    font-size: 14px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .topbar-actions .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .page-content {
    padding: 8px;
  }

  .card-body {
    padding: 12px;
  }

  body {
    font-size: 13px;
  }
}

/* ── Stat Cards (Puffed 3D Clay Tiles) ──────────────────────── */
.stat-card {
  background: var(--clay-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--clay-radius);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--clay-card-shadow);
  transition: all var(--transition-slow);
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 224, 116, .35), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--clay-card-hover-shadow);
  border-color: rgba(0, 224, 116, .2);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 1px 1px 2px rgba(255, 255, 255, 0.22), inset -2px -2px 4px rgba(0, 0, 0, 0.45);
}

.stat-icon.green {
  background: linear-gradient(145deg, rgba(0, 224, 116, .25) 0%, rgba(0, 224, 116, .08) 100%);
  color: var(--clr-primary);
  border: 1px solid rgba(0, 224, 116, .3);
}

.stat-icon.blue {
  background: linear-gradient(145deg, rgba(79, 161, 255, .25) 0%, rgba(79, 161, 255, .08) 100%);
  color: var(--clr-accent);
  border: 1px solid rgba(79, 161, 255, .3);
}

.stat-icon.orange {
  background: linear-gradient(145deg, rgba(247, 171, 46, .25) 0%, rgba(247, 171, 46, .08) 100%);
  color: var(--clr-warning);
  border: 1px solid rgba(247, 171, 46, .3);
}

.stat-icon.red {
  background: linear-gradient(145deg, rgba(255, 82, 82, .25) 0%, rgba(255, 82, 82, .08) 100%);
  color: var(--clr-danger);
  border: 1px solid rgba(255, 82, 82, .3);
}

.stat-icon.purple {
  background: linear-gradient(145deg, rgba(179, 155, 250, .25) 0%, rgba(179, 155, 250, .08) 100%);
  color: var(--clr-purple);
  border: 1px solid rgba(179, 155, 250, .3);
}

.stat-info {
  min-width: 0;
}

.stat-info h4 {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.5px;
}

.stat-info p {
  font-size: 12px;
  color: var(--clr-text-muted);
  margin-top: 5px;
  font-weight: 500;
}

@media (max-width: 480px) {
  .stat-card {
    padding: 14px 14px;
    gap: 12px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 19px;
    border-radius: 12px;
  }

  .stat-info h4 {
    font-size: 22px;
  }
}

/* ── Tables (Clay Inset Trays & Sculpted Headers) ──────────── */
.table-wrap,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--clay-inset-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-inset-shadow);
  padding: 3px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 460px;
}

table th {
  background: linear-gradient(180deg, #182436 0%, #101927 100%);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--clr-text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

table th:first-child {
  border-top-left-radius: 14px;
}

table th:last-child {
  border-top-right-radius: 14px;
}

table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
  transition: all var(--transition);
}

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

table tr:hover td {
  background: rgba(0, 224, 116, .04);
}

table .mono {
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

@media (max-width: 600px) {

  table th,
  table td {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ── Badges (Tactile 3D Clay Pills) ─────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--clay-radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
  box-shadow: var(--clay-pill-shadow);
}

.badge-green {
  background: linear-gradient(145deg, rgba(0, 224, 116, .22) 0%, rgba(0, 224, 116, .08) 100%);
  color: #00e074;
  border: 1px solid rgba(0, 224, 116, .3);
}

.badge-blue {
  background: linear-gradient(145deg, rgba(79, 161, 255, .22) 0%, rgba(79, 161, 255, .08) 100%);
  color: #4fa1ff;
  border: 1px solid rgba(79, 161, 255, .3);
}

.badge-orange {
  background: linear-gradient(145deg, rgba(247, 171, 46, .22) 0%, rgba(247, 171, 46, .08) 100%);
  color: #f7ab2e;
  border: 1px solid rgba(247, 171, 46, .3);
}

.badge-red {
  background: linear-gradient(145deg, rgba(255, 82, 82, .22) 0%, rgba(255, 82, 82, .08) 100%);
  color: #ff5252;
  border: 1px solid rgba(255, 82, 82, .3);
}

.badge-gray {
  background: linear-gradient(145deg, rgba(121, 142, 168, .18) 0%, rgba(121, 142, 168, .06) 100%);
  color: var(--clr-text-muted);
  border: 1px solid rgba(121, 142, 168, .25);
}

.badge-purple {
  background: linear-gradient(145deg, rgba(179, 155, 250, .22) 0%, rgba(179, 155, 250, .08) 100%);
  color: var(--clr-purple);
  border: 1px solid rgba(179, 155, 250, .3);
}

/* ── Net Weight Display (Raised Clay Well) ──────────────────── */
.net-weight-box {
  background: linear-gradient(145deg, rgba(0, 224, 116, .12) 0%, rgba(0, 224, 116, .03) 100%);
  border: 1px solid rgba(0, 224, 116, .3);
  border-radius: var(--clay-radius);
  padding: 22px 24px;
  text-align: center;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4), inset 1px 1px 2px rgba(255, 255, 255, 0.2), inset -2px -2px 6px rgba(0, 0, 0, 0.4);
}

.net-weight-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 224, 116, .6), transparent);
}

.net-weight-box .label {
  font-size: 11px;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
}

.net-weight-box .value {
  font-size: 38px;
  font-weight: 900;
  color: var(--clr-primary);
  line-height: 1.1;
  margin-top: 6px;
  letter-spacing: -1px;
  text-shadow: 0 0 24px rgba(0, 224, 116, .35);
}

.net-weight-box .unit {
  font-size: 13px;
  color: var(--clr-text-muted);
  margin-top: 3px;
}

@media (max-width: 480px) {
  .net-weight-box .value {
    font-size: 28px;
  }
}

/* ── Alert Messages (Puffed 3D Clay Bubbles) ────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 20px;
  border-radius: var(--clay-radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  animation: slideIn .3s ease;
  word-break: break-word;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 1px 1px 2px rgba(255, 255, 255, 0.15), inset -2px -2px 4px rgba(0, 0, 0, 0.35);
}

.alert-success {
  background: linear-gradient(145deg, rgba(0, 224, 116, .16) 0%, rgba(0, 224, 116, .06) 100%);
  border: 1px solid rgba(0, 224, 116, .35);
  border-left: 4px solid var(--clr-primary);
  color: #00e074;
}

.alert-error {
  background: linear-gradient(145deg, rgba(255, 82, 82, .16) 0%, rgba(255, 82, 82, .06) 100%);
  border: 1px solid rgba(255, 82, 82, .35);
  border-left: 4px solid var(--clr-danger);
  color: #ff5252;
}

.alert-warning {
  background: linear-gradient(145deg, rgba(247, 171, 46, .16) 0%, rgba(247, 171, 46, .06) 100%);
  border: 1px solid rgba(247, 171, 46, .35);
  border-left: 4px solid var(--clr-warning);
  color: #f7ab2e;
}

.alert-info {
  background: linear-gradient(145deg, rgba(79, 161, 255, .16) 0%, rgba(79, 161, 255, .06) 100%);
  border: 1px solid rgba(79, 161, 255, .35);
  border-left: 4px solid var(--clr-accent);
  color: #4fa1ff;
}

.alert .close-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .6;
  transition: opacity var(--transition);
}

.alert .close-btn:hover {
  opacity: 1;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 22px 0;
}

/* ── Section Header ──────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.section-header p {
  font-size: 13px;
  color: var(--clr-text-muted);
  margin-top: 3px;
}

/* ── Tabs (Sunken Track & Raised Clay Buttons) ────────────────── */
.tab-wrapper {}

.tab-nav,
.main-tab-nav {
  display: flex;
  gap: 6px;
  background: var(--clay-inset-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-inset-shadow);
  padding: 6px;
  margin-bottom: 22px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.tab-btn,
.main-tab-btn {
  padding: 9px 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--clr-text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--clay-radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 38px;
  touch-action: manipulation;
  letter-spacing: -.1px;
}

.tab-btn:hover:not(.active),
.main-tab-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.tab-btn.active,
.main-tab-btn.active {
  background: var(--clay-btn-primary-bg);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: var(--clay-btn-primary-shadow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  border-radius: var(--clay-radius-sm);
}

.tab-panel,
.main-tab-panel {
  display: none;
}

.tab-panel.active,
.main-tab-panel.active {
  display: block;
}

@media (max-width: 480px) {
  .tab-nav,
  .main-tab-nav {
    width: 100%;
  }

  .tab-btn,
  .main-tab-btn {
    flex: 0 0 auto;
    text-align: center;
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}

/* ── Filters row (Raised Clay Container) ─────────────────────── */
.filters-wrap {
  padding: 18px 20px;
  background: var(--clay-card-bg);
  border-radius: var(--clay-radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--clay-card-shadow);
  margin-bottom: 20px;
}

/* ── User Cards (Raised 3D Clay Blocks) ──────────────────────── */
.uc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

@media (max-width: 400px) {
  .uc-grid {
    grid-template-columns: 1fr;
  }
}

.uc-card {
  background: var(--clay-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--clay-radius);
  padding: 20px 22px;
  box-shadow: var(--clay-card-shadow);
  transition: all var(--transition-slow);
}

.uc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--clay-card-hover-shadow);
  border-color: rgba(79, 161, 255, .25);
}

.uc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(77, 159, 255, .2);
}

.uc-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.uc-actions .btn,
.uc-actions button,
.uc-actions a {
  flex: 1;
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  padding: 7px 8px;
  min-height: 34px;
}

@media (max-width: 360px) {
  .uc-actions {
    flex-direction: column;
  }

  .uc-actions .btn,
  .uc-actions button,
  .uc-actions a {
    width: 100%;
    flex: none;
  }
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  margin: 2px;
  white-space: nowrap;
}

/* ── Autocomplete dropdown ──────────────────────────────────── */
.autocomplete-dropdown {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--clr-border) !important;
  background: var(--clr-surface) !important;
  box-shadow: var(--shadow-lg) !important;
}

.autocomplete-dropdown>div:hover {
  background: rgba(0, 210, 106, .06) !important;
}

/* ── Page header (some admin pages) ────────────────────────── */
.page-header {
  padding: 24px 28px 0;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.5px;
}

.page-header p {
  color: var(--clr-text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(0, 210, 106, .2);
  }

  50% {
    box-shadow: 0 0 25px rgba(0, 210, 106, .5);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

.fade-in {
  animation: fadeUp .4s ease both;
}

/* ── Utility Classes ─────────────────────────────────────────── */
.text-muted {
  color: var(--clr-text-muted);
}

.text-success {
  color: var(--clr-success);
}

.text-danger {
  color: var(--clr-danger);
}

.text-warning {
  color: var(--clr-warning);
}

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

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 4px;
}

.gap-6 {
  gap: 6px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-20 {
  gap: 20px;
}

.flex-1 {
  flex: 1;
  min-width: 0;
}

.flex-wrap {
  flex-wrap: wrap;
}

.w-100 {
  width: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.mono {
  font-family: 'Courier New', monospace;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 127, 168, .4);
}

/* ── Large screen ──────────────────────────────────────────── */
@media (min-width: 1400px) {
  :root {
    --clr-sidebar-w: 280px;
  }

  .page-content {
    padding: 36px;
  }
}

/* ── Glassmorphism helpers ─────────────────────────────────── */
.glass {
  background: rgba(14, 21, 32, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 45, 66, .8);
}

/* ── Glow borders ──────────────────────────────────────────── */
.border-glow-green {
  border-color: rgba(0, 210, 106, .4) !important;
  box-shadow: 0 0 12px rgba(0, 210, 106, .15);
}

.border-glow-blue {
  border-color: rgba(77, 159, 255, .4) !important;
  box-shadow: 0 0 12px rgba(77, 159, 255, .15);
}

/* ── Gradient text ─────────────────────────────────────────── */
.grad-text {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Lot Number Payment Status Colors ───────────────────────── */
/* Apply these to Master Lot Number cells in panel tables       */
.lot-pending {
  color: var(--clr-danger);
  font-weight: 700;
  letter-spacing: .01em;
}

.lot-pending::after {
  content: ' ●';
  font-size: 8px;
  vertical-align: middle;
  opacity: .8;
}

.lot-cleared {
  color: var(--clr-success);
  font-weight: 700;
  letter-spacing: .01em;
}

.lot-cleared::after {
  content: ' ✓';
  font-size: 10px;
  vertical-align: middle;
  opacity: .9;
}

/* ── Viewer Role Read-Only Banner ────────────────────────────── */
.viewer-readonly-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--clr-accent-dim);
  border: 1px solid rgba(77, 159, 255, .25);
  border-radius: var(--radius-sm);
  color: var(--clr-accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.viewer-readonly-banner span:first-child {
  font-size: 16px;
}

/* ── Print ───────────────────────────────────────────────────── */
@page {
  size: A4 landscape;
  margin: 0;
}

@media print {

  .sidebar,
  .topbar,
  .hamburger-btn,
  .sidebar-overlay,
  .tab-nav,
  .filters-wrap,
  .btn,
  .print-hide,
  .pagination-controls,
  .pagination-info,
  .pagination-buttons {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    background: #fff !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .page-content {
    padding: 0 !important;
    width: 100% !important;
    background: #fff !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .app-layout {
    background: #fff !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body,
  html {
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 5mm !important;
    height: auto !important;
    min-height: 0 !important;
    zoom: 0.8;
  }

  .card {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    background: #fff !important;
  }

  .card-header {
    background: none !important;
    border-bottom: 2px solid #000 !important;
    padding: 10px 0 !important;
    color: #000 !important;
  }

  .card-header h3 {
    color: #000 !important;
  }

  .card-body {
    padding: 10px 0 !important;
  }

  .table-wrap {
    overflow: visible !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 10px !important;
    table-layout: auto !important;
  }

  table th {
    background: #eee !important;
    color: #000 !important;
    border-bottom: 2px solid #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 9px !important;
    padding: 2px 3px !important;
    white-space: nowrap !important;
  }

  table td {
    color: #000 !important;
    border-bottom: 1px solid #ccc !important;
    font-size: 9px !important;
    padding: 2px 3px !important;
    white-space: nowrap !important;
  }

  .badge {
    border: 1px solid #333 !important;
    color: #333 !important;
    background: transparent !important;
    padding: 1px 4px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
  }
  .badge-pod, .badge-kernel, .badge-green, .badge-blue, .badge-red, .badge-orange {
    padding: 1px 4px !important;
    font-size: 8px !important;
    line-height: 1.2 !important;
  }
}

/* ── POD / KERNEL Type Badges (3D Clay Pills) ───────────────── */
.badge-pod {
  background: linear-gradient(145deg, rgba(34, 197, 94, .25) 0%, rgba(34, 197, 94, .1) 100%);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, .35);
  box-shadow: var(--clay-pill-shadow);
  padding: 3px 10px;
  border-radius: var(--clay-radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge-kernel {
  background: linear-gradient(145deg, rgba(99, 102, 241, .25) 0%, rgba(99, 102, 241, .1) 100%);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, .35);
  box-shadow: var(--clay-pill-shadow);
  padding: 3px 10px;
  border-radius: var(--clay-radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge-secondary {
  background: linear-gradient(145deg, rgba(148, 163, 184, .18) 0%, rgba(148, 163, 184, .06) 100%);
  color: var(--clr-text-muted);
  border: 1px solid rgba(148, 163, 184, .25);
  box-shadow: var(--clay-pill-shadow);
  padding: 3px 10px;
  border-radius: var(--clay-radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Remaining Challan Alert: RED indicator */
.chalan-remaining-alert {
  color: var(--clr-danger) !important;
  font-weight: 700;
}

.chalan-remaining-alert .badge-chalan {
  background: linear-gradient(145deg, rgba(255, 82, 82, .25) 0%, rgba(255, 82, 82, .1) 100%);
  border: 1px solid rgba(255, 82, 82, .4);
  box-shadow: var(--clay-pill-shadow);
  color: var(--clr-danger);
  padding: 3px 10px;
  border-radius: var(--clay-radius-full);
  font-size: 11px;
  font-weight: 700;
}

/* ── Edit Modal & Generic Modals (Floating 3D Clay Dialogs) ─── */
.edit-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 900;
  align-items: center;
  justify-content: center;
}

.edit-modal-overlay.open {
  display: flex;
}

.edit-modal {
  background: var(--clay-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--clay-radius-xl);
  padding: 30px 32px;
  width: 92%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--clay-modal-shadow);
  animation: fadeUp .25s cubic-bezier(.16, 1, .3, 1);
}

.edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.edit-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.edit-modal-close {
  background: var(--clay-btn-secondary-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  color: var(--clr-text-muted);
  font-size: 18px;
  padding: 6px 12px;
  border-radius: var(--clay-radius-xs);
  box-shadow: var(--clay-btn-secondary-shadow);
  transition: all var(--transition);
}

.edit-modal-close:hover {
  background: linear-gradient(145deg, #1f2f47 0%, #142032 100%);
  color: var(--clr-text);
  transform: translateY(-1px);
}

.edit-modal-close:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: var(--clay-btn-secondary-active-shadow);
}

/* Lot suggestion placeholder style */
.lot-suggestion-hint {
  font-size: 11px;
  color: var(--clr-text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Remaining stock display (Tactile Pill) */
.remaining-stock-info {
  background: linear-gradient(145deg, rgba(34, 197, 94, .12) 0%, rgba(34, 197, 94, .04) 100%);
  border: 1px solid rgba(34, 197, 94, .25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 1px 1px 2px rgba(255, 255, 255, 0.15), inset -1px -1px 3px rgba(0, 0, 0, 0.4);
  border-radius: var(--clay-radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 8px;
}

.remaining-stock-info.warning {
  background: linear-gradient(145deg, rgba(251, 146, 60, .12) 0%, rgba(251, 146, 60, .04) 100%);
  border-color: rgba(251, 146, 60, .3);
}

.remaining-stock-info strong {
  color: var(--clr-success);
}

.remaining-stock-info.warning strong {
  color: #f97316;
}

/* ── Generic Modal Overlay ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 950;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background: var(--clay-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--clay-radius-xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--clay-modal-shadow);
  animation: fadeUp .25s cubic-bezier(.16, 1, .3, 1);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 21, 0.4);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* Close (✕) button inside modal headers */
.modal-header .close-btn,
button.close-btn {
  background: var(--clay-btn-secondary-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  color: var(--clr-text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 6px 12px;
  border-radius: var(--clay-radius-xs);
  box-shadow: var(--clay-btn-secondary-shadow);
  transition: all var(--transition);
}

.modal-header .close-btn:hover,
button.close-btn:hover {
  background: linear-gradient(145deg, #1f2f47 0%, #142032 100%);
  color: var(--clr-text);
  transform: translateY(-1px);
}

.modal-header .close-btn:active,
button.close-btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: var(--clay-btn-secondary-active-shadow);
}

/* ── Delete Record Button (3D Crimson Clay) ─────────────────── */
.btn-delete-record {
  background: linear-gradient(145deg, rgba(255, 82, 82, 0.18) 0%, rgba(180, 20, 20, 0.1) 100%);
  color: var(--clr-danger);
  border: 1px solid rgba(255, 82, 82, 0.3);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), inset 1px 1px 2px rgba(255, 255, 255, 0.15), inset -1px -1px 3px rgba(0, 0, 0, 0.4);
  border-radius: var(--clay-radius-xs);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-delete-record:hover {
  background: var(--clay-btn-danger-bg);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--clay-btn-danger-shadow);
  transform: translateY(-1px);
}

.btn-delete-record:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: var(--clay-btn-danger-active-shadow);
}

/* ── Preview Modal Lists (Clay Sunken Inset) ─────────────────── */
.preview-list {
  display: flex;
  flex-direction: column;
  background: var(--clay-inset-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-inset-shadow);
  padding: 14px 22px;
}

.preview-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  gap: 16px;
}

.preview-item:last-child {
  border-bottom: none;
}

.preview-label {
  font-weight: 600;
  color: var(--clr-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-value {
  font-weight: 700;
  color: var(--clr-text);
  font-size: 14px;
  text-align: right;
  word-break: break-word;
}

/* ── Pagination Controls (Claymorphic Buttons) ───────────────── */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background-color: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  margin-top: 0;
}

.pagination-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--clay-radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--clay-btn-secondary-bg);
  color: var(--clr-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25), inset 1px 1px 2px rgba(255, 255, 255, 0.12), inset -1px -1px 2px rgba(0, 0, 0, 0.4);
  transition: all var(--transition);
}

.btn-page:hover:not(.disabled):not(.active) {
  background: linear-gradient(145deg, #1f2f47 0%, #142032 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35), inset 1px 1px 2px rgba(255, 255, 255, 0.18), inset -1px -1px 2px rgba(0, 0, 0, 0.5);
}

.btn-page.active {
  background: var(--clay-btn-primary-bg);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--clay-btn-primary-shadow);
  font-weight: 700;
}

.btn-page.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

/* ================================================================
   MOBILE-ONLY UI IMPROVEMENTS  (max-width: 767px)
   All rules are strictly phone-scoped. Desktop is unchanged.
   ================================================================ */

/* Bottom nav + sticky save: hidden on desktop */
.mobile-bottom-nav {
  display: none;
}

.mobile-sticky-save {
  display: none;
}

@media (max-width: 767px) {

  /* 1. Root */
  :root {
    --clr-sidebar-w: 0px;
  }

  /* 2. Body padding for bottom nav */
  body {
    padding-bottom: 70px;
  }

  /* 3. Layout */
  .app-layout {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }

  /* 4. Sidebar drawer */
  .sidebar {
    width: 285px;
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 48px rgba(0, 0, 0, .75);
  }

  #global_season_select,
  #global_year_select {
    font-size: 14px !important;
    padding: 6px 8px !important;
  }

  /* 5. Topbar — compact single row, no wrap */
  .topbar {
    padding: 0 12px !important;
    height: 54px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .topbar-title {
    flex: 1 !important;
    min-width: 0 !important;
    order: 0 !important;
    margin-top: 0 !important;
    width: auto !important;
  }

  .topbar-title h2 {
    font-size: 13px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-title span {
    display: none !important;
  }

  .topbar-actions {
    flex-shrink: 0;
    gap: 6px !important;
  }

  .topbar-actions>a.btn.btn-secondary {
    display: none !important;
  }

  /* 6. Hamburger */
  .hamburger-btn {
    display: flex !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* 7. Page padding */
  .page-content {
    padding: 12px !important;
  }

  /* 8. Cards */
  .card {
    border-radius: 12px;
  }

  .card-body {
    padding: 14px !important;
  }

  .card-header {
    padding: 12px 14px !important;
  }

  .card-header h3 {
    font-size: 13px !important;
  }

  /* 9. All grids → single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* 10. Tables */
  .table-wrap,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table th,
  table td {
    padding: 9px 10px !important;
    font-size: 12px !important;
  }

  /* 11. Buttons */
  .btn {
    min-height: 44px !important;
    border-radius: 10px;
  }

  .btn-sm {
    min-height: 38px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  .btn-primary {
    width: 100% !important;
    padding: 14px !important;
    font-size: 15px !important;
  }

  /* 12. Form controls — 16px prevents iOS zoom */
  .form-control,
  .form-select {
    font-size: 16px !important;
    padding: 12px 14px !important;
    border-radius: 10px;
  }

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

  /* 13. Tabs */
  .tab-nav {
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 9px 14px !important;
    font-size: 12px !important;
    min-height: 40px !important;
  }

  .main-tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px !important;
  }

  .main-tab-btn {
    padding: 10px 14px !important;
    font-size: 12px !important;
    min-height: 42px !important;
    white-space: nowrap;
  }

  /* 14. Alerts */
  .alert {
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  /* 15. Stat cards */
  .stat-card {
    padding: 14px !important;
    gap: 12px !important;
    border-radius: 10px !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }

  .stat-info h4 {
    font-size: 20px !important;
  }

  /* 16. Fetched-chip info rows (Panels 6, 7, 8) — 2 columns on mobile */
  .fetched-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  .fetched-chip {
    padding: 9px 10px !important;
    border-radius: 8px !important;
  }

  .fetched-chip .fc-lbl {
    font-size: 9px !important;
    letter-spacing: .3px !important;
  }

  .fetched-chip .fc-val {
    font-size: 13px !important;
  }

  .fetched-chip.a-grade .fc-val,
  .fetched-chip.jina-grade .fc-val {
    font-size: 15px !important;
  }

  /* 17. Edit / generic modals */
  .edit-modal {
    width: 96% !important;
    padding: 18px !important;
    border-radius: 14px !important;
    margin: 0 auto;
  }

  .modal-content {
    width: 96% !important;
    border-radius: 14px !important;
  }

  .modal-body {
    padding: 16px !important;
  }

  .modal-header {
    padding: 14px 16px !important;
  }

  .modal-footer {
    padding: 12px 16px !important;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }

  /* Farmer slip: slide up from bottom */
  .slip-modal-inner {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 95vh !important;
    border-radius: 16px 16px 0 0 !important;
  }

  #farmerSlipModal {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  /* 18. Party / Farmer ledger */
  .ledger-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .party-selector-wrapper {
    padding: 10px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .party-selector-wrapper select {
    max-width: 100% !important;
    font-size: 16px !important;
  }

  .party-header-layout {
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .receivables-card {
    width: 100% !important;
    padding: 12px 16px !important;
  }

  .payment-card {
    position: static !important;
    border-radius: 12px !important;
    padding: 16px !important;
  }

  /* 19. Farmer ledger filter bar */
  .fl-filter-bar {
    flex-direction: column !important;
    padding: 12px !important;
    gap: 10px !important;
    border-radius: 10px !important;
    margin-bottom: 14px !important;
  }

  .fl-filter-bar>div {
    width: 100% !important;
  }

  .fl-filter-bar>div:last-child {
    flex-direction: row !important;
    display: flex !important;
  }

  .fl-filter-bar .btn {
    flex: 1 !important;
  }

  .farmer-card {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .farmer-serial {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-width: unset !important;
    text-align: left !important;
    font-size: 16px !important;
  }

  .farmer-serial small {
    display: inline !important;
  }

  .farmer-amount {
    text-align: left !important;
    font-size: 16px !important;
    border-top: 1px solid var(--clr-border);
    padding-top: 8px;
    margin-top: 4px;
  }

  /* 20. Order item grid: 2 cols on phone */
  .order-item-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .order-item-grid>div:last-child {
    grid-column: 1 / -1 !important;
  }

  /* 21. Misc */
  .divider {
    margin: 14px 0 !important;
  }

  .d-flex.gap-12,
  .d-flex.gap-20 {
    flex-wrap: wrap;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 10px;
    padding: 12px !important;
    align-items: center;
  }

  .pagination-info {
    font-size: 13px !important;
    text-align: center;
  }

  .pagination-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px !important;
  }

  .btn-page {
    min-width: 40px !important;
    height: 40px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    touch-action: manipulation;
  }

  .totals-strip {
    gap: 12px !important;
    padding: 12px !important;
    justify-content: space-around;
  }

  .filters-wrap {
    padding: 12px !important;
    border-radius: 10px !important;
  }

  .typeahead-item {
    padding: 14px !important;
    font-size: 14px !important;
  }

  .login-card {
    padding: 24px 18px !important;
  }

  .section-header {
    flex-direction: column;
    gap: 8px;
  }

  .section-header h2 {
    font-size: 16px;
  }

  .preview-item {
    grid-template-columns: 1fr !important;
    gap: 4px;
  }

  .preview-value {
    text-align: left !important;
  }

  /* 22. Bottom navigation bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(6, 10, 16, 0.98);
    border-top: 1px solid var(--clr-border);
    z-index: 300;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .5);
    padding: 0 2px;
    align-items: stretch;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--clr-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    text-decoration: none;
    transition: color .15s;
    position: relative;
    border-radius: 0;
    min-height: unset !important;
    min-width: unset !important;
    font-family: var(--font);
  }

  .mobile-bottom-nav a.active,
  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav button:hover {
    color: var(--clr-primary) !important;
  }

  .mobile-bottom-nav a.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 2px;
    background: var(--clr-primary);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 8px var(--clr-primary);
  }

  .bnav-icon {
    font-size: 20px;
    line-height: 1;
  }

  .bnav-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: uppercase;
    line-height: 1;
  }

  /* 23. Sticky save button (wrap submit btns in .mobile-sticky-save) */
  .mobile-sticky-save {
    display: block !important;
    position: sticky;
    bottom: 68px;
    z-index: 90;
    padding: 10px 0 0;
    background: linear-gradient(to top, var(--clr-bg) 55%, transparent);
  }

  /* 24. TomSelect */
  .ts-control {
    font-size: 16px !important;
    padding: 10px 14px !important;
  }

}

/* end @media (max-width: 767px) */