/* ============================================================
   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 ─────────────────────────────────────────── */
:root {
  /* Background layers */
  --clr-bg: #080c10;
  --clr-surface: #0e1520;
  --clr-surface-2: #141d2e;
  --clr-surface-3: #1a2438;
  --clr-border: #1e2d42;
  --clr-border-soft: #162030;

  /* Brand colors */
  --clr-primary: #00d26a;
  --clr-primary-dim: #003d20;
  --clr-primary-glow: rgba(0, 210, 106, 0.25);
  --clr-accent: #4d9fff;
  --clr-accent-dim: #0f2a50;
  --clr-accent-glow: rgba(77, 159, 255, 0.2);

  /* Semantic colors */
  --clr-warning: #f5a623;
  --clr-warning-dim: rgba(245, 166, 35, .1);
  --clr-danger: #ff4d4d;
  --clr-danger-dim: rgba(255, 77, 77, .1);
  --clr-success: #00d26a;
  --clr-success-dim: rgba(0, 210, 106, .1);
  --clr-purple: #a78bfa;
  --clr-purple-dim: rgba(167, 139, 250, .12);

  /* Text */
  --clr-text: #e2eaf5;
  --clr-text-muted: #6b7fa8;
  --clr-text-subtle: #3d5070;

  /* Sidebar */
  --clr-sidebar: #060a10;
  --clr-sidebar-w: 265px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .6);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .7);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, .8);
  --shadow-glow-green: 0 0 20px rgba(0, 210, 106, .2), 0 0 60px rgba(0, 210, 106, .08);
  --shadow-glow-blue: 0 0 20px rgba(77, 159, 255, .2);

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

  /* Border radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --radius-xl: 18px;
  --radius-full: 9999px;

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

  /* Gradient presets */
  --grad-primary: linear-gradient(135deg, #00d26a 0%, #00a853 100%);
  --grad-accent: linear-gradient(135deg, #4d9fff 0%, #1a6ef7 100%);
  --grad-surface: linear-gradient(135deg, #0e1520 0%, #141d2e 100%);
}

/* ── 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 800px 400px at 20% 0%, rgba(0, 210, 106, .04) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 100%, rgba(77, 159, 255, .04) 0%, transparent 70%);
  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 ────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 900px 600px at 30% 20%, rgba(0, 210, 106, .07) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 80% 80%, rgba(77, 159, 255, .06) 0%, transparent 60%),
    #080c10;
  padding: 16px;
}

.login-card {
  background: rgba(14, 21, 32, 0.85);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow-xl), 0 0 80px rgba(0, 210, 106, .06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp .5s ease both;
}

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

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

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  background: var(--grad-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-glow-green);
  animation: float 3s ease-in-out infinite;
}

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

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

/* ── Forms ─────────────────────────────────────────────────── */
.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 {
  width: 100%;
  padding: 11px 14px;
  background: var(--clr-surface-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  font-family: var(--font);
  font-size: 16px;
  /* prevents iOS auto-zoom */
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
  -webkit-appearance: none;
}

@media (min-width: 768px) {

  .form-control,
  .form-select {
    font-size: 14px;
  }
}

.form-control:focus,
.form-select:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
  background: rgba(0, 210, 106, .03);
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
  border-color: #2a3d58;
}

.form-control::placeholder {
  color: var(--clr-text-subtle);
}

.form-select option {
  background: var(--clr-surface-2);
}

.form-control[readonly] {
  opacity: .65;
  cursor: default;
}

/* 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);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
  min-height: 42px;
  touch-action: manipulation;
  text-decoration: none;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition);
}

.btn:active::before {
  background: rgba(0, 0, 0, .1);
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 210, 106, .3);
  letter-spacing: .02em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 210, 106, .45);
  background: linear-gradient(135deg, #00e675 0%, #00bf5f 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--clr-surface-2);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
  background: var(--clr-surface-3);
  border-color: #2a3d58;
  color: var(--clr-text);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4d4d, #e53935);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 77, 77, .25);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 77, 77, .4);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  min-height: 34px;
}

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

/* ── 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);
}

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

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

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(0, 210, 106, .12);
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(20, 29, 46, .6), rgba(14, 21, 32, .8));
}

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

.card-body {
  padding: 22px;
}

/* ── 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 ───────────────────────────────────────── */
.hamburger-btn {
  display: none;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--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: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.hamburger-btn:hover {
  background: var(--clr-surface-3);
  border-color: #2a3d58;
}

.hamburger-btn:active {
  transform: scale(.95);
}

/* ── 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-title h2 {
    font-size: 14px;
  }

  .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 ─────────────────────────────────────────────── */
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  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, 210, 106, .3), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 210, 106, .15);
}

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

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.green {
  background: rgba(0, 210, 106, .12);
  box-shadow: 0 0 20px rgba(0, 210, 106, .1);
}

.stat-icon.blue {
  background: rgba(77, 159, 255, .12);
  box-shadow: 0 0 20px rgba(77, 159, 255, .1);
}

.stat-icon.orange {
  background: rgba(245, 166, 35, .12);
  box-shadow: 0 0 20px rgba(245, 166, 35, .1);
}

.stat-icon.red {
  background: rgba(255, 77, 77, .12);
  box-shadow: 0 0 20px rgba(255, 77, 77, .1);
}

.stat-icon.purple {
  background: var(--clr-purple-dim);
}

.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 ─────────────────────────────────────────────────── */
.table-wrap,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

table th {
  background: rgba(20, 29, 46, .8);
  padding: 11px 14px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--clr-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}

table td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(30, 45, 66, .6);
  vertical-align: middle;
  transition: background var(--transition);
}

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

table tr:hover td {
  background: rgba(0, 210, 106, .03);
}

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

@media (max-width: 600px) {

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

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

.badge-green {
  background: rgba(0, 210, 106, .12);
  color: var(--clr-primary);
  border: 1px solid rgba(0, 210, 106, .2);
}

.badge-blue {
  background: rgba(77, 159, 255, .12);
  color: var(--clr-accent);
  border: 1px solid rgba(77, 159, 255, .2);
}

.badge-orange {
  background: rgba(245, 166, 35, .12);
  color: var(--clr-warning);
  border: 1px solid rgba(245, 166, 35, .2);
}

.badge-red {
  background: rgba(255, 77, 77, .12);
  color: var(--clr-danger);
  border: 1px solid rgba(255, 77, 77, .2);
}

.badge-gray {
  background: rgba(107, 127, 168, .1);
  color: var(--clr-text-muted);
  border: 1px solid rgba(107, 127, 168, .15);
}

.badge-purple {
  background: var(--clr-purple-dim);
  color: var(--clr-purple);
  border: 1px solid rgba(167, 139, 250, .2);
}

/* ── Net Weight Display ─────────────────────────────────────── */
.net-weight-box {
  background: linear-gradient(135deg, rgba(0, 210, 106, .08), rgba(0, 210, 106, .03));
  border: 1px solid rgba(0, 210, 106, .25);
  border-radius: var(--radius);
  padding: 20px 22px;
  text-align: center;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.net-weight-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 210, 106, .5), 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: 36px;
  font-weight: 900;
  color: var(--clr-primary);
  line-height: 1.1;
  margin-top: 6px;
  letter-spacing: -1px;
}

.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 ─────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  animation: slideIn .3s ease;
  word-break: break-word;
  font-weight: 500;
}

.alert-success {
  background: rgba(0, 210, 106, .08);
  border: 1px solid rgba(0, 210, 106, .25);
  border-left: 4px solid var(--clr-primary);
  color: var(--clr-primary);
}

.alert-error {
  background: rgba(255, 77, 77, .08);
  border: 1px solid rgba(255, 77, 77, .25);
  border-left: 4px solid var(--clr-danger);
  color: var(--clr-danger);
}

.alert-warning {
  background: rgba(245, 166, 35, .08);
  border: 1px solid rgba(245, 166, 35, .25);
  border-left: 4px solid var(--clr-warning);
  color: var(--clr-warning);
}

.alert-info {
  background: rgba(77, 159, 255, .08);
  border: 1px solid rgba(77, 159, 255, .25);
  border-left: 4px solid var(--clr-accent);
  color: var(--clr-accent);
}

.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 var(--clr-border);
  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 ────────────────────────────────────────────────────── */
.tab-wrapper {}

