/* ============================================================
   DocGen Pro — Main CSS
   Aesthetic: Refined dark editorial with glassy surfaces
   Font: Outfit (geometric sans) + JetBrains Mono
   ============================================================ */

:root {
  /* Core palette */
  --bg: #080810;
  --bg2: #0e0e1a;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --surface-solid: #13131f;
  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);

  /* Typography */
  --text: #f0f0f8;
  --text-2: #a0a0c0;
  --text-3: #606080;
  --text-inv: #0a0a14;

  /* Accents */
  --accent: #6366f1;
  --accent-glow: rgba(99,102,241,0.3);
  --accent-light: #818cf8;
  --green: #10b981;
  --red: #f43f5e;
  --amber: #f59e0b;
  --cyan: #06b6d4;
  --pink: #ec4899;

  /* Sidebar */
  --sidebar-w: 240px;
  --sidebar-bg: rgba(8,8,16,0.97);

  /* Radius */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.5);
  --shadow-accent: 0 8px 32px rgba(99,102,241,0.2);
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ─── Ambient Background ─────────────────────────────── */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  animation: float 20s ease-in-out infinite;
}
.orb-1 {
  width: 600px; height: 600px;
  background: #6366f1;
  top: -200px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: #ec4899;
  top: 40%; right: -150px;
  animation-delay: -8s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: #06b6d4;
  bottom: -100px; left: 30%;
  animation-delay: -15s;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-top {
  padding: 24px 16px 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

.brand-mark-sm {
  width: 30px; height: 30px;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-pro {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-light);
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 8px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--text);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--item-color, var(--accent));
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--surface);
}

.nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--item-color, var(--accent));
  margin-left: auto;
  box-shadow: 0 0 8px var(--item-color, var(--accent));
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.version-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.footer-note {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* ─── Mobile Header ──────────────────────────────────── */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(8,8,16,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 16px;
  height: 56px;
  align-items: center;
  justify-content: space-between;
}

.brand-mobile { font-size: 1.1rem; font-weight: 800; }
.brand-mobile span { color: var(--accent-light); }

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px; height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Main Wrap ──────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Page Hero ──────────────────────────────────────── */
.page-hero {
  padding: 48px 48px 40px;
  position: relative;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 48px; right: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-2); }
.breadcrumb-sep { opacity: 0.4; }

.page-hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.page-hero-left {}

.page-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-eyebrow::before {
  content: '';
  width: 20px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

.page-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
}

.page-title .title-accent {
  background: linear-gradient(135deg, var(--accent-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: var(--text-2);
  font-size: 0.95rem;
  margin-top: 8px;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Content Area ───────────────────────────────────── */
.page-content {
  padding: 32px 48px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Form Cards ─────────────────────────────────────── */
.form-section {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
}

.form-section:focus-within {
  border-color: var(--border-strong);
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.section-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

.form-section-subtitle {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 1px;
}

.form-section-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.form-section-toggle:hover { background: var(--surface); color: var(--text); }

.form-section-body {
  padding: 24px;
}

/* ─── Form Grid ──────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-full { grid-column: 1 / -1; }

/* ─── Form Controls ──────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.field label .required {
  color: var(--red);
  font-size: 0.7rem;
}

.input, .select-wrap select, .textarea {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
}

.input::placeholder, .textarea::placeholder {
  color: var(--text-3);
  font-weight: 300;
}

.input:hover, .select-wrap select:hover, .textarea:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

.input:focus, .select-wrap select:focus, .textarea:focus {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.input[readonly] {
  opacity: 0.6;
  cursor: default;
}

.textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-3);
  pointer-events: none;
}

.select-wrap select {
  cursor: pointer;
  padding-right: 32px;
}

.select-wrap select option {
  background: #13131f;
  color: var(--text);
}

input[type=date], input[type=month] {
  color-scheme: dark;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  opacity: 0.5;
}

/* ─── Input with prefix ──────────────────────────────── */
.input-group {
  display: flex;
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: all 0.2s;
}
.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.input-prefix {
  background: rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.07);
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-2);
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.input-group .input {
  border: none;
  border-radius: 0;
  flex: 1;
}
.input-group .input:focus { box-shadow: none; }

/* ─── Items Table ────────────────────────────────────── */
.items-wrapper { overflow-x: auto; }

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

.items-table thead th {
  background: rgba(255,255,255,0.04);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.items-table thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
.items-table thead th:last-child { border-radius: 0 var(--r-sm) 0 0; }

.items-table tbody tr {
  transition: background 0.15s;
}

.items-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.items-table tbody td {
  padding: 6px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.items-table .item-input {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  padding: 7px 10px;
  width: 100%;
  outline: none;
  transition: all 0.15s;
}

.items-table .item-input::placeholder { color: var(--text-3); font-weight: 300; font-size: 0.82rem; }

.items-table .item-input:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
}

.items-table .item-input:focus {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
}

.items-table .item-input[readonly] {
  opacity: 0.7;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.btn-row-delete {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin: auto;
}

.btn-row-delete:hover {
  background: rgba(244,63,94,0.15);
  color: var(--red);
}

.btn-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: transparent;
  border: 1.5px dashed rgba(255,255,255,0.1);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-row:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(99,102,241,0.05);
}

/* ─── Totals Panel ───────────────────────────────────── */
.totals-panel {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 20px;
}

.totals-adjustments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 220px;
}

.totals-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 16px 20px;
  min-width: 260px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.total-line:last-child { border: none; }

.total-line .amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.total-line.grand {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border-strong);
}

.total-line.grand .amount {
  font-size: 1.1rem;
  color: var(--accent-light);
}

/* ─── Earning / Deduction Cards ──────────────────────── */
.earn-ded-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.earn-card {
  background: rgba(16,185,129,0.04);
  border: 1px solid rgba(16,185,129,0.12);
  border-radius: var(--r);
  padding: 20px;
}

.ded-card {
  background: rgba(244,63,94,0.04);
  border: 1px solid rgba(244,63,94,0.12);
  border-radius: var(--r);
  padding: 20px;
}

.card-header-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.earn-card .card-header-label { color: var(--green); }
.ded-card .card-header-label { color: var(--red); }

.salary-field {
  margin-bottom: 12px;
}

.subtotal-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.earn-card .subtotal-pill {
  background: rgba(16,185,129,0.1);
  color: var(--green);
}

.ded-card .subtotal-pill {
  background: rgba(244,63,94,0.1);
  color: var(--red);
}

.subtotal-pill .pill-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
}

/* Net Pay Display */
.net-pay-display {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r-lg);
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.net-pay-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.net-pay-value {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--accent-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Outfit', sans-serif;
}

.net-pay-sub {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* ─── Challan Type Cards ─────────────────────────────── */
.challan-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.challan-type-card {
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: transparent;
  color: var(--text-2);
  font-family: 'Outfit', sans-serif;
  position: relative;
}

.challan-type-card:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.challan-type-card.selected {
  border-color: var(--cyan);
  background: rgba(6,182,212,0.08);
  color: var(--text);
}

.challan-type-card .ct-icon { font-size: 1.5rem; margin-bottom: 6px; display: block; }
.challan-type-card .ct-label { font-size: 0.8rem; font-weight: 600; }
.challan-type-card .ct-sub { font-size: 0.7rem; color: var(--text-3); margin-top: 2px; }

.challan-type-card .check {
  position: absolute;
  top: 8px; right: 8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  display: none;
  align-items: center;
  justify-content: center;
}

.challan-type-card.selected .check { display: flex; }
.check::after {
  content: '✓';
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
  position: relative;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}

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

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

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16,185,129,0.35);
}

.btn-danger {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.2);
  color: var(--red);
}

.btn-danger:hover { background: rgba(244,63,94,0.15); }

.btn-print {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 16px rgba(16,185,129,0.2);
}

.btn-print:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
}

/* ─── Dashboard Cards ────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.doc-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 26px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.doc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, var(--card-color-alpha, rgba(99,102,241,0.08)), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.doc-card:hover {
  border-color: var(--card-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.1);
}

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

.doc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.doc-card-icon {
  width: 50px; height: 50px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--glass-border);
}

.doc-card-arrow {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all 0.2s;
}

.doc-card:hover .doc-card-arrow {
  background: var(--card-color, var(--accent));
  border-color: transparent;
  color: white;
  transform: translate(2px, -2px);
}

.doc-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--card-color, var(--text-3));
  margin-bottom: 4px;
}

.doc-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.doc-card-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.doc-card-tag {
  font-size: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--text-3);
}

/* ─── Hero Stats ─────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

.stat-chip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.stat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-label { font-size: 0.78rem; color: var(--text-3); }
.stat-value { font-size: 1.3rem; font-weight: 700; }

/* ─── Toast ──────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 13px 18px;
  border-radius: var(--r);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 360px;
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.exit { animation: toastOut 0.3s forwards; }

@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ─── Preview Modal ──────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4,4,12,0.85);
  backdrop-filter: blur(12px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-backdrop.open { opacity: 1; pointer-events: all; }

.preview-modal {
  position: fixed;
  right: -100%;
  top: 0;
  bottom: 0;
  width: min(820px, 92vw);
  background: #fff;
  z-index: 201;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
  border-radius: 0;
}

.preview-modal.open { right: 0; }

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.preview-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}

.preview-modal-actions { display: flex; gap: 10px; align-items: center; }

.modal-close-btn {
  background: #e5e7eb;
  border: none;
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.15s;
}

.modal-close-btn:hover { background: #d1d5db; color: #111; }

.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  background: white;
}

/* ─── Print Document Styles (inside modal) ───────────── */
.doc-page {
  font-family: 'Outfit', sans-serif;
  color: #1a1a2e;
  font-size: 14px;
  max-width: 720px;
}

