/* ============================================================
   SLtaxes calc — Global Stylesheet
   Design: Deep Navy + Amber + clean whites (Matches Calculator UI)
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --navy:       #1e3a5f;
  --navy-dim:   #152d4a;
  --amber:      #f59e0b;
  --amber-dim:  #d97706;
  --emerald:    #10b981;
  --rose:       #ef4444;
  --sky:        #0ea5e9;
  --bg:         #f8fafc;
  --bg-2:       #ffffff;
  --bg-3:       #f1f5f9;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 20px rgba(0,0,0,.1);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.15);
  --radius:     12px;
  --radius-sm:  8px;
  --transition: .18s ease;
  --font:       'Inter', system-ui, sans-serif;
  --danger:     #ef4444;
  --success:    #10b981;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, select { font-family: var(--font); }

/* ── Disclaimer ──────────────────────────────────────────── */
.disclaimer-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: .78rem;
  padding: .5rem 1.5rem;
  text-align: center;
  line-height: 1.6;
}
.disclaimer-bar strong { color: #78350f; }
.disclaimer-bar a { color: var(--sky); font-weight: 500; }

/* ── Header (Unified with Calculator) ───────────────────── */
.hdr {
  background: var(--navy);
  color: #fff;
  border-bottom: none;
  box-shadow: var(--shadow);
}
.hdr-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
}
.hdr--compact { padding-bottom: 1rem; }
.hdr--admin   { background: #152d4a; border-bottom: 2px solid var(--amber); }

.gov-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.badge {
  background: var(--amber);
  color: #78350f;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 4px;
}
.badge--admin { background: var(--rose); color: #fff; }
.gov-label { font-size: .8rem; color: rgba(255,255,255,.7); }

.site-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
  line-height: 1.1;
}
.site-title em {
  color: var(--amber);
  font-style: normal;
}
.admin-label { color: rgba(255,255,255,.7); font-weight: 400; font-size: 1.2rem; }

.site-desc { color: rgba(255,255,255,.8); margin-top: .35rem; font-size: .95rem; }

/* Top nav */
.top-nav {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
}
.nav-link {
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  padding: .35rem .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
  font-weight: 500;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
  text-decoration: none;
}
.nav-link.active {
  color: var(--amber);
  background: rgba(245,158,11,.15);
}

/* Meta stats strip */
.meta-row {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 1rem;
  display: flex;
  gap: 2rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}
.meta-cell {}
.meta-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.meta-val   { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin-top: .1rem; }

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
  max-width: 1100px;
  margin: 1.5rem auto .75rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-wrap { flex: 1; min-width: 180px; position: relative; }
.search-wrap input,
.field-input {
  width: 100%;
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  padding: .65rem 1.25rem;
  font-size: .95rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input { border-radius: var(--radius-sm); }
.search-wrap input:focus,
.field-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,95,.1); }

