/* Tax Portal — plain CSS design system (ported from the Tailwind/shadcn UI) */

:root {
  --background: #f8fafc;
  --foreground: #0f1729;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --primary: #0f1729;
  --destructive: #dc2626;
  --amber: #fbbf24;
  --amber-ink: #0f1729;
  --emerald: #059669;
  --sidebar-bg: #0f1729;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Layout */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--muted);
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.page-body {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sidebar */
.sidebar {
  width: 256px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: #f1f5f9;
  height: 100%;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.7);
  color: var(--amber);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

.brand-tagline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  transition: background-color 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--amber);
}

.nav-index {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #64748b;
}

.nav-item.active .nav-index {
  color: rgba(251, 191, 36, 0.7);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 24px;
  font-size: 12px;
  color: #94a3b8;
}

.sidebar-footer p { margin: 0 0 2px; }
.sidebar-footer strong { color: #f1f5f9; font-weight: 600; }

.sidebar-account {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  position: relative;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  padding: 24px 32px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.page-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.card-header {
  padding: 20px 24px 4px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-header-text h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.card-header-text p {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 4px 0 0;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-content { padding: 16px 0; }
.card-content-pad { padding: 16px 24px; }

.card-note {
  padding: 16px 24px 4px;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
  margin: 0;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 8px 0 0;
}

.stat-meta-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-meta {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Tables */
table.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  padding: 12px 16px;
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.data-table .pl { padding-left: 24px; }
.data-table .pr { padding-right: 24px; }
.data-table .empty-row td {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted-foreground);
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-filed { background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1px rgba(5,150,105,0.2); }
.badge-pending { background: #fffbeb; color: #b45309; box-shadow: inset 0 0 0 1px rgba(180,83,9,0.2); }
.badge-partial { background: #f0f9ff; color: #0369a1; box-shadow: inset 0 0 0 1px rgba(3,105,161,0.2); }
.badge-not-started { background: var(--muted); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); }
.badge-submitted { background: #059669; color: #fff; box-shadow: inset 0 0 0 1px rgba(4,120,87,0.3); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
  line-height: 1.3;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1c2942; }

.btn-amber { background: var(--amber); color: var(--amber-ink); }
.btn-amber:hover:not(:disabled) { background: #f5c451; }

.btn-outline { background: var(--card); color: var(--foreground); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--muted); }

.btn-emerald { background: #059669; color: #fff; }
.btn-emerald:hover:not(:disabled) { background: #047857; }

.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover:not(:disabled) { background: #b91c1c; }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* Forms */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="file"],
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--card);
  color: var(--foreground);
}

.field input:focus, .field select:focus {
  outline: 2px solid rgba(15, 23, 41, 0.15);
  border-color: var(--primary);
}

.field-hint { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; }
.field-error { font-size: 13px; color: var(--destructive); margin: 8px 0; }
.field-prefix { position: relative; }
.field-prefix span {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--muted-foreground);
  pointer-events: none;
}
.field-prefix input { padding-left: 40px !important; }

.password-field { position: relative; }
.password-field input { padding-right: 36px !important; }
.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
}

/* Tabs / pills */
.tab-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tab-trigger {
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-trigger.active { border-color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.tab-trigger.submitted { border-color: rgba(16,185,129,0.4); background: #ecfdf5; }
.tab-trigger .tab-title { font-size: 14px; font-weight: 600; }
.tab-trigger .tab-title .muted { font-weight: 400; color: var(--muted-foreground); }
.tab-trigger .tab-status { font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted-foreground); }
.tab-trigger.submitted .tab-status { color: #047857; }

.month-pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.month-pill {
  min-width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 8px 12px;
  text-align: center;
  cursor: pointer;
  color: var(--foreground);
}
.month-pill:hover { border-color: rgba(15,23,41,0.2); }
.month-pill.active { border-color: transparent; background: var(--sidebar-bg); color: #fff; }
.month-pill.filed { border-color: rgba(16,185,129,0.4); background: #ecfdf5; }
.month-pill .pill-name { font-size: 14px; font-weight: 600; }
.month-pill .pill-year { font-size: 10px; opacity: 0.7; }
.month-pill .pill-status { font-size: 9px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted-foreground); }
.month-pill.active .pill-status { color: #94a3b8; }
.month-pill.filed .pill-status { color: #059669; }
.month-pill.active.filed .pill-status { color: #6ee7b7; }

/* Modal (dialog) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 41, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.modal .modal-desc { margin: 0 0 16px; font-size: 13px; color: var(--muted-foreground); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.import-results {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.import-results p { margin: 2px 0; }
.import-ok { color: #059669; }
.import-fail { color: var(--destructive); }

/* Login page */
.auth-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: var(--muted);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-card h1 { font-size: 18px; margin: 4px 0 2px; }
.auth-card .auth-desc { font-size: 13px; color: var(--muted-foreground); margin: 0 0 16px; }

/* Account menu */
.account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-radius: 6px;
  padding: 6px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.account-trigger:hover { background: rgba(255,255,255,0.05); }

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
}

.account-name { font-size: 13px; font-weight: 500; color: #fff; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-email { font-size: 11px; color: #94a3b8; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.account-menu {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  margin-bottom: 8px;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 6px;
  display: none;
  z-index: 40;
}
.account-menu.open { display: block; }
.account-menu-label { font-size: 12px; color: var(--muted-foreground); padding: 6px 8px; }
.account-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.account-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--foreground);
  text-align: left;
}
.account-menu-item:hover { background: var(--muted); }
.account-menu-item.destructive { color: var(--destructive); }

/* Tax year switcher */
.year-switcher { position: relative; }
.year-switcher-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--foreground);
}
.year-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--amber); }
.year-switcher-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  min-width: 200px;
  padding: 6px;
  display: none;
  z-index: 40;
}
.year-switcher-menu.open { display: block; }
.year-switcher-menu a, .year-switcher-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--foreground);
}
.year-switcher-menu a:hover, .year-switcher-menu button:hover { background: var(--muted); }

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.file-link:hover { border-color: rgba(15,23,41,0.3); background: var(--muted); }

.stack-gap { display: flex; flex-direction: column; gap: 16px; }
