/* ═══════════════════════════════════════════════════════
   KASA — Custom CSS  (replaces Tailwind CDN)
   Font: Inter via Google Fonts
   ═══════════════════════════════════════════════════════ */

/* ─── VARIABLES ─────────────────────────────────────── */
:root {
  --brand:      #3b5bdb;
  --brand-dark: #2f4ac2;
  --brand-50:   #eff3ff;
  --brand-100:  #dce6ff;
  --sidebar-w:  248px;
  --radius:     14px;
  --radius-sm:  9px;
  --radius-xs:  6px;
}

/* ─── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg { display: block; flex-shrink: 0; }
img { display: block; }

/* ─── BASE ──────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #1f2937;
  background: #f5f6f8;
  -webkit-font-smoothing: antialiased;
}

/* ─── LAYOUT ────────────────────────────────────────── */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #f0f1f3;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transform: translateX(-100%);
  transition: transform .22s ease;
}
.app-sidebar.open { transform: translateX(0); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.4);
  z-index: 20;
}
.sidebar-overlay.active { display: block; }

.app-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #f0f1f3;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.app-content {
  flex: 1;
  padding: 20px 16px;
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
}

/* ─── SIDEBAR SECTIONS ──────────────────────────────── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: 62px;
  border-bottom: 1px solid #f0f1f3;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-icon svg { color: #fff; width: 18px; height: 18px; }
.sidebar-logo-name { font-size: 13.5px; font-weight: 700; color: #111827; line-height: 1.2; }
.sidebar-logo-sub  { font-size: 9px; color: #adb5bd; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.sidebar-nav > * + * { margin-top: 2px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  transition: all .14s ease;
  white-space: nowrap;
}
.sidebar-link:hover { background: #f8f9fa; color: #111827; }
.sidebar-link.active { background: var(--brand); color: #fff; }
.sidebar-link svg { width: 17px; height: 17px; opacity: .65; }
.sidebar-link.active svg { opacity: 1; color: #fff; }
.sidebar-link:hover svg { opacity: 1; color: #374151; }

.sidebar-bottom {
  border-top: 1px solid #f3f4f6;
  padding: 10px;
  flex-shrink: 0;
}

/* Lang switch */
.lang-switch {
  display: flex;
  gap: 3px;
  margin-bottom: 6px;
  padding: 0 2px;
}
.lang-switch a {
  flex: 1;
  text-align: center;
  font-size: 11px;
  padding: 5px;
  border-radius: 7px;
  font-weight: 500;
  color: #9ca3af;
  transition: all .14s;
}
.lang-switch a:hover { color: #374151; }
.lang-switch a.active { background: var(--brand-50); color: var(--brand); }

/* User row */
.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}
.user-name { font-size: 13px; color: #374151; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout { color: #9ca3af; transition: color .14s; }
.user-logout:hover { color: #ef4444; }
.user-logout svg { width: 15px; height: 15px; }

/* ─── FLASH MESSAGES ────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.flash svg { width: 15px; height: 15px; flex-shrink: 0; }
.flash-close { margin-left: auto; cursor: pointer; opacity: .55; transition: opacity .14s; }
.flash-close:hover { opacity: 1; }
.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.flash-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* ─── CARD ──────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #f0f1f3;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  padding: 20px;
}
.card-p0 { padding: 0; }
.card-p4 { padding: 16px; }

/* ─── PAGE HEADER ───────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title    { font-size: 18px; font-weight: 700; color: #111827; }
.page-subtitle { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* ─── BUTTONS ───────────────────────────────────────── */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .14s ease;
  white-space: nowrap;
  outline: none;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
}
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn svg, .btn-primary svg, .btn-secondary svg, .btn-danger svg { width: 15px; height: 15px; flex-shrink: 0; }

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

.btn-secondary { background: #fff; color: #4b5563; border-color: #e5e7eb; }
.btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; }

.btn-danger    { background: #fff; color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fef2f2; border-color: #f87171; }

.btn-sm,
.btn.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-sm svg  { width: 13px; height: 13px; }

.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled { opacity: .55; cursor: default; }

/* ─── FORMS ─────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-label  {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 5px;
}
.form-input {
  display: block;
  width: 100%;
  padding: 9px 13px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: #111827;
  background: #fff;
  font-family: inherit;
  transition: border .14s, box-shadow .14s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,91,219,.11);
}
.form-input::placeholder { color: #adb5bd; }
textarea.form-input { resize: none; }
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
  cursor: pointer;
}
.form-hint { font-size: 11px; color: #adb5bd; margin-top: 4px; }
.form-error-list {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 18px;
}
.form-error-list p { font-weight: 600; margin-bottom: 4px; }
.form-error-list ul { padding-left: 16px; }
.form-error-list li { margin-top: 2px; }

/* Checkbox */
input[type=checkbox] {
  width: 16px; height: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: #374151;
  user-select: none;
  padding: 6px 0;
}

/* Income/Expense type toggle */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid #e5e7eb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  background: #fff;
  transition: all .14s;
  user-select: none;
}
.type-btn:hover { border-color: #d1d5db; }
.type-btn.income.active  { border-color: #6ee7b7; background: #ecfdf5; color: #065f46; }
.type-btn.expense.active { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }

/* ─── TABLE ─────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  background: #fafafa;
  border-bottom: 1px solid #f0f1f3;
  white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: #6b7280; }
.data-table th.r { text-align: right; }
.data-table td {
  padding: 11px 16px;
  color: #374151;
  border-bottom: 1px solid #f8f9fa;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.data-table td.r { text-align: right; white-space: nowrap; }
.data-table td.mono { font-family: 'JetBrains Mono','Fira Code',monospace; font-size: 12px; color: #6b7280; }
.data-table td.amount-income  { color: #059669; font-weight: 600; white-space: nowrap; }
.data-table td.amount-expense { color: #dc2626; font-weight: 600; white-space: nowrap; }
.data-table td.muted { color: #9ca3af; font-size: 12px; }
.data-table td.truncate-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-empty td { text-align: center; padding: 52px 16px; color: #9ca3af; }

/* ─── BADGES ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-income  { background: #ecfdf5; color: #065f46; }
.badge-expense { background: #fef2f2; color: #991b1b; }
.badge-cat     { background: #f3f4f6; color: #4b5563; }

/* ─── STAT CARDS ────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card  { display: flex; align-items: center; gap: 14px; }
.stat-icon  {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-label { font-size: 11px; color: #9ca3af; font-weight: 500; }
.stat-value { font-size: 19px; font-weight: 700; color: #111827; line-height: 1.2; margin-top: 1px; }
.stat-sub   { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* ─── FILTER BAR ────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field.grow { flex: 1; min-width: 160px; }

/* ─── QUICK ACTIONS ─────────────────────────────────── */
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all .14s;
}
.quick-action-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-action-icon svg { width: 15px; height: 15px; }
.qa-income  { background: #f0fdf4; color: #166534; }
.qa-income:hover  { background: #dcfce7; }
.qa-income .quick-action-icon  { background: #bbf7d0; }
.qa-expense { background: #fef2f2; color: #991b1b; }
.qa-expense:hover { background: #fee2e2; }
.qa-expense .quick-action-icon { background: #fecaca; }
.qa-stats   { background: var(--brand-50); color: #1e3a9f; }
.qa-stats:hover   { background: var(--brand-100); }
.qa-stats .quick-action-icon   { background: var(--brand-100); }
.qa-export  { background: #f8f9fa; color: #4b5563; }
.qa-export:hover  { background: #f3f4f6; }
.qa-export .quick-action-icon  { background: #e5e7eb; }

/* ─── PROGRESS / BALANCE BAR ────────────────────────── */
.balance-bar { height: 7px; border-radius: 99px; overflow: hidden; background: #f3f4f6; display: flex; }
.balance-bar-income  { background: #34d399; transition: width .7s ease; }
.balance-bar-expense { background: #f87171; transition: width .7s ease; }

/* ─── RECENT LIST ───────────────────────────────────── */
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  transition: background .12s;
}
.recent-item:hover { background: #fafafa; }
.recent-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.recent-icon svg { width: 14px; height: 14px; }
.ri-income  { background: #ecfdf5; color: #059669; }
.ri-expense { background: #fef2f2; color: #ef4444; }
.ri-unpaid  { background: #fffbeb; color: #d97706; }

/* ─── CATEGORY BAR (Statistics) ────────────────────── */
.cat-bar { height: 5px; background: #f3f4f6; border-radius: 99px; margin-top: 5px; }
.cat-bar-fill { height: 5px; border-radius: 99px; }
.cat-fill-income  { background: #10b981; }
.cat-fill-expense { background: #ef4444; }

/* ─── AUTOCOMPLETE ──────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  z-index: 50;
  width: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.09);
  overflow: hidden;
  max-height: 192px;
  overflow-y: auto;
}
.autocomplete-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
  transition: background .1s;
}
.autocomplete-item:hover { background: #f8f9fa; }

/* ─── YEAR PILL (Statistics) ────────────────────────── */
.year-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 500;
  color: #9ca3af;
  transition: all .14s;
}
.year-pill:hover { color: #4b5563; }
.year-pill.active { background: var(--brand); color: #fff; }

/* ─── LOGIN PAGE ────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f6f8;
  padding: 16px;
}
.login-box { width: 100%; max-width: 360px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon {
  width: 52px; height: 52px;
  background: var(--brand);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 20px rgba(59,91,219,.25);
}
.login-logo-icon svg { width: 28px; height: 28px; color: #fff; }
.login-title { font-size: 22px; font-weight: 700; color: #111827; }
.login-sub   { font-size: 10px; color: #adb5bd; text-transform: uppercase; letter-spacing: .1em; font-weight: 500; margin-top: 3px; }
.login-card  { background: #fff; border-radius: var(--radius); border: 1px solid #f0f1f3; box-shadow: 0 2px 12px rgba(0,0,0,.06); padding: 28px; }
.login-footer { text-align: center; font-size: 12px; color: #9ca3af; margin-top: 20px; }

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 99px; }

/* ─── ALPINE ────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ─── ANIMATIONS ────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ═══ UTILITY CLASSES (used in views) ═══════════════ */

/* Display */
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.block { display: block; }
.inline { display: inline-block; vertical-align: middle; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Alignment */
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.ml-auto { margin-left: auto; }
.ml-2    { margin-left: 8px; }
.mr-1    { margin-right: 4px; }
.mt-auto { margin-top: auto; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* Gap */
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-5  { gap: 20px; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1,1fr); }
.grid-cols-2 { grid-template-columns: repeat(2,1fr); }
.grid-cols-3 { grid-template-columns: repeat(3,1fr); }
.grid-cols-4 { grid-template-columns: repeat(4,1fr); }
.col-span-2  { grid-column: span 2; }

/* Spacing */
.p-4  { padding: 16px; }
.p-5  { padding: 20px; }
.p-7  { padding: 28px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Width / Height */
.w-full { width: 100%; }
.w-3  { width: 12px; height: 12px; }
.w-4  { width: 16px; } .h-4  { height: 16px; }
.w-5  { width: 20px; } .h-5  { height: 20px; }
.w-8  { width: 32px; } .h-8  { height: 32px; }
.w-9  { width: 36px; } .h-9  { height: 36px; }
.w-10 { width: 40px; } .h-10 { height: 40px; }
.w-14 { width: 56px; } .h-14 { height: 56px; }
.h-2  { height: 8px; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.max-w-2xl { max-width: 672px; }
.max-w-sm  { max-width: 384px; }
.mx-auto   { margin-left: auto; margin-right: auto; }

/* Overflow */
.overflow-hidden  { overflow: hidden; }
.overflow-x-auto  { overflow-x: auto; }
.overflow-y-auto  { overflow-y: auto; }
.max-h-48 { max-height: 192px; }
.max-h-72 { max-height: 288px; }
.max-h-80 { max-height: 320px; }

/* Typography */
.text-xs    { font-size: 11px; }
.text-sm    { font-size: 13px; }
.text-base  { font-size: 14px; }
.text-lg    { font-size: 16px; }
.text-xl    { font-size: 18px; }
.text-2xl   { font-size: 22px; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide    { letter-spacing: .05em; }
.tracking-wider   { letter-spacing: .08em; }
.tracking-widest  { letter-spacing: .12em; }
.tracking-tight   { letter-spacing: -.01em; }
.leading-tight  { line-height: 1.2; }
.leading-none   { line-height: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.select-none  { user-select: none; }
.cursor-pointer { cursor: pointer; }
.resize-none { resize: none; }

/* Colors — text */
.text-gray-400  { color: #9ca3af; }
.text-gray-500  { color: #6b7280; }
.text-gray-600  { color: #4b5563; }
.text-gray-700  { color: #374151; }
.text-gray-800  { color: #1f2937; }
.text-gray-900  { color: #111827; }
.text-white     { color: #fff; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-emerald-800 { color: #065f46; }
.text-red-500   { color: #ef4444; }
.text-red-600   { color: #dc2626; }
.text-red-700   { color: #b91c1c; }
.text-red-800   { color: #991b1b; }
.text-blue-600  { color: #2563eb; }
.text-amber-500 { color: #f59e0b; }
.text-brand-600 { color: var(--brand); }
.text-brand-700 { color: var(--brand-dark); }

/* Colors — background */
.bg-white      { background: #fff; }
.bg-gray-50    { background: #f9fafb; }
.bg-gray-100   { background: #f3f4f6; }
.bg-gray-200   { background: #e5e7eb; }
.bg-emerald-50  { background: #ecfdf5; }
.bg-emerald-100 { background: #d1fae5; }
.bg-emerald-200 { background: #a7f3d0; }
.bg-emerald-400 { background: #34d399; }
.bg-red-50     { background: #fef2f2; }
.bg-red-100    { background: #fee2e2; }
.bg-red-200    { background: #fecaca; }
.bg-red-400    { background: #f87171; }
.bg-red-100    { background: #fee2e2; }
.bg-amber-50   { background: #fffbeb; }
.bg-brand-50   { background: var(--brand-50); }
.bg-brand-100  { background: var(--brand-100); }
.bg-brand-200  { background: #b9ccff; }
.bg-brand-600  { background: var(--brand); }
.bg-slate-50   { background: #f8fafc; }

/* Border */
.border     { border: 1px solid #e5e7eb; }
.border-t   { border-top: 1px solid #e5e7eb; }
.border-b   { border-bottom: 1px solid #e5e7eb; }
.border-dashed { border-style: dashed; }
.border-gray-50  { border-color: #f9fafb; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }

/* Radius */
.rounded    { border-radius: 4px; }
.rounded-md { border-radius: 6px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* Shadow */
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.shadow-lg { box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* Divide */
.divide-y > * + * { border-top: 1px solid #f8f9fa; }

/* Position */
.relative { position: relative; }
.absolute  { position: absolute; }
.fixed     { position: fixed; }
.sticky    { position: sticky; }
.inset-0   { top: 0; right: 0; bottom: 0; left: 0; }
.top-0     { top: 0; }
.left-0    { left: 0; }
.right-3   { right: 12px; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.-translate-y-1\/2 { transform: translateY(-50%); }

/* Misc */
.transition-colors { transition: color .14s, background-color .14s, border-color .14s; }
.transition-all    { transition: all .14s ease; }
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.opacity-25 { opacity: .25; }
.opacity-75 { opacity: .75; }
.antialiased { -webkit-font-smoothing: antialiased; }
.backdrop-blur { backdrop-filter: blur(10px); }

/* ═══ RESPONSIVE ═══════════════════════════════════════ */
@media (min-width: 640px) {
  .sm\:flex-row    { flex-direction: row; }
  .sm\:items-center { align-items: center; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2,1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3,1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4,1fr); }
  .app-content     { padding: 24px; }
}
@media (min-width: 1024px) {
  .app-sidebar     { transform: translateX(0); }
  .app-topbar      { display: none; }
  .app-main        { padding-left: var(--sidebar-w); }
  .stat-cards      { grid-template-columns: repeat(4,1fr); }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2,1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4,1fr); }
  .lg\:hidden      { display: none; }
  .lg\:col-span-2  { grid-column: span 2; }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-2 { grid-template-columns: repeat(2,1fr); }
  .xl\:grid-cols-3 { grid-template-columns: repeat(3,1fr); }
  .xl\:grid-cols-4 { grid-template-columns: repeat(4,1fr); }
  .xl\:col-span-2  { grid-column: span 2; }
}

/* BGN equivalent shown next to EUR amounts */
.money-bgn { font-size: 0.72em; font-weight: 400; color: #9ca3af; white-space: nowrap; }
@media (min-width: 1024px) {
  .lg\:grid-cols-5 { grid-template-columns: repeat(5,1fr); }
}
