/* ===================================================
   Panosch Buchhaltung – Design System
   Based on panosch.media design language
   =================================================== */

/* --- CSS Variables --- */
:root {
  --bg-primary:      #0d0a1a;
  --bg-secondary:    #1a0a2e;
  --card-bg:         #151025;
  --card-bg-alt:     #2d1b4e;
  --sidebar-bg:      #0f0b1f;

  --purple-mid:      #6c3fa0;
  --purple-light:    #9b6dd7;
  --purple-glow:     #b388ff;

  --orange-cta:      #ff6b2b;
  --orange-hover:    #ff8a50;

  --text-primary:    #f0eaf8;
  --text-secondary:  #a89bc2;
  --text-muted:      #6d5f85;

  --border-subtle:   rgba(108, 63, 160, 0.2);
  --border-glow:     rgba(155, 109, 215, 0.4);

  --success:         #4caf87;
  --success-bg:      rgba(76, 175, 135, 0.12);
  --warning:         #f0a340;
  --warning-bg:      rgba(240, 163, 64, 0.12);
  --danger:          #e05060;
  --danger-bg:       rgba(224, 80, 96, 0.12);
  --info:            #4fadd4;
  --info-bg:         rgba(79, 173, 212, 0.12);

  --sidebar-width:   240px;
  --topbar-height:   60px;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       20px;

  --font-main:       'Outfit', system-ui, sans-serif;
  --font-mono:       'Space Mono', 'Courier New', monospace;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--purple-light);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--purple-glow); }

/* --- Background Orbs --- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
}
.orb1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,63,160,0.15) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.orb2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(155,109,215,0.1) 0%, transparent 70%);
  bottom: 10%; right: -80px;
}
.orb3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,107,43,0.06) 0%, transparent 70%);
  top: 40%; left: 40%;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.logo-icon {
  font-size: 1.8rem;
  color: var(--purple-light);
  line-height: 1;
}

.logo-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.2;
}
.logo-text small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.sidebar-nav {
  list-style: none;
  padding: 1rem 0;
  flex: 1;
}

.nav-separator {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.5rem 1rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-item a svg { flex-shrink: 0; opacity: 0.7; }
.nav-item a:hover {
  color: var(--text-primary);
  background: rgba(108,63,160,0.1);
  border-left-color: var(--purple-mid);
}
.nav-item.active a {
  color: var(--purple-glow);
  background: rgba(108,63,160,0.15);
  border-left-color: var(--purple-light);
  font-weight: 600;
}
.nav-item.active a svg { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted) !important;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.logout-btn:hover { color: var(--danger) !important; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(13, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}
.menu-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.topbar-title {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.user-badge {
  background: rgba(108,63,160,0.2);
  color: var(--purple-light);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.page-content {
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  position: relative;
  z-index: 1;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
.card:hover { border-color: var(--border-glow); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-link {
  font-size: 0.85rem;
  color: var(--purple-light);
  white-space: nowrap;
}
.card-link:hover { color: var(--purple-glow); }

.card-body {
  padding: 1.25rem;
}
.card-body.no-pad { padding: 0; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.3;
}

.btn-primary {
  background: var(--orange-cta);
  color: #fff;
}
.btn-primary:hover {
  background: var(--orange-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,107,43,0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glow);
}
.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--purple-light);
  background: rgba(108,63,160,0.1);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { color: var(--text-secondary); border-color: var(--border-subtle); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #3da070; color:#fff; transform: translateY(-1px); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(224,80,96,0.3);
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

.btn-icon {
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { border-color: var(--border-glow); color: var(--text-primary); background: rgba(108,63,160,0.1); }
.btn-icon.btn-danger { color: var(--danger); }
.btn-icon.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-icon.btn-success { color: var(--success); }
.btn-icon.btn-success:hover { background: var(--success-bg); }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-full { width: 100%; }

/* --- Forms --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 140px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-control {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(155,109,215,0.15);
  background: rgba(255,255,255,0.07);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control option {
  background: var(--card-bg);
  color: var(--text-primary);
}

textarea.form-control { resize: vertical; min-height: 70px; }

.form-control-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- Tables --- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.15);
  white-space: nowrap;
}

.table td {
  padding: 0.7rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(108,63,160,0.08);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: rgba(108,63,160,0.05);
  color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }

.table-compact th { padding: 0.5rem 0.75rem; }
.table-compact td { padding: 0.5rem 0.75rem; font-size: 0.82rem; }

.row-overdue td { background: rgba(224,80,96,0.04) !important; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-secondary { background: rgba(108,63,160,0.15); color: var(--purple-light); }
.badge-success   { background: var(--success-bg);      color: var(--success); }
.badge-warning   { background: var(--warning-bg);      color: var(--warning); }
.badge-danger    { background: var(--danger-bg);       color: var(--danger); }
.badge-info      { background: var(--info-bg);         color: var(--info); }

/* --- Alerts --- */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  position: relative;
}
.alert-success { background: var(--success-bg); border: 1px solid rgba(76,175,135,0.3); color: var(--success); }
.alert-danger  { background: var(--danger-bg);  border: 1px solid rgba(224,80,96,0.3);  color: var(--danger); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(240,163,64,0.3); color: var(--warning); }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(79,173,212,0.3); color: var(--info); }
.alert-dismissible { padding-right: 2.5rem; }
.alert-close {
  background: none; border: none; cursor: pointer;
  color: inherit; font-size: 1.2rem; line-height: 1;
  position: absolute; top: 0.75rem; right: 0.75rem;
  opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* --- Dashboard Stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}
