/* ============================================================
   LegLedger
   Modern Financial Terminal Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-base:        #0d1117;
  --bg-surface:     #161b22;
  --bg-elevated:    #1c2128;
  --bg-hover:       #21262d;
  --border:         #30363d;
  --border-focus:   #388bfd;

  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  --accent-blue:    #388bfd;
  --accent-green:   #3fb950;
  --accent-red:     #f85149;
  --accent-yellow:  #d29922;
  --accent-purple:  #8b5cf6;
  --accent-cyan:    #39d353;

  --profit:         #3fb950;
  --loss:           #f85149;
  --neutral:        #8b949e;

  --font-mono:      'IBM Plex Mono', 'Courier New', monospace;
  --font-sans:      'IBM Plex Sans', -apple-system, sans-serif;

  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      12px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.6);

  --transition:     0.15s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout Shell ── */
.app-shell {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  letter-spacing: -1px;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.logo-version {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.header-user a {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition);
}
.header-user a:hover { color: #58a6ff; }

/* ── Navigation ── */
.site-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 0;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-blue);
}

.nav-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* Dropdown */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 200px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 6px;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown { display: block; }

.nav-dropdown-link {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Page Content ── */
.page-content {
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title .badge {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.card:hover { border-color: #3d444d; }

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-value.profit { color: var(--profit); }
.stat-value.loss { color: var(--loss); }
.stat-value.neutral { color: var(--neutral); }

.stat-delta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-mono);
}

.data-table thead {
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.num { text-align: right; }

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table td.num { text-align: right; font-family: var(--font-mono); }

.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Colored rows */
.data-table tr.row-buy td:first-child { border-left: 3px solid var(--profit); }
.data-table tr.row-sell td:first-child { border-left: 3px solid var(--loss); }
.data-table tr.row-neutral td:first-child { border-left: 3px solid var(--neutral); }

/* ── Badges / Pills ── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

.badge-stock   { background: rgba(56, 139, 253, .15); color: #58a6ff; }
.badge-option  { background: rgba(139, 92, 246, .15); color: #a78bfa; }
.badge-futures { background: rgba(217, 153, 34, .15);  color: #e3b341; }
.badge-crypto  { background: rgba(63, 185, 80, .15);  color: #56d364; }
.badge-forex   { background: rgba(248, 81, 73, .15);   color: #ff7b72; }

.badge-buy    { background: rgba(63, 185, 80, .15);  color: var(--profit); }
.badge-sell   { background: rgba(248, 81, 73, .15);   color: var(--loss); }
.badge-call   { background: rgba(56, 139, 253, .15); color: #58a6ff; }
.badge-put    { background: rgba(248, 81, 73, .15);   color: #ff7b72; }

/* ── Forms ── */
.form-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 680px;
}

.form-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span2 { grid-column: span 2; }

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: var(--font-mono);
}

.form-label .required { color: var(--accent-red); margin-left: 3px; }

.form-control {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 139, 253, .2);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.form-divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.form-section-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Collapsible option section */
.option-fields {
  grid-column: 1 / -1;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.option-fields.visible { display: grid; }
.option-fields .form-group { margin: 0; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

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

.btn-success {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}
.btn-success:hover { background: #2ea043; }

.btn-danger {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}
.btn-danger:hover { background: #da3633; }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #3d444d;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Action Links in Tables ── */
.action-links { display: flex; gap: 4px; justify-content: flex-end; }

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.action-link-edit {
  color: var(--accent-blue);
  border-color: rgba(56, 139, 253, .3);
}
.action-link-edit:hover { background: rgba(56, 139, 253, .1); }

.action-link-delete {
  color: var(--accent-red);
  border-color: rgba(248, 81, 73, .3);
}
.action-link-delete:hover { background: rgba(248, 81, 73, .1); }

.action-link-void {
  color: var(--accent-yellow);
  border-color: rgba(217, 153, 34, .3);
}
.action-link-void:hover { background: rgba(217, 153, 34, .1); }

/* ── Search Bar ── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  width: 200px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--border-focus); }

/* ── Symbol chip ── */
.symbol {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

/* ── Number formatting ── */
.num-positive { color: var(--profit); }
.num-negative { color: var(--loss); }
.num-zero { color: var(--text-muted); }
.num-mono { font-family: var(--font-mono); }

/* ── Login Page ── */
.login-wrapper {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo-mark {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 20px;
  color: #fff;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-align: center;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(248, 81, 73, .1);
  border-color: rgba(248, 81, 73, .4);
  color: #ff7b72;
}

.alert-success {
  background: rgba(63, 185, 80, .1);
  border-color: rgba(63, 185, 80, .4);
  color: #56d364;
}

.alert-info {
  background: rgba(56, 139, 253, .1);
  border-color: rgba(56, 139, 253, .4);
  color: #79c0ff;
}

/* ── File Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--border-focus);
  background: rgba(56, 139, 253, .05);
  color: var(--text-secondary);
}

.drop-zone-icon { font-size: 24px; margin-bottom: 8px; }

/* ── Welcome / Home ── */
.welcome-hero {
  text-align: center;
  padding: 48px 24px;
}

.welcome-hero h1 {
  font-size: 32px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.welcome-hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 32px;
}

.welcome-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.quick-link-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  transition: all var(--transition);
  display: block;
  text-align: left;
}

.quick-link-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-link-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.quick-link-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.quick-link-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Cost Basis Report ── */
.report-container {
  max-width: 900px;
}

.report-filter {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.cb-symbol-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.cb-symbol-header {
  background: var(--bg-elevated);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.cb-symbol-name {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.cb-table {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  border-collapse: collapse;
}

.cb-table th {
  padding: 8px 16px;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.cb-table th.num { text-align: right; }

.cb-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.cb-table td.num { text-align: right; }
.cb-table tbody tr:last-child td { border-bottom: none; }
.cb-table tbody tr:hover { background: var(--bg-hover); }

.cb-totals {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 32px;
  justify-content: flex-end;
}

.cb-total-item { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cb-total-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-family: var(--font-mono); }
.cb-total-value { font-size: 15px; font-weight: 600; font-family: var(--font-mono); color: var(--text-primary); }

/* ── jQuery UI Datepicker override ── */
.ui-datepicker {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-md) !important;
}

.ui-datepicker-header {
  background: var(--bg-surface) !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

.ui-datepicker td a, .ui-datepicker td span {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
}

.ui-datepicker td a:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border: none !important;
}

.ui-datepicker td.ui-datepicker-today a {
  background: rgba(56, 139, 253, .2) !important;
  color: var(--accent-blue) !important;
  font-weight: 600 !important;
}

.ui-datepicker td.ui-state-active a {
  background: var(--accent-blue) !important;
  color: #fff !important;
}

.ui-datepicker-trigger {
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.6;
  filter: invert(1);
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .site-header { padding: 0 16px; }
  .site-nav { padding: 0 8px; }
  .nav-link { padding: 10px 10px; font-size: 12px; }
  .logo-version { display: none; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.span2 { grid-column: span 1; }
  .option-fields { grid-template-columns: 1fr; }
  .form-section { padding: 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .welcome-hero h1 { font-size: 22px; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; }

  .cb-totals { flex-direction: column; gap: 10px; align-items: flex-start; }

  .report-filter { flex-direction: column; }

  .header-user { gap: 8px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .nav-link span.nav-label { display: none; }
  .nav-list { gap: 0; }
  .login-card { padding: 24px 20px; }
  .form-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .action-links { flex-wrap: wrap; }
}

/* ── Utility ── */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: var(--font-mono); }
.d-flex { display: flex; }
.gap-8 { gap: 8px; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3d444d; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ── Tooltip ── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }
