:root {
  --navy: #0f2138;
  --navy-2: #16324f;
  --gold: #a97a2f;
  --gold-light: #c99a4f;
  --maroon: #7a2331;
  --cream: #f6f3ec;
  --paper: #fffdf8;
  --ink: #22201b;
  --ink-soft: #5b5850;
  --line: #e2dccb;
  --ok: #2f6b46;
  --bad: #7a2331;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
}

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 36px 40px;
  width: 360px;
  box-shadow: 0 4px 24px rgba(15, 33, 56, 0.12);
}
.login-card h1 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--navy);
  font-size: 20px;
  margin: 0 0 4px;
}
.login-card .sub {
  color: var(--maroon);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.login-card label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 14px 0 4px;
}
.login-card input {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 14px;
  background: #fdfcf7;
}
.login-card button {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.login-card button:hover { background: var(--navy-2); }
.login-error {
  color: var(--bad);
  font-size: 12.5px;
  margin-top: 12px;
}

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  background: var(--cream);
  width: 250px;
  min-width: 250px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  padding: 22px 18px 2px;
}
.sidebar-sub {
  color: var(--maroon);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.nav-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  box-sizing: border-box;
}
.nav-btn:hover { background: #ece5d2; }
.nav-btn:disabled {
  color: #b6ada0;
  cursor: not-allowed;
}
.nav-btn:disabled:hover { background: transparent; }
.nav-editing-badge {
  margin: 0 16px 10px;
  padding: 6px 10px;
  background: #ece5d2;
  border-left: 3px solid var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow-wrap: break-word;
}
.nav-btn.active {
  background: var(--paper);
  border-left: 3px solid var(--gold);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.sidebar-spacer { flex: 1; }
.generate-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  margin: 16px;
  cursor: pointer;
}
.generate-btn:hover { background: var(--navy-2); }
.logout-link {
  display: block;
  text-align: center;
  color: var(--ink-soft);
  font-size: 11px;
  padding-bottom: 14px;
  text-decoration: none;
}
.logout-link:hover { color: var(--maroon); }

.main { flex: 1; padding: 28px 32px; overflow-y: auto; max-height: 100vh; }
.page-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2px;
}
.page-subtitle {
  color: var(--ink-soft);
  font-size: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px 20px;
  margin-bottom: 18px;
  max-width: 900px;
}
.card h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 12px;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fdfcf7;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