.stat-card:hover { border-color: var(--border-glow); transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-income  { background: rgba(108,63,160,0.2); color: var(--purple-light); }
.stat-icon-ytd     { background: rgba(155,109,215,0.15); color: var(--purple-glow); }
.stat-icon-expense { background: var(--danger-bg); color: var(--danger); }
.stat-icon-warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon-invoice { background: var(--info-bg); color: var(--info); }

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}

/* --- Chart card --- */
.chart-card { margin-bottom: 1.25rem; }
.chart-card .card-body { padding: 1rem 1.25rem; }

/* --- Dashboard grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* --- Accounts grid --- */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.account-card { padding: 0; }

.account-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.account-icon {
  width: 38px; height: 38px;
  background: rgba(108,63,160,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple-light);
  flex-shrink: 0;
}

.account-info { flex: 1; min-width: 0; }
.account-name { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.account-type { font-size: 0.78rem; color: var(--text-muted); }
.account-actions { display: flex; gap: 0.3rem; }
.account-iban { padding: 0.5rem 1.1rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); letter-spacing: 0.03em; }

.account-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.75rem 1.1rem;
}
.account-stat { padding: 0.4rem 0; }
.account-stat .stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.04em; }
.account-stat .stat-val { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600; }

.account-upload { padding: 0.75rem 1.1rem; border-top: 1px solid var(--border-subtle); }

/* --- Filters --- */
.filter-card { margin-bottom: 1.25rem; }
.filter-card .card-body { padding: 1rem 1.25rem 0.25rem; }
.filter-form .form-row { margin-bottom: 0.5rem; }

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--border-glow); color: var(--text-primary); }
.page-btn.active { background: var(--purple-mid); border-color: var(--purple-mid); color: #fff; font-weight: 700; }

/* --- Status toggle dropdown --- */
.status-toggle {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.status-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--card-bg-alt);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  min-width: 140px;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  overflow: hidden;
}
.status-dropdown button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0.5rem 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.status-dropdown button:hover { background: rgba(108,63,160,0.15); color: var(--text-primary); }

/* --- Action buttons --- */
.action-buttons {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* --- Invoice view grid --- */
.invoice-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

/* --- Detail list (dl) --- */
.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.5rem;
  font-size: 0.88rem;
}
.detail-list dt {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: baseline;
  white-space: nowrap;
  padding-top: 0.1rem;
}
.detail-list dd { color: var(--text-primary); }

/* --- Totals --- */
.totals-preview {
  max-width: 320px;
  margin-left: auto;
  margin-top: 1rem;
}
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.total-row:last-child { border-bottom: none; }
.total-grand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  background: rgba(108,63,160,0.1);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.totals-display { max-width: 380px; margin-left: auto; }
.total-row-display {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.total-row-display:last-child { border-bottom: none; }
.total-grand-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 2px solid var(--border-glow) !important;
}

/* --- Invoice create --- */
.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.yt-amount-section { background: rgba(108,63,160,0.05); border-radius: var(--radius-sm); padding: 1rem; margin: 0.5rem 0; }

.items-table-wrapper { overflow-x: auto; }
.items-input-table td { vertical-align: top; padding: 0.4rem 0.5rem; }
.items-input-table th { padding: 0.5rem 0.5rem; white-space: nowrap; }

/* --- Login page --- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.logo-icon-large {
  font-size: 3rem;
  color: var(--purple-light);
  display: block;
  margin-bottom: 0.5rem;
}
.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.login-logo h1 span {
  color: var(--purple-light);
  font-weight: 400;
  font-size: 1rem;
}

.login-form .form-group { margin-bottom: 1rem; }
.login-form .btn { margin-top: 0.5rem; }

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Utility --- */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--text-primary) !important; }
.mono         { font-family: var(--font-mono) !important; }
.nowrap       { white-space: nowrap; }
.truncate     { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-primary { color: var(--purple-light) !important; font-weight: 500; }
.link-primary:hover { color: var(--purple-glow) !important; }
.link-subtle  { color: var(--text-secondary) !important; }
.link-subtle:hover { color: var(--text-primary) !important; }

/* Alpine.js cloak */
[x-cloak] { display: none !important; }

/* --- Responsive --- */
@media (max-width: 968px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle {
    display: flex;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .invoice-view-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-content { padding: 1rem; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar-title { display: none; }
  .table th, .table td { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
  .login-card { padding: 1.75rem 1.25rem; }
}

/* --- Animations --- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .stat-card { animation: fade-in 0.3s ease forwards; }
.alert { animation: fade-in 0.2s ease forwards; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,63,160,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(155,109,215,0.5); }
