/* ── Reset & Variables ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

:root {
  --bg: #f8f9fb;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;
  --border: #e2e8f0;
  --accent: #3b82f6;
  --accent-light: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --critical: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
#sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-text {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Georgia', serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  letter-spacing: 3.5px;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}

.nav-links li { margin-bottom: 2px; }

.nav-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-links a:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-links a.active {
  background: var(--accent);
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.version-tag {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-mono);
}

/* ── Main Content ──────────────────────────────────────────────── */
#content {
  flex: 1;
  margin-left: 240px;
  padding: 24px 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Cards ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card.accent { border-left: 3px solid var(--accent); }
.stat-card.success { border-left: 3px solid var(--success); }
.stat-card.warning { border-left: 3px solid var(--warning); }
.stat-card.danger { border-left: 3px solid var(--danger); }

/* ── Tables ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.card-body { padding: 0; }
.card-body.padded { padding: 20px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }

tbody tr:hover { background: var(--accent-light); }

tbody tr { cursor: pointer; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-active { background: #d1fae5; color: #065f46; }
.badge-dormant { background: #fef3c7; color: #92400e; }
.badge-dissolved { background: #fee2e2; color: #991b1b; }
.badge-in-formation { background: #e0e7ff; color: #3730a3; }
.badge-suspended { background: #fce7f3; color: #9d174d; }

.badge-ae { background: #dbeafe; color: #1e40af; }
.badge-sa { background: #d1fae5; color: #065f46; }
.badge-gb { background: #ede9fe; color: #5b21b6; }
.badge-sg { background: #fef3c7; color: #92400e; }

.badge-critical { background: #fee2e2; color: #991b1b; }
.badge-high { background: #fed7aa; color: #c2410c; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-low { background: #d1fae5; color: #065f46; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.15s;
}

.btn:hover { background: var(--bg); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover { background: #2563eb; }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ── Filters ───────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Detail View ───────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 6px;
}

.detail-item .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.detail-item .value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 16px;
  cursor: pointer;
}

.back-link:hover { text-decoration: underline; }

/* ── Loading ───────────────────────────────────────────────────── */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.hidden { display: none !important; }

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── Jurisdiction chips ────────────────────────────────────────── */
.jurisdiction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 12px;
}

.flag { font-size: 16px; }

/* ── Obligation table extras ───────────────────────────────────── */
.due-date {
  font-family: var(--font-mono);
  font-size: 12px;
}

.due-date.overdue { color: var(--danger); font-weight: 600; }
.due-date.soon { color: var(--warning); font-weight: 600; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { width: 60px; }
  .logo-text, .nav-links a span, .sidebar-footer { display: none; }
  .nav-links a { justify-content: center; padding: 12px; }
  #content { margin-left: 60px; padding: 16px; }
}

/* ── Empty state ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ── Scrollable table wrapper ──────────────────────────────────── */
.table-wrap { overflow-x: auto; }

/* ── Drop Zone ────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card);
  margin-bottom: 24px;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone .drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-secondary);
  opacity: 0.5;
}

.drop-zone.dragover .drop-icon { color: var(--accent); opacity: 1; }

.drop-zone p { font-size: 14px; color: var(--text-secondary); }
.drop-zone .drop-hint { font-size: 12px; color: var(--text-secondary); margin-top: 8px; opacity: 0.7; }

.drop-zone input[type="file"] { display: none; }

/* ── Document cards ───────────────────────────────────────────── */
.doc-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
}

