:root {
  --ink: #202329; --muted: #6f737b; --line: #e5e0da; --paper: #fffdf9;
  --canvas: #f5f2ed; --orange: #e55a25; --orange-dark: #bd381d; --red: #b9272f;
  --green: #16745a; --teal: #176b72; --shadow: 0 18px 50px rgba(62, 42, 24, .09);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background-color: var(--canvas); background-image: radial-gradient(#d9d3ca 0.7px, transparent 0.7px); background-size: 18px 18px; font: 15px/1.5 "DM Sans", sans-serif; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin-top: 0; }
h1, h2, .brand { font-family: "Manrope", sans-serif; letter-spacing: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
h2 { margin-bottom: 7px; font-size: 21px; }
.muted, .page-heading p { color: var(--muted); }
.eyebrow { margin-bottom: 7px; color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hidden { display: none !important; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: rgba(255, 253, 249, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-weight: 800; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; position: relative; display: grid; place-items: center; overflow: hidden; color: white; background: var(--orange); border-radius: 8px 8px 8px 2px; box-shadow: inset -10px -8px 0 var(--red); font: 800 18px/1 "Manrope", sans-serif; }
.brand-mark.large { width: 58px; height: 58px; margin-bottom: 28px; font-size: 27px; }
.account { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.account form { display: flex; margin-left: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #dff0e9; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white; cursor: pointer; }
.icon-button svg { width: 17px; }
.workspace { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 50px 0 72px; }
.page-heading, .section-heading, .progress-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading { margin-bottom: 30px; }
.page-heading p:last-child { margin-bottom: 0; }
.primary, .secondary { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 6px; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary { border: 1px solid var(--orange-dark); color: white; background: var(--orange); box-shadow: 0 5px 14px rgba(185, 39, 47, .17); }
.primary:hover { background: var(--orange-dark); }
.primary:disabled { opacity: .6; cursor: wait; }
.primary svg, .secondary svg { width: 17px; }
.primary .lucide-loader-circle { animation: spin 1s linear infinite; }
.secondary { border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
.secondary:hover { border-color: #cfc5ba; background: white; }
.wide { width: 100%; margin-top: 4px; }
.search-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.search-panel { min-width: 0; padding: 0 34px 32px; }
.tabs { height: 65px; display: flex; gap: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 2px; border: 0; color: var(--muted); background: transparent; font-weight: 700; cursor: pointer; }
.tab svg { width: 17px; }
.tab.active { color: var(--orange-dark); }
.tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--orange); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: reveal .28s ease-out; }
.field-heading { display: flex; justify-content: space-between; margin-bottom: 9px; font-weight: 700; }
.field-heading span { color: var(--muted); font-size: 13px; font-weight: 500; }
.field-heading .over-limit { color: var(--red); font-weight: 700; }
textarea, input { width: 100%; border: 1px solid #d8d1c8; border-radius: 6px; color: var(--ink); background: white; outline: none; }
textarea { min-height: 170px; padding: 14px 15px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.8; }
textarea:focus, input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(229, 90, 37, .11); }
.field-help { margin: 7px 0 18px; color: var(--muted); font-size: 12px; }
.format-panel { padding: 34px; background: #292b30; color: white; }
.format-panel .eyebrow { color: #ff9b75; }
.format-panel h2 { margin-bottom: 22px; font-size: 19px; }
.mini-sheet { display: grid; grid-template-columns: 65px 1fr; margin-bottom: 25px; border: 1px solid #51535a; font: 12px/1.2 ui-monospace, monospace; }
.mini-sheet > * { padding: 10px; border-right: 1px solid #51535a; border-bottom: 1px solid #51535a; overflow: hidden; }
.mini-sheet > :nth-child(2n) { border-right: 0; }
.mini-sheet > :nth-last-child(-n+2) { border-bottom: 0; }
.mini-sheet div { color: #ffb18f; background: #35373d; font-weight: 700; }
.rule-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; color: #d1d3d7; font-size: 13px; }
.rule-list li { display: flex; align-items: center; gap: 9px; }
.rule-list svg { width: 16px; color: #ff9b75; }
.dropzone { min-height: 187px; display: grid; place-items: center; align-content: center; gap: 7px; margin-bottom: 18px; border: 1px dashed #cdbfb2; border-radius: 6px; background: #faf6f0; cursor: pointer; }
.dropzone:hover { border-color: var(--orange); background: #fff8f3; }
.dropzone > svg { width: 30px; height: 30px; margin-bottom: 5px; color: var(--orange); }
.dropzone span { max-width: 85%; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.progress-section, .results-section { margin-top: 24px; padding: 27px 30px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); animation: reveal .35s ease-out; }
.progress-header { align-items: center; }
.progress-header h2, .section-heading h2 { margin-bottom: 0; }
.progress-header > strong { font: 800 22px/1 "Manrope", sans-serif; }
.progress-track { height: 8px; margin: 22px 0; overflow: hidden; background: #eae4dd; border-radius: 2px; }
.progress-track div { width: 0; height: 100%; background: linear-gradient(90deg, var(--orange), var(--red)); transition: width .45s ease; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.metrics div { display: flex; align-items: baseline; gap: 8px; padding: 12px 15px; background: var(--paper); }
.metric { font: 800 20px/1 "Manrope", sans-serif; }
.metric.success { color: var(--green); }.metric.error { color: var(--red); }
.metrics small { color: var(--muted); }
.section-heading { align-items: center; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 870px; border-collapse: collapse; background: white; }
th { padding: 11px 14px; color: var(--muted); background: #f6f2ed; font-size: 11px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 14px; border-top: 1px solid #eee9e3; vertical-align: top; font-size: 13px; }
td strong, td small { display: block; }
td small { max-width: 250px; margin-top: 4px; color: var(--muted); }
.gstin, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
code { padding: 3px 6px; border-radius: 3px; color: var(--teal); background: #e9f2f2; font-size: 12px; }
.badge { width: fit-content; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.badge svg { width: 13px; height: 13px; }
.badge.success { color: var(--green); background: #e3f2ec; }.badge.error { color: var(--red); background: #fae7e6; }.badge.pending { color: #765b21; background: #f8efda; }
.empty-row td { height: 190px; text-align: center; vertical-align: middle; color: var(--muted); }
.empty-row svg, .empty-row strong, .empty-row span { display: block; margin: 5px auto; }
.empty-row svg { width: 28px; color: #b6aea5; }
.empty-row strong { color: var(--ink); }
.alert { margin-bottom: 18px; padding: 11px 13px; border-left: 3px solid; font-size: 13px; }
.alert.error { color: #851d25; border-color: var(--red); background: #fae7e6; }.alert.success { color: #0d5b44; border-color: var(--green); background: #e3f2ec; }.alert.warning { color: #714d0c; border-color: #d28a16; background: #fcf1da; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background-color: #2b2c31; background-image: linear-gradient(115deg, rgba(229,90,37,.12), transparent 45%), radial-gradient(#4a4b50 0.8px, transparent 0.8px); background-size: auto, 20px 20px; }
.auth-shell { width: min(1000px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid #4b4b4e; background: var(--paper); box-shadow: 0 35px 80px rgba(0,0,0,.25); }
.auth-brand { padding: 70px; color: white; background: #292b30; }
.auth-brand h1 { max-width: 540px; margin-bottom: 24px; font-size: clamp(38px, 5vw, 61px); }
.auth-copy { max-width: 470px; color: #bec0c5; font-size: 17px; }
.signal-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 50px; }
.signal-row span { padding: 6px 9px; border-left: 2px solid var(--orange); color: #d6d7da; background: #35373d; font-size: 11px; text-transform: uppercase; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 60px 50px; }
.auth-panel h2 { font-size: 29px; }
.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.stack-form label { display: grid; gap: 7px; font-weight: 700; }
.stack-form input { height: 44px; padding: 9px 11px; }
.mobile-brand { display: none; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .workspace { width: min(100% - 24px, 600px); padding-top: 30px; }
  .topbar { padding: 0 16px; }.account > span:not(.status-dot) { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }.page-heading .secondary { width: 100%; }
  .search-layout { grid-template-columns: 1fr; }.search-panel { padding: 0 20px 24px; }.format-panel { padding: 26px 20px; }
  .progress-section, .results-section { padding: 22px 16px; }.metrics div { display: grid; gap: 5px; }.metrics small { font-size: 11px; }
  .section-heading { align-items: flex-start; flex-direction: column; }.section-heading .secondary { width: 100%; }
  .auth-page { padding: 0; background: var(--paper); }.auth-shell { min-height: 100vh; display: block; border: 0; }.auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 36px 24px; }.mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 70px; font: 800 18px "Manrope", sans-serif; }
}