.filter-btns { display: flex; gap: .4rem; }
.fbtn {
  padding: .45rem 1rem;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.fbtn:hover { border-color: var(--navy); background: var(--bg-3); }
.fbtn.active { border-color: var(--navy); background: var(--navy); color: #fff; }

/* ── Results bar ─────────────────────────────────────────── */
.results-bar {
  max-width: 1100px;
  margin: 0 auto .75rem;
  padding: 0 1.5rem;
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Section cards grid ──────────────────────────────────── */
.grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--navy);
  box-shadow: var(--shadow);
}
.card-num {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber-dim);
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
  line-height: 1.4;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .25rem;
}
.card-docs  { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.card-arrow { color: var(--sky); font-size: 1rem; transition: transform var(--transition); }
.card:hover .card-arrow { transform: translateX(4px); color: var(--navy); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-weight: 500;
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────
   SEARCH PAGE
   ───────────────────────────────────────────────────────── */
.search-hero {
  max-width: 800px;
  margin: 2.5rem auto 1.5rem;
  padding: 0 1.5rem;
  text-align: center;
}
.search-hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: .4rem; color: var(--navy); letter-spacing: -.03em; }
.search-hero-sub   { color: var(--text-muted); font-size: 1rem; margin-bottom: 1.25rem; }

.search-bar-wrap {
  display: flex;
  gap: .5rem;
  position: relative;
}
.search-main-input {
  flex: 1;
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  padding: .8rem 1.5rem;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-main-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(30,58,95,.1); }
.search-btn {
  padding: .8rem 1.8rem;
  background: var(--amber);
  color: #78350f;
  font-weight: 800;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  transition: background var(--transition), transform var(--transition);
}
.search-btn:hover { background: var(--amber-dim); transform: translateY(-1px); }

.modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.mode-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.mode-toggle input[type="checkbox"] { accent-color: var(--navy); width: 16px; height: 16px; }

/* History */
.history-panel {
  max-width: 1100px;
  margin: 0 auto .75rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.history-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.history-chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.history-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.history-chip:hover { border-color: var(--navy); color: var(--navy); }
.history-clear {
  font-size: .75rem;
  font-weight: 600;
  color: var(--danger);
  background: none;
  border: none;
  white-space: nowrap;
}

/* Filter bar */
.filter-bar {
  max-width: 1100px;
  margin: 0 auto .75rem;
  padding: .6rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.filter-bar-left, .filter-bar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.filter-bar select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .35rem .65rem;
  font-size: .85rem;
}
.filter-chk { font-size: .85rem; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: .35rem; }
.filter-chk input { accent-color: var(--navy); }
.result-meta { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.btn-export {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--navy);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: .35rem .8rem;
  font-size: .82rem;
  transition: var(--transition);
}
.btn-export:hover { border-color: var(--navy); background: #e0f2fe; }

/* Results list */
.results-list {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Result card */
.result-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.result-card:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.result-card.open  { border-color: var(--navy); }

.result-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  flex-wrap: wrap;
}
.result-hs {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--navy);
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: .25rem .65rem;
  border-radius: 4px;
  white-space: nowrap;
}
.result-desc {
  flex: 1;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rate-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.rate-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 4px;
  border: 1px solid;
}
.rate-badge--cd   { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.rate-badge--pal  { color: #7c3aed; border-color: #c4b5fd; background: #f5f3ff; }
.rate-badge--vat  { color: #0369a1; border-color: #93c5fd; background: #eff6ff; }
.rate-badge--cess { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.rate-badge--reg  { color: var(--gold); border-color: var(--gold); background: #fffbeb; }

.compare-toggle {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: .35rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.compare-toggle:hover    { border-color: var(--navy); color: var(--navy); }
.compare-toggle.selected { border-color: var(--amber); background: var(--amber); color: #78350f; }

/* Detail panel */
.result-detail {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--bg-3);
}
.result-card.open .result-detail { display: flex; }

.detail-section-title {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .6rem;
  opacity: 0.8;
}

/* CIF calculator */
.calc-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  background: var(--bg-2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.calc-label { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.cif-input {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .45rem .75rem;
  width: 160px;
  font-size: .95rem;
}
.cif-input:focus { outline: none; border-color: var(--navy); }
.btn-calc {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 700;
  transition: background var(--transition);
}
.btn-calc:hover { background: var(--navy-dim); }

.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tax-table th {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  background: #f8fafc;
}
.tax-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
}
.tax-table tr:last-child td { border-bottom: none; font-weight: 800; color: var(--navy); background: #f8fafc;}

/* Preferential rates */
.pref-table { font-size: .85rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pref-table td { padding: .4rem .75rem; border-bottom: 1px solid var(--border); }
.pref-table tr:last-child td { border-bottom: none; }
.pref-table td:first-child { color: var(--navy); font-weight: 700; width: 80px; }

/* Regulatory badges */
.reg-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.reg-badge {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #b45309;
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 700;
}

/* Detail action buttons */
.detail-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-action {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: .4rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-action:hover { border-color: var(--navy); background: var(--bg-3); }

/* Compare panel */
.compare-panel {
  max-width: 1100px;
  margin: 0 auto .75rem;
  padding: 0 1.5rem;
}
.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1.25rem;
  background: var(--navy);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
}
.compare-header button {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  color: #fff;
  font-size: .85rem;
}
.compare-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.compare-col { padding: 1.25rem; background: var(--bg-2); }
.compare-col + .compare-col { border-left: 1px solid var(--border); }
.compare-col-title { font-weight: 800; margin-bottom: .75rem; font-size: .95rem; color: var(--navy); }
.compare-row {
  display: flex;
  justify-content: space-between;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.compare-row:last-child { border-bottom: none; font-weight: 800; color: var(--navy); font-size: 1rem; }
.compare-row span:first-child { color: var(--text-muted); font-weight: 500; }

/* ─────────────────────────────────────────────────────────
   ADMIN PAGE
   ───────────────────────────────────────────────────────── */
.admin-wrap {
  max-width: 900px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.admin-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.admin-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--bg-3);
}
.field-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.field-row input { flex: 1; min-width: 200px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.form-label .field-input { margin-top: .1rem; }
.upload-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--amber);
  color: #78350f;
  border: none;
  border-radius: var(--radius-sm);
  padding: .65rem 1.4rem;
  font-size: .95rem;
  font-weight: 800;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--amber-dim); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.progress-wrap { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 180px; }
.progress-bar  { flex: 1; height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--emerald); width: 0; transition: width .3s ease; border-radius: 4px; }
.progress-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.upload-result { margin-top: 1rem; font-size: .9rem; font-weight: 600; }
.upload-result.ok  { color: var(--emerald); }
.upload-result.err { color: var(--rose); }
.auth-msg { font-size: .85rem; font-weight: 600; margin-top: .5rem; }
.auth-msg.ok  { color: var(--emerald); }
.auth-msg.err { color: var(--rose); }

/* Batch table */
.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.batch-table th {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
}
.batch-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); font-weight: 500; }
.batch-table tr:last-child td { border-bottom: none; }
.status-pill {
  display: inline-block;
  border-radius: 20px;
  padding: .2rem .65rem;
  font-size: .72rem;
  font-weight: 800;
}
.status-pill.active   { background: #ecfdf5; color: var(--emerald); border: 1px solid #6ee7b7; }
.status-pill.inactive { background: #fef2f2; color: var(--rose);    border: 1px solid #fca5a5; }
.btn-toggle {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-toggle:hover { border-color: var(--navy); background: var(--bg-3); }
.muted { color: var(--text-muted); font-size: .9rem; font-weight: 500; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .meta-row     { gap: 1rem; flex-wrap: wrap; }
  .toolbar      { flex-direction: column; align-items: stretch; }
  .filter-btns  { justify-content: flex-start; flex-wrap: wrap; }
  .compare-body { grid-template-columns: 1fr; }
  .compare-col + .compare-col { border-left: none; border-top: 1px solid var(--border); }
  .filter-bar   { flex-direction: column; align-items: flex-start; }
}