.doc-date-group {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 8px 0 4px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.doc-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.doc-icon.pdf { background: #fee2e2; color: #dc2626; }
.doc-icon.txt { background: #dbeafe; color: #2563eb; }
.doc-icon.csv { background: #d1fae5; color: #059669; }
.doc-icon.other { background: #f1f5f9; color: #64748b; }

.doc-info { flex: 1; min-width: 0; }
.doc-info .doc-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info .doc-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.doc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.doc-tag {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #475569;
}

.doc-actions { flex-shrink: 0; }

/* ── Upload progress ──────────────────────────────────────────── */
.upload-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.upload-progress .spinner { width: 20px; height: 20px; margin: 0; border-width: 2px; }
.upload-progress p { font-size: 13px; color: var(--accent); }

/* ── Document detail text ─────────────────────────────────────── */
.extracted-text-wrap.collapsed { display: none; }

.extracted-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-size: 13px;
  font-family: var(--font-mono);
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.tl-month {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 8px -24px;
  padding-left: 24px;
}
.tl-month:first-child { margin-top: 0; }

.tl-item {
  position: relative;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tl-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tl-doc, .tl-compliance { cursor: pointer; }

.tl-dot {
  position: absolute;
  left: -21px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.tl-dot-blue   { background: var(--accent); }
.tl-dot-green  { background: var(--success); }
.tl-dot-orange { background: var(--warning); }
.tl-dot-red    { background: var(--danger); }
.tl-dot-gray   { background: var(--text-secondary); }

.tl-header { display: flex; align-items: center; gap: 10px; }
.tl-title { font-size: 14px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.tl-obligation { border-left: 3px solid var(--warning); }
.tl-compliance { border-left: 3px solid var(--success); }

/* ── Country Tabs ────────────────────────────────────────────── */
.country-tabs {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.country-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  min-width: 155px;
  min-height: 64px;
}
.country-tab:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.country-tab.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.ct-flag { font-size: 30px; line-height: 1; }
.ct-name { font-weight: 600; font-size: 16px; }
.ct-meta { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.ct-count {
  margin-left: auto;
  background: var(--bg);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.country-tab.active .ct-count { background: var(--accent); color: #fff; }

/* ── Filing List ─────────────────────────────────────────────── */
.filing-list { display: flex; flex-direction: column; gap: 10px; }
.filing-month {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 16px 0 6px;
}
.filing-month:first-child { margin-top: 0; }

.filing-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filing-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.filing-entity-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filing-entity-name {
  font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none;
}
.filing-entity-name:hover { color: var(--accent); text-decoration: underline; cursor: pointer; }
.filing-jur-flag { font-size: 20px; }

.filing-licence-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(59,130,246,0.06); border: 1px solid rgba(59,130,246,0.15);
}
.filing-licence-label {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--accent); min-width: 120px;
}
.filing-licence-dates {
  font-size: 14px; color: var(--text-secondary);
}
.filing-ob-list { display: flex; flex-direction: column; gap: 4px; }
.filing-ob-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.filing-ob-type { font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; min-width: 240px; }
.filing-meta { font-size: 14px; color: var(--text-secondary); font-weight: 400; text-transform: none; letter-spacing: 0; }

.due-badge {
  font-size: 14px; font-weight: 600; padding: 6px 14px;
  border-radius: 6px; white-space: nowrap; text-align: center; margin-left: auto;
}
.due-badge-overdue { background: #dc3545; color: #fff; }
.due-badge-soon { background: #f59e0b; color: #fff; }
.due-badge-upcoming { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.due-badge-filed { background: #dcfce7; color: #166534; }
.filing-done { opacity: 0.7; }

@media (max-width: 700px) {
  .filing-ob-line { flex-wrap: wrap; }
  .filing-ob-type { min-width: unset; }
}
.tl-filed { opacity: 0.7; }
.tl-filed .tl-title { text-decoration: line-through; color: var(--text-secondary); }
.btn-filed { margin-left: 8px; font-size: 11px; padding: 2px 8px; background: var(--accent); color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-filed:hover { opacity: 0.85; }

.filing-section-header {
  font-size: 16px; font-weight: 700; padding: 14px 0 8px; margin-top: 12px;
  color: var(--text-secondary); border-bottom: 2px solid var(--border);
}
.filing-section-overdue { color: #dc2626; }
.filing-section-soon { color: #d97706; }
.filing-section-filed { color: var(--success); }
.filing-section-renewal { color: var(--accent); }

.renewal-doc-row {
  padding: 6px 12px 8px;
  border-top: 1px dashed var(--border);
}
.renewal-doc-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; color: var(--accent);
  text-decoration: none; padding: 3px 10px; border-radius: 4px;
  background: rgba(59, 130, 246, 0.08); transition: background .15s;
}
.renewal-doc-link:hover { background: rgba(59, 130, 246, 0.16); text-decoration: underline; }

.trace-toggle {
  display: inline-block; margin-top: 8px; padding: 0; border: none; background: none;
  font-size: 12px; color: var(--accent); cursor: pointer; font-family: inherit;
}
.trace-toggle:hover { text-decoration: underline; }
.trace-toggle::before { content: '\25B6'; margin-right: 4px; font-size: 9px; display: inline-block; transition: transform .15s; }
.trace-toggle.open::before { transform: rotate(90deg); }
.trace-panel { margin-top: 8px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
.trace-panel.collapsed { display: none; }
.trace-grid { display: flex; flex-direction: column; gap: 6px; }
.trace-row { display: flex; gap: 8px; font-size: 12px; line-height: 1.5; }
.trace-label { flex: 0 0 80px; color: var(--text-secondary); font-weight: 500; }
.trace-value { flex: 1; color: var(--text-primary); font-family: var(--font-mono); font-size: 11px; }
.trace-ol { margin: 0; padding-left: 18px; }
.trace-ol li { margin-bottom: 2px; }

.doctype-select {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--text-primary); font-size: 13px;
  font-family: inherit; cursor: pointer;
}
.doctype-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.doc-tag-type { background: var(--accent); color: #fff; font-weight: 500; }

[role="button"]:focus-visible, tr[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ── Login Screen ──────────────────────────────────────────────── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-sidebar);
}
.login-card {
  background: var(--bg-card); border-radius: 12px; padding: 40px 36px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 20px; }
.login-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger); border-radius: 6px; padding: 10px 14px;
  font-size: 14px; margin-bottom: 16px; text-align: center;
}
.login-success {
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3);
  color: var(--success); border-radius: 6px; padding: 10px 14px;
  font-size: 14px; margin-bottom: 16px; text-align: center;
}
.login-links {
  text-align: center; margin-top: 20px; font-size: 14px;
}
.login-links a {
  color: var(--accent); text-decoration: none; font-weight: 500;
}
.login-links a:hover { text-decoration: underline; }
.login-links-sep {
  margin: 0 8px; color: var(--text-secondary);
}
.login-screen .form-group { margin-bottom: 16px; }
.login-screen .form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.login-screen .form-group input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 15px; font-family: inherit;
  background: var(--bg); color: var(--text);
}
.login-screen .form-group input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ── User Info (sidebar footer) ────────────────────────────────── */
.user-info {
  padding: 8px 0; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.user-info-name {
  font-size: 13px; font-weight: 600; color: var(--text-sidebar-active);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info-role {
  font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase;
  letter-spacing: 0.05em; margin-top: 2px;
}
.user-info-logout {
  font-size: 12px; color: rgba(255,255,255,0.4); cursor: pointer;
  margin-top: 6px; text-decoration: underline;
  background: none; border: none; padding: 0; font-family: inherit;
}
.user-info-logout:hover { color: var(--danger); }

/* ── Team Management ───────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.team-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.team-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.team-card-name { font-size: 16px; font-weight: 700; color: var(--text); }
.team-card-email { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.team-card-role {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.role-master { background: rgba(139,92,246,0.12); color: #7c3aed; }
.role-team-head { background: rgba(59,130,246,0.12); color: #2563eb; }
.role-team { background: rgba(16,185,129,0.12); color: #059669; }
.team-card-assignments { margin-top: 12px; font-size: 13px; color: var(--text-secondary); }
.team-card-assignments strong { color: var(--text); }
.team-card-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.team-card-inactive { opacity: 0.5; }
.team-card-new { border-left: 3px solid var(--warning); }
.badge-new {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px;
  background: rgba(245,158,11,0.15); color: var(--warning); vertical-align: middle; margin-left: 6px;
}

/* ── Multi-select tags ─────────────────────────────────────────── */
.tag-select { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-option {
  padding: 4px 12px; border-radius: 14px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
  background: var(--bg); color: var(--text-secondary);
}
.tag-option.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-option:hover { border-color: var(--accent); }