.doc-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px solid #1a1a2e;
}

.doc-company-name {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}

.doc-company-details {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.7;
  margin-top: 4px;
}

.doc-type-name {
  font-size: 26px;
  font-weight: 900;
  text-align: right;
  letter-spacing: -1px;
}

.doc-type-number {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.doc-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

.meta-block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
}

.meta-block-content {
  font-size: 13px;
  color: #374151;
  line-height: 1.7;
  font-style: normal;
}

.meta-block-content strong { color: #111827; font-weight: 700; }

.doc-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
}

.doc-items-table thead tr {
  background: #1a1a2e;
  color: white;
}

.doc-items-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.doc-items-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  color: #374151;
}

.doc-items-table tbody tr:nth-child(even) td { background: #f9fafb; }

.doc-totals-section {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 28px;
}

.doc-totals-box {
  min-width: 280px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  color: #6b7280;
}

.doc-total-row:last-child { border: none; }

.doc-total-row.final-row {
  background: #1a1a2e;
  color: white;
  font-weight: 700;
  font-size: 15px;
}

.doc-total-row .t-val { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.doc-notes-box {
  background: #f8f9fa;
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 28px;
  font-size: 12.5px;
  color: #4b5563;
  line-height: 1.6;
}

.doc-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 36px;
}

.sign-area {
  text-align: center;
  width: 180px;
}

.sign-line {
  border-top: 1px solid #9ca3af;
  padding-top: 8px;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 50px;
}

/* Salary Slip doc */
.slip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.slip-section { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.slip-section-title {
  background: #1a1a2e;
  color: white;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.slip-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.slip-row:last-child { border: none; }
.slip-row.total-row { background: #f9fafb; font-weight: 700; }
.slip-row .s-val { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.net-pay-banner {
  background: linear-gradient(135deg, #1a1a2e, #2d2d4e);
  color: white;
  border-radius: 10px;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.net-pay-tag { font-size: 11px; opacity: 0.6; letter-spacing: 2px; text-transform: uppercase; }
.net-pay-big { font-size: 30px; font-weight: 900; letter-spacing: -1px; margin-top: 4px; }

/* Challan doc */
.challan-wrapper {
  border: 2px solid #1a1a2e;
  border-radius: 10px;
  padding: 28px;
}

.challan-header-title {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}

.challan-separator {
  border: none;
  border-top: 2px dashed #d1d5db;
  margin: 16px 0;
}

.challan-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.challan-field {
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 6px;
}

.c-field-label { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; }
.c-field-value { font-size: 14px; font-weight: 600; color: #1a1a2e; margin-top: 3px; }

.challan-amount-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.ca-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 1px; }
.ca-value { font-size: 28px; font-weight: 900; color: #1a1a2e; letter-spacing: -1px; font-family: 'Outfit', sans-serif; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main-wrap { margin-left: 0; }
  .page-hero { padding: 28px 24px 24px; }
  .page-content { padding: 24px 24px 60px; }
  .earn-ded-grid { grid-template-columns: 1fr; }
  .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .doc-meta-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-title { font-size: 1.6rem; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2, .col-span-3 { grid-column: span 1; }
  .earn-ded-grid { grid-template-columns: 1fr; }
  .net-pay-display { flex-direction: column; text-align: center; }
  .net-pay-value { font-size: 2rem; }
  .preview-modal { width: 100vw; border-radius: var(--r-lg) var(--r-lg) 0 0; top: auto; height: 92vh; right: 0 !important; bottom: -100%; transition: bottom 0.4s; }
  .preview-modal.open { bottom: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .challan-fields-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Logo upload ────────────────────────────────────── */
.logo-drop {
  border: 1.5px dashed var(--glass-border);
  border-radius: var(--r-sm);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: transparent;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.logo-drop:hover { border-color: var(--accent); background: rgba(99,102,241,0.04); }

.logo-drop input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.logo-drop-text { font-size: 0.78rem; color: var(--text-3); }
.logo-preview-img { max-height: 48px; max-width: 150px; object-fit: contain; display: none; border-radius: 4px; }

/* ─── Section collapse animation ────────────────────── */
.collapsible-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* ─── Divider ────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 8px 0; }
