/* ============================================================
   TU IA — Styles
   Theme: Black & White Minimalist | Font: Arial
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #000000;
  --white:   #ffffff;
  --grey-1:  #f5f5f5;
  --grey-2:  #e0e0e0;
  --grey-3:  #999999;
  --grey-4:  #555555;
  --radius:  4px;
  --font:    Arial, Helvetica, sans-serif;
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  border-bottom: 2px solid var(--black);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.tagline {
  font-size: 0.8rem;
  color: var(--grey-4);
  letter-spacing: 0.5px;
}
.trial-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  border: 1.5px solid var(--black);
  padding: 2px 8px;
  border-radius: var(--radius);
}

/* ── Main ── */
main {
  flex: 1;
  padding: 32px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* ── Upload Card ── */
.upload-card {
  border: 1.5px solid var(--black);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  margin: 0 auto;
}

#drop-zone {
  border: 2px dashed var(--grey-2);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
#drop-zone.drag-over { border-color: var(--black); }
#drop-zone svg { display: block; margin: 0 auto 16px; color: var(--grey-3); }
.drop-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.drop-sub   { font-size: 0.8rem; color: var(--grey-3); margin-bottom: 20px; }

.btn-upload {
  display: inline-block;
  border: 1.5px solid var(--black);
  padding: 8px 20px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  background: var(--white);
  transition: background 0.15s, color 0.15s;
}
.btn-upload:hover { background: var(--black); color: var(--white); }
#file-input { display: none; }

/* File list */
#file-list {
  list-style: none;
  margin-top: 16px;
}
#file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--grey-2);
  font-size: 0.85rem;
}
#file-list li:last-child { border-bottom: none; }
#file-list .file-name { font-weight: 600; }
#file-list .file-size { color: var(--grey-3); font-size: 0.75rem; }
#file-list .file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--grey-3);
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
}
#file-list .file-remove:hover { color: var(--black); }

/* Primary button */
.btn-primary {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { opacity: 0.8; }

/* Disclaimer */
.disclaimer {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--grey-3);
  line-height: 1.5;
  text-align: center;
}

/* ── Dashboard ── */
#dashboard { margin-top: 0; }

/* Tab Nav */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--black);
  margin-bottom: 24px;
  gap: 0;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  color: var(--grey-4);
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover  { color: var(--black); }
.tab-btn.active { color: var(--black); border-bottom-color: var(--black); }

/* Tab Panels */
.tab-panel { display: block; }
.tab-panel.hidden { display: none; }

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  border: 1.5px solid var(--black);
  border-radius: var(--radius);
  padding: 20px 16px;
}
.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--grey-4);
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
}
.kpi-sub {
  font-size: 0.72rem;
  color: var(--grey-3);
  margin-top: 4px;
}

/* Account summary */
#overview-accounts {
  margin-top: 8px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-2);
  font-size: 0.85rem;
}
.account-row:last-child { border-bottom: none; }
.account-name { font-weight: 600; }
.account-meta { color: var(--grey-3); font-size: 0.75rem; }

/* ── Tables ── */
.table-toolbar {
  margin-bottom: 12px;
}
.table-toolbar input {
  width: 100%;
  max-width: 360px;
  padding: 8px 12px;
  border: 1.5px solid var(--grey-2);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}
.table-toolbar input:focus { border-color: var(--black); }

.table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--grey-2);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
thead th {
  background: var(--black);
  color: var(--white);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--grey-2); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--grey-1); }
tbody td {
  padding: 9px 12px;
  vertical-align: middle;
}
.amount-debit  { color: #c00; font-weight: 600; }
.amount-credit { color: #060; font-weight: 600; }
.text-right { text-align: right; }
.text-mono  { font-family: 'Courier New', monospace; }

/* ── Charts ── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.chart-box {
  border: 1.5px solid var(--grey-2);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-box h3 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

/* ── Tax Panel ── */
#tax-content { margin-bottom: 24px; }
.tax-section {
  border: 1.5px solid var(--grey-2);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.tax-section-header {
  background: var(--grey-1);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--grey-2);
}
.tax-section-body {
  padding: 16px;
  font-size: 0.85rem;
  line-height: 1.7;
}
.tax-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--grey-2);
}
.tax-row:last-child { border-bottom: none; }
.tax-label { color: var(--grey-4); }
.tax-value { font-weight: 700; }

/* ── Export ── */
.export-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.btn-export {
  padding: 12px 24px;
  border: 1.5px solid var(--black);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-export:hover { background: var(--black); color: var(--white); }

/* ── Processing Overlay ── */
#processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
#processing-overlay.hidden { display: none; }
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--grey-2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#processing-msg {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--grey-4);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--grey-2);
  padding: 14px 24px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--grey-3);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
  main { padding: 20px 14px; }
  .upload-card { padding: 20px 14px; }
  .tab-btn { padding: 10px 12px; font-size: 0.78rem; }
  .kpi-value { font-size: 1.1rem; }
}