.tab-nav {
  display: flex;
  gap: 3px;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 8px 18px;
  border: none;
  background: none;
  color: var(--clr-text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 36px;
  touch-action: manipulation;
  letter-spacing: -.1px;
}

.tab-btn.active {
  background: transparent;
  color: var(--clr-primary);
  border-bottom: 2px solid var(--clr-primary);
  border-radius: 0;
  box-shadow: none;
}

.tab-btn:not(.active):hover {
  background: rgba(255, 255, 255, .05);
  color: var(--clr-text);
}

.tab-panel {
  display: none;
}

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

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

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
    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 ─────────────────────────────────────────────── */
.filters-wrap {
  padding: 16px;
  background: var(--clr-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
  margin-bottom: 16px;
}

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

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

.uc-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all var(--transition-slow);
}

.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 ───────────────────────────────────────────────────── */
@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }

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

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

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

  .app-layout {
    background: #fff !important;
    display: block !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .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: 11px !important;
    padding: 4px 6px !important;
    white-space: normal !important;
  }

  table td {
    color: #000 !important;
    border-bottom: 1px solid #ccc !important;
    font-size: 11px !important;
    padding: 4px 6px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .badge {
    border: 1px solid #333 !important;
    color: #333 !important;
    background: transparent !important;
  }
}

/* ── POD / KERNEL Type Badges ────────────────────────────────── */
.badge-pod {
  background: rgba(34, 197, 94, .15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, .3);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge-kernel {
  background: rgba(99, 102, 241, .15);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, .3);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge-secondary {
  background: rgba(148, 163, 184, .12);
  color: var(--clr-text-muted);
  border: 1px solid rgba(148, 163, 184, .2);
  padding: 2px 8px;
  border-radius: 20px;
  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: rgba(248, 81, 73, .15);
  border: 1px solid rgba(248, 81, 73, .35);
  color: var(--clr-danger);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

/* Edit modal overlay */
.edit-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 900;
  align-items: center;
  justify-content: center;
}

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

.edit-modal {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 28px 30px;
  width: 92%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  animation: fadeUp .2s ease;
}

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

.edit-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.edit-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text-muted);
  font-size: 20px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}

.edit-modal-close:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text);
}

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

/* Remaining stock display */
.remaining-stock-info {
  background: rgba(34, 197, 94, .08);
  border: 1px solid rgba(34, 197, 94, .2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 8px;
}

.remaining-stock-info.warning {
  background: rgba(251, 146, 60, .08);
  border-color: rgba(251, 146, 60, .25);
}

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

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

/* ── Generic Modal Overlay (History modal, etc.) ─────────────────
   Mirrors .edit-modal-overlay but for modals toggled via
   style.display = 'flex' / 'none' in JavaScript.               */
.modal-overlay {
  display: none;
  /* hidden by default — JS sets display:flex to open */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 950;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  animation: fadeUp .2s ease;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

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

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--clr-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Close (✕) button inside modal headers */
.modal-header .close-btn,
button.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}

.modal-header .close-btn:hover,
button.close-btn:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text);
}
/* ── Phase 1 additions ── */
.btn-delete-record {
  background: rgba(248,81,73,.1);
  color: var(--clr-danger);
  border: 1px solid rgba(248,81,73,.2);
  transition: all .2s ease;
}
.btn-delete-record:hover {
  background: var(--clr-danger);
  color: #fff;
}

/* ── Preview Modal Lists ── */
.preview-list {
  display: flex;
  flex-direction: column;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
}
.preview-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed var(--clr-border);
  gap: 16px;
}
.preview-item:last-child {
  border-bottom: none;
}
.preview-label {
  font-weight: 500;
  color: var(--clr-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.preview-value {
  font-weight: 600;
  color: var(--clr-text);
  font-size: 14px;
  text-align: right;
  word-break: break-word;
}

/* ── Pagination Controls ── */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: transparent;
  border-top: 1px solid var(--clr-border);
  border-radius: 0;
  margin-top: 0;
}
.pagination-info {
  font-size: 12px;
  font-weight: 500;
  color: var(--clr-text-muted);
}
.pagination-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--clr-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-page:hover:not(.disabled):not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.btn-page.active {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 600;
}
.btn-page.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