.btn {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 3px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: #eaeef3; }
.btn-remove {
  background: #fff;
  color: var(--maroon);
  border: 1px solid #ddb9bd;
  border-radius: 3px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-remove:hover { background: #f1e0e2; }
.btn-new-report {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 16px 34px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
}
.btn-new-report:hover { background: var(--navy-2); }
.btn-home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2f6fed, #1c4fc4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(28, 79, 196, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-home-icon:hover {
  background: linear-gradient(160deg, #3d7cff, #2158d6);
  box-shadow: 0 5px 14px rgba(28, 79, 196, 0.45);
  transform: translateY(-1px);
}
.btn-home-icon:active { transform: translateY(0); }

table.data-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.data-table th {
  background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 600;
  padding: 7px; text-align: center; text-transform: uppercase;
}
table.data-table td {
  border: 1px solid var(--line); padding: 4px;
}
table.data-table td input {
  border: none; background: transparent; width: 100%; padding: 5px; font-size: 12.5px;
}
table.data-table td input:focus { outline: 1px solid var(--gold); }

/* CPV numbered verification table */
.cpv-table { border: 1px solid var(--line); border-radius: 4px; background: var(--paper); overflow: hidden; }
.cpv-row { display: grid; grid-template-columns: 34px 250px 1fr; border-bottom: 1px solid var(--line); }
.cpv-row:last-child { border-bottom: none; }
.cpv-row:nth-child(even) { background: #faf6ea; }
.cpv-num { padding: 8px 6px; font-family: Consolas, monospace; font-size: 10.5px; color: var(--gold); border-right: 1px solid var(--line); text-align: center; }
.cpv-label { padding: 7px 10px; font-size: 11.5px; font-weight: 600; color: var(--navy-2); border-right: 1px solid var(--line); display: flex; align-items: center; }
.cpv-value { padding: 5px 8px; }
.cpv-value input, .cpv-value textarea {
  border: none; background: transparent; width: 100%; font-size: 12.5px; color: var(--ink); padding: 2px 0; font-family: inherit;
}
.cpv-value textarea { min-height: 34px; resize: vertical; }
.cpv-picks { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.cpv-pick { color: var(--ink-soft); font-size: 10.5px; cursor: pointer; text-decoration: underline; }

/* Simple vertical label/value table - matches the firm's PAN Verification report page */
.kv-table { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--paper); }
.kv-row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: none; }
.kv-label { background: #eef2f7; padding: 13px 16px; font-size: 12.5px; font-weight: 700; color: var(--navy); display: flex; align-items: center; }
.kv-value { padding: 8px 16px; display: flex; align-items: center; }
.kv-value input, .kv-value select {
  border: none; background: transparent; width: 100%; font-size: 13px; font-weight: 700;
  color: var(--ink); font-family: inherit; padding: 4px 0;
}
.cpv-sep { color: var(--line); font-size: 10.5px; }

/* Right-hand state tabs - GSTIN Verification / GST Returns, one tab per
   state's GST registration, matching the firm's per-state report layout. */
.state-tabs-layout { display: flex; gap: 16px; align-items: flex-start; }
.state-tabs-content { flex: 1; min-width: 0; }
.state-tabs { display: flex; flex-direction: column; gap: 6px; width: 190px; flex-shrink: 0; }
.state-tab {
  text-align: left; padding: 10px 12px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--paper); color: var(--navy); font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.state-tab:hover { border-color: var(--gold); }
.state-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.state-tab-sub { font-size: 10.5px; font-weight: 500; opacity: .8; margin-top: 2px; }
.state-tab-add {
  text-align: center; padding: 10px 12px; border-radius: 5px; border: 1px dashed var(--gold);
  background: transparent; color: var(--gold); font-size: 12px; font-weight: 700; cursor: pointer;
}
.state-tab-add:hover { background: #faf3e6; }
@media (max-width: 760px) {
  .state-tabs-layout { flex-direction: column; }
  .state-tabs { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .state-tab, .state-tab-add { flex: 1; min-width: 120px; }
}

.upload-bar {
  background: var(--navy); color: #fff; border-radius: 5px; padding: 12px 22px;
  min-height: 50px; display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
.upload-bar:hover { background: var(--navy-2); }
.upload-bar .title { font-size: 17px; font-weight: 700; }
.upload-bar .subtitle { color: var(--gold-light); font-size: 11.5px; font-weight: 500; }

.doctype-select {
  border: none; border-bottom: 2px solid var(--navy); background: transparent;
  font-size: 19px; font-weight: 700; color: var(--navy); padding: 4px 4px 10px 2px; width: 100%;
}
.doctype-select:focus { outline: none; border-bottom-color: var(--gold); }

.extract-btn {
  background: var(--gold); color: #fff; border: none; border-radius: 5px;
  padding: 13px; font-size: 15px; font-weight: 700; letter-spacing: 1px; width: 100%; cursor: pointer;
}
.extract-btn:hover { background: var(--gold-light); }
.extract-btn:disabled { background: #d8d2c4; color: #8a8577; cursor: not-allowed; }

.log-item {
  padding: 8px 10px; border-radius: 3px; margin-top: 8px;
  border: 1px solid var(--line); font-size: 11.5px; line-height: 1.5;
}
.log-item.ok { border-color: #bcdcc7; background: #f2faf5; }
.log-item.warn { border-color: #f0d3ac; background: #fdf6ec; }

.activity-selector { max-width: 520px; margin: 40px auto; padding: 0 20px; }
.activity-tiles { display: flex; flex-direction: column; gap: 16px; }
.activity-tile {
  background: var(--navy); border: none; border-radius: 8px; color: #fff;
  padding: 22px 22px; cursor: pointer; transition: background .15s, box-shadow .15s;
  position: relative; text-align: center; text-decoration: none; display: block;
}
.activity-tile:hover { background: var(--navy-2); box-shadow: 0 3px 14px rgba(15,33,56,0.18); }
.activity-tile.disabled { cursor: not-allowed; opacity: 0.55; }
.activity-tile-title {
  font-size: 16px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  color: #fff; margin-bottom: 5px;
}
.activity-tile-sub { color: rgba(255,255,255,0.72); font-size: 12px; line-height: 1.5; }
.activity-tile-badge {
  display: inline-block; margin-top: 12px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--navy);
  background: var(--cream); border-radius: 3px; padding: 3px 8px;
}
.admin-section { margin-top: 36px; }
.admin-section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 12px;
}
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.admin-tile {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px;
  padding: 14px; cursor: pointer; text-align: center; font-weight: 700; font-size: 13px;
  color: var(--navy); transition: border-color .15s;
}
.admin-tile:hover { border-color: var(--gold); }

.hint { color: var(--ink-soft); font-size: 11.5px; margin: 8px 0; }
.status-ok { color: var(--ok); font-size: 12px; font-weight: 600; }
.status-bad { color: var(--bad); font-size: 12px; font-weight: 600; }

.stamp-preview {
  width: 100%; height: 180px; border: 1px dashed var(--line); border-radius: 4px;
  background: #fdfcf5; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 12px; overflow: hidden;
}
.stamp-preview img { max-width: 100%; max-height: 100%; }

.preview-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 18px;
  font-family: Georgia, 'Times New Roman', serif; max-width: 900px;
}
.preview-box h2 { color: var(--navy); margin-bottom: 0; }
.preview-box h3 { color: var(--navy); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 33, 56, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-card {
  background: var(--paper); border-radius: 6px; padding: 26px 28px; width: 440px;
  max-width: 90vw; box-shadow: 0 8px 32px rgba(15, 33, 56, 0.25);
}
.modal-card h2 {
  font-family: Georgia, 'Times New Roman', serif; color: var(--navy); font-size: 18px; margin: 0 0 16px;
}
