/* =============================================================
   DAMA — Design tokens

   Every colour in the system resolves to one of these variables,
   and every one of them is editable per-user from
   Settings → Appearance → Brand studio. Nothing is hardcoded.
   ============================================================= */
:root {
  /* ---- Brand (teal-blue/green) ---- */
  --dama-brand:         #0D9488;
  --dama-brand-2:       #14B8A6;
  --dama-brand-soft:    #D8F1EE;
  --dama-brand-deep:    #0A6E63;
  --dama-on-brand:      #FFFFFF;   /* text that sits ON a brand-filled surface */
  --dama-accent:        #0EA5A0;
  --dama-on-accent:     #FFFFFF;

  /* Legacy aliases — kept so older rules keep resolving */
  --dama-purple:        var(--dama-brand);
  --dama-purple-dark:   var(--dama-brand-deep);
  --dama-purple-deep:   var(--dama-brand-deep);
  --dama-purple-light:  var(--dama-brand-2);
  --dama-purple-50:     var(--dama-brand-soft);
  --dama-purple-100:    var(--dama-brand-soft);
  --dama-purple-200:    var(--dama-brand-soft);
  --dama-violet:        var(--dama-brand);
  --dama-violet-2:      var(--dama-brand-2);
  --dama-violet-soft:   var(--dama-brand-soft);
  --dama-violet-deep:   var(--dama-brand-deep);
  --dama-green:         var(--dama-brand-soft);
  --dama-green-dark:    var(--dama-brand-deep);
  --dama-green-light:   var(--dama-brand-soft);
  --dama-green-50:      var(--dama-brand-soft);
  --dama-white:         var(--dama-surface);
  --dama-line:          var(--dama-hair);
  --dama-bg:            var(--dama-canvas);
  --dama-red:           var(--dama-neg);
  --dama-amber:         var(--dama-warn);

  /* ---- Surfaces ---- */
  --dama-canvas:        #F4FBF8;   /* page background */
  --dama-surface:       #FFFFFF;   /* card background */
  --dama-surface-2:     #F8FBFA;   /* alternate card background */
  --dama-tint:          #EDF6F2;   /* muted panel / inset */
  --dama-hair:          #E1EDE7;   /* borders and dividers */
  --dama-hair-2:        var(--dama-hair);

  /* ---- Text ---- */
  --dama-ink:           #14211A;   /* primary body text */
  --dama-ink-2:         #374A40;   /* secondary text */
  --dama-muted:         #6E857A;   /* tertiary / captions */

  /* ---- Meaning: positive (income, savings, done) ---- */
  --dama-pos:           #12855F;
  --dama-pos-deep:      #0A6E55;
  --dama-pos-soft:      #E0F3E9;
  --dama-on-pos:        #FFFFFF;

  /* ---- Meaning: negative (expense, debt, overdue) ---- */
  --dama-neg:           #C0392B;
  --dama-neg-deep:      #9E2B20;
  --dama-neg-soft:      #FBE9E7;
  --dama-on-neg:        #FFFFFF;

  /* ---- Meaning: warning ---- */
  --dama-warn:          #B7791F;
  --dama-warn-soft:     #FDF3E0;
  --dama-on-warn:       #FFFFFF;

  /* ---- Meaning: information ---- */
  --dama-info:          #2F6FD0;
  --dama-info-soft:     #E3EDFB;
  --dama-on-info:       #FFFFFF;

  /* ---- Dark tile (contrast panels) ---- */
  --dama-navy:          #14332C;
  --dama-navy-2:        #1E4A40;
  --dama-on-navy:       #FFFFFF;

  /* ---- KPI tile washes ---- */
  --dama-tile-1:        var(--dama-brand-soft);
  --dama-tile-2:        var(--dama-pos-soft);
  --dama-tile-3:        var(--dama-info-soft);
  --dama-tile-4:        var(--dama-warn-soft);
  --dama-tile-5:        var(--dama-tint);
  --dama-tile-6:        var(--dama-neg-soft);
  /* Older tile aliases */
  --dama-tile-peach:    var(--dama-tile-4);
  --dama-tile-mint:     var(--dama-tile-2);
  --dama-tile-lilac:    var(--dama-tile-1);
  --dama-tile-aqua:     var(--dama-tile-1);
  --dama-tile-blue:     var(--dama-tile-3);
  --dama-tile-pink:     var(--dama-tile-6);

  --dama-radius:        20px;
  --dama-radius-lg:     26px;
  --dama-radius-sm:     14px;

  --dama-shadow-sm:     0 1px 2px rgba(15,20,25,0.06), 0 1px 3px rgba(15,20,25,0.04);
  --dama-shadow:        0 4px 12px rgba(15,20,25,0.06), 0 2px 4px rgba(15,20,25,0.04);
  --dama-shadow-md:     0 8px 20px rgba(15,20,25,0.08), 0 3px 6px rgba(15,20,25,0.04);
  --dama-shadow-lg:     0 20px 40px rgba(15,20,25,0.10), 0 6px 12px rgba(15,20,25,0.05);
  --dama-shadow-emerald:0 8px 24px rgba(14,143,110,0.20);

  --dama-font:          Arial, 'Poppins', 'Helvetica Neue', Helvetica, sans-serif;
  --dama-font-display:  'Poppins', Arial, 'Helvetica Neue', sans-serif;
}

/* =============================================================
   Reset scope
   ============================================================= */
#dama-app, #dama-app *, .dama-auth-shell, .dama-auth-shell * {
  box-sizing: border-box;
}
/* Body copy: Arial for maximum universal legibility */
#dama-app, .dama-auth-shell {
  font-family: var(--dama-font);
  color: var(--dama-ink);
}
/* Display type: Poppins for a beautiful, geometric heading feel */
#dama-app h1, #dama-app h2, #dama-app h3,
.dama-auth-shell h1, .dama-auth-shell h2, .dama-auth-shell h3,
.dama-hello, .dama-view-head h1,
.dama-card-title, .dama-side-title,
.dama-kpi-value, .dama-split-value, .dama-gauge-value,
.dama-brand-name, .dama-auth-title, .dama-budget-title,
.dama-fin-kpi-net, .dama-cal-title, .dama-profile-name-big {
  font-family: var(--dama-font-display) !important;
  color: var(--dama-ink) !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  border: none !important;
  text-transform: none !important;
  text-shadow: none !important;
  background: transparent !important;
  letter-spacing: -0.5px !important;
}
#dama-app h1 { font-size: 30px !important; font-weight: 800 !important; }
#dama-app h2 { font-size: 22px !important; font-weight: 700 !important; }
#dama-app h3 { font-size: 18px !important; font-weight: 700 !important; }
#dama-app .dama-hello { font-size: 30px !important; font-weight: 800 !important; margin: 4px 0 12px !important; }
#dama-app p  { margin: 0 0 8px !important; }
#dama-app ul, #dama-app ol { margin: 0 !important; padding: 0 !important; list-style: none !important; }
#dama-app li { margin: 0 !important; padding: 0 !important; }
#dama-app a { text-decoration: none !important; color: inherit; }
#dama-app button, .dama-auth-shell button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}
#dama-app {
  font-size: 15px;
  line-height: 1.55;
  background: var(--dama-bg);
  padding: 22px;
  min-height: 100vh;
}

/* Glass utilities — kept LIGHT for performance. Heavy blur/saturate causes GPU lag.
   backdrop-filter is applied only on a few showcase elements now. */
.glass {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(230,230,240,0.7);
}
.glass-strong {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(230,230,240,0.8);
}

/* Force text INPUTS to inherit typography (many browsers don't).
   Buttons intentionally NOT included — they need to keep their own color (e.g. white on gradient). */
#dama-app input, #dama-app textarea, #dama-app select,
.dama-auth-shell input, .dama-auth-shell textarea, .dama-auth-shell select {
  font-family: inherit;
  color: var(--dama-ink);
}
#dama-app button, .dama-auth-shell button { font-family: inherit; }
#dama-app input::placeholder, #dama-app textarea::placeholder,
.dama-auth-shell input::placeholder, .dama-auth-shell textarea::placeholder {
  color: var(--dama-muted);
  opacity: 1;
}

/* Guarantee WHITE text on every dark surface, regardless of what parents set. */
.dama-split-tile--dark, .dama-split-tile--dark *,
.dama-payout-card, .dama-payout-card *,
.dama-pill-btn--primary,
.dama-fin-kpi--primary, .dama-fin-kpi--primary *,
.dama-round-btn--dark,
.dama-admin-banner, .dama-admin-banner *,
.dama-auth-side, .dama-auth-side *,
.dama-cal-task {
  color: var(--dama-surface) !important;
}
/* Restore the accent-yellow/red money colors inside dark payout card */
.dama-payout-card .dama-payout-amt--r { color: var(--dama-neg-soft) !important; }
.dama-payout-card .dama-payout-amt--g { color: var(--dama-warn-soft) !important; }
/* Chip and check-list markers inside dark surfaces */
.dama-auth-side .dama-check-list li::before { color: var(--dama-surface) !important; }
.dama-split-tile--dark .dama-chip { color: var(--dama-green-dark) !important; }

/* =============================================================
   Notices
   ============================================================= */
.dama-notice {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-weight: 500;
  background: var(--dama-purple-100);
  color: var(--dama-purple-dark);
  border: 1px solid var(--dama-purple-200);
}
.dama-notice--success { background: var(--dama-green-50); color: var(--dama-green-dark); border-color: var(--dama-green-light); }
.dama-notice--error   { background: var(--dama-neg-soft); color: var(--dama-neg-deep); border-color: var(--dama-neg-soft); }

.dama-admin-banner {
  background: var(--dama-navy);
  color: var(--dama-surface) !important;
  padding: 12px 18px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dama-admin-banner * { color: var(--dama-surface) !important; }
.dama-admin-banner a { color:var(--dama-surface); text-decoration:underline; margin-left:auto; }

/* =============================================================
   Top bar
   ============================================================= */
.dama-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 18px;
  margin-bottom: 22px;
  background: var(--dama-surface);
  border: 1px solid var(--dama-line);
  box-shadow: var(--dama-shadow-sm);
  position: relative;
}
.dama-brand { display: flex; align-items: center; gap: 10px; padding-right: 8px; }
.dama-logo {
  width: 42px; height: 42px;
  background: var(--dama-purple);
  color: var(--dama-surface);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px;
  box-shadow: none;
}
.dama-logo--big { width: 56px; height: 56px; font-size: 26px; border-radius: 16px; }
.dama-brand-name { font-weight: 800; letter-spacing: -0.4px; font-size: 20px; color: var(--dama-ink); }

.dama-switcher {
  position: relative;
  display: flex;
  background: var(--dama-tint);
  border-radius: 999px;
  padding: 4px;
  flex-wrap: wrap;
  gap: 2px;
}
.dama-switch-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 9px 18px; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--dama-muted);
  transition: color 0.2s, background 0.2s;
  display: flex; align-items: center; gap: 8px;
}
.dama-switch-btn .dot { width:6px; height:6px; border-radius:50%; background: currentColor; opacity:0.5; }
.dama-switch-btn:hover:not(.is-active) { background: rgba(0,0,0,0.03); color: var(--dama-ink); }
.dama-switch-btn.is-active {
  color: var(--dama-surface) !important;
  background: var(--dama-purple) !important;
  box-shadow: none;
}
.dama-switch-btn.is-active .dot { opacity: 1; background:var(--dama-surface); }
.dama-switcher-pill { display: none; }

.dama-topbar-right { display: flex; align-items: center; gap: 8px; }
.dama-icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.6);
  cursor: pointer; color: var(--dama-ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, background 0.2s;
}
.dama-icon-btn svg { width: 18px; height: 18px; }
.dama-icon-btn:hover { background: var(--dama-purple-100); color: var(--dama-purple-dark);  }
.dama-avatar-wrap { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid var(--dama-purple-light); }
.dama-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =============================================================
   Views
   ============================================================= */
/* View base — hidden by default, shown when .is-active. !important guards against theme CSS. */
.dama-view { display: none !important; }
.dama-view.is-active { display: block !important; }

.dama-crumb { font-size: 13px; color: var(--dama-muted); }
.dama-crumb span { margin: 0 6px; }
.dama-hello, .dama-view-head h1 {
  font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 4px 0 22px;
  color: var(--dama-ink);
}
.dama-greeting, .dama-view-head {
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.dama-greeting-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dama-pill-btn {
  border: none; background: rgba(255,255,255,0.75);
  color: var(--dama-ink);
  padding: 11px 22px;
  border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer;
  box-shadow: var(--dama-shadow-sm);
  border: 1px solid var(--dama-line);
  transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s;
}
.dama-pill-btn:hover {  box-shadow: var(--dama-shadow); }
.dama-pill-btn--primary {
  background: var(--dama-purple) !important;
  color: var(--dama-surface) !important;
  border-color: transparent;
  box-shadow: none;
}
.dama-pill-btn--primary:hover { background: var(--dama-purple-dark) !important; box-shadow: none; }
.dama-btn-block { width: 100%; display: block; }
.dama-text-btn { background: none; border: none; color: var(--dama-muted); cursor: pointer; font-family: inherit; font-size: 13px; text-decoration: underline; }

.muted { color: var(--dama-muted); }

/* =============================================================
   Dashboard grid layout
   ============================================================= */
/* =============================================================
   NEW dashboard grid — inspired by OFSPACE.CO reference
   4 colored KPI tiles across top, then featured card + side panels
   ============================================================= */
.dama-view[data-view-name="dashboard"].is-active {
  display: block;
}
.dama-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 18px;
}

/* Coloured KPI tile — flat pastel background, big number, tiny arrow */
.dama-kpi-tile {
  border-radius: 20px;
  padding: 22px;
  color: var(--dama-ink);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--dama-shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}
.dama-kpi-tile::after {
  /* Subtle inner sheen — top-left highlight, adds depth */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
  border-radius: 20px 20px 0 0;
}
.dama-kpi-tile:hover {
  box-shadow: var(--dama-shadow-md);
  transform: translateY(-2px);
}
.dama-kpi-tile > * { position: relative; z-index: 1; }
.dama-kpi-tile--t1 { background-color: var(--dama-tile-1) !important; color: var(--dama-ink); }
.dama-kpi-tile--t2 { background-color: var(--dama-tile-2) !important; color: var(--dama-ink); }
.dama-kpi-tile--t3 { background-color: var(--dama-tile-3) !important; color: var(--dama-ink); }
.dama-kpi-tile--t4 { background-color: var(--dama-tile-4) !important; color: var(--dama-ink); }
.dama-kpi-tile--t5 { background-color: var(--dama-tile-5) !important; color: var(--dama-ink); }
.dama-kpi-tile--t6 { background-color: var(--dama-tile-6) !important; color: var(--dama-ink); }
/* Legacy aliases */
.dama-kpi-tile--peach { background-color: var(--dama-tile-4) !important; }
.dama-kpi-tile--mint  { background-color: var(--dama-tile-2) !important; }
.dama-kpi-tile--lilac { background-color: var(--dama-tile-1) !important; }
.dama-kpi-tile--aqua  { background-color: var(--dama-tile-1) !important; }
.dama-kpi-tile--blue  { background-color: var(--dama-tile-3) !important; }
.dama-kpi-tile--pink  { background-color: var(--dama-tile-6) !important; }

.dama-kpi-tile-head {
  display: flex; justify-content: space-between; align-items: start;
}
.dama-kpi-tile-label {
  font-size: 13px; color: var(--dama-ink); opacity: 0.7; font-weight: 500;
}
.dama-kpi-tile-arrow {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.75);
  color: var(--dama-ink);
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 14px; font-weight: 600;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dama-kpi-tile-arrow:hover { background: var(--dama-surface); transform: rotate(15deg); }
.dama-kpi-tile-value {
  font-family: var(--dama-font-display);
  font-size: 30px; font-weight: 800; letter-spacing: -0.8px;
  color: var(--dama-ink);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.dama-kpi-tile-sub {
  font-size: 12px; color: var(--dama-ink); opacity: 0.6;
}

/* Featured emerald card — spans 2 columns */
.dama-featured {
  grid-column: span 2;
  background: var(--dama-purple);
  color: var(--dama-surface);
  border-radius: 24px;
  padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 260px;
  box-shadow: var(--dama-shadow-emerald);
  position: relative;
  overflow: hidden;
}
.dama-featured::before {
  /* Subtle sheen top-right */
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}
.dama-featured > * { position: relative; z-index: 1; }
.dama-featured * { color: var(--dama-surface); }
.dama-featured-head { display: flex; justify-content: space-between; align-items: start; }
.dama-featured-title { font-size: 22px !important; font-weight: 700 !important; font-family: var(--dama-font-display) !important; color: var(--dama-surface) !important; }
.dama-featured-value {
  font-family: var(--dama-font-display);
  font-size: 34px; font-weight: 800; letter-spacing: -0.8px; margin-top: 6px;
}
.dama-featured-delta {
  display: inline-block; font-size: 12px; padding: 3px 10px;
  background: rgba(255,255,255,0.22); border-radius: 999px; margin-left: 8px;
  font-weight: 600;
}
.dama-featured-pill {
  background: rgba(255,255,255,0.22); padding: 7px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.dama-featured-chart { flex: 1; min-height: 160px; position: relative; }

/* Glass-morphed cards — subtle, no expensive blur */
.dama-card--glass {
  grid-column: span 2;
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  box-shadow: var(--dama-shadow);
  border-radius: 20px;
  padding: 22px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.dama-card--glass:hover { box-shadow: var(--dama-shadow-md); transform: translateY(-1px); }

.dama-card {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: var(--dama-radius);
  padding: 22px;
  box-shadow: var(--dama-shadow);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.dama-card:hover { box-shadow: var(--dama-shadow-md); }
/* Income figures card — clean numbers only */
.dama-card--income .dama-income-big {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin: 12px 0;
  color: var(--dama-purple-dark);
}
.dama-card--income .dama-income-rows {
  border-top: 1px dashed var(--dama-line);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.dama-card--income .dama-income-row {
  display: flex; justify-content: space-between; font-size: 14px;
  color: var(--dama-muted);
}
.dama-card--income .dama-income-row strong { color: var(--dama-ink); font-weight: 700; }
.dama-round-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--dama-line);
  color: var(--dama-purple-dark);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, background 0.2s;
}
.dama-round-btn svg { width: 16px; height: 16px; }
.dama-round-btn:hover {  background: var(--dama-purple-100); }
.dama-round-btn--dark { background: var(--dama-navy); color: var(--dama-surface); border-color: transparent; }
.dama-round-btn--dark:hover { background: var(--dama-navy-2); }

/* KPI card (mimics 46.5) */
.dama-card--kpi { display: flex; flex-direction: column; gap: 8px; }
.dama-kpi-top { display: flex; align-items: center; gap: 12px; }
.dama-kpi-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--dama-navy);
  color: var(--dama-surface);
  display:flex;align-items:center;justify-content:center;
}
.dama-kpi-icon svg { width: 20px; height: 20px; }
.dama-kpi-value { font-size: 42px; font-weight: 800; letter-spacing: -1.5px; }
.dama-kpi-label { color: var(--dama-muted); font-size: 14px; margin-top: -6px; }
.dama-chip {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--dama-green-light); color: var(--dama-green-dark);
}
.dama-chip--green { background: var(--dama-green-light); color: var(--dama-green-dark); }
.dama-chip--red   { background: var(--dama-neg-soft); color: var(--dama-red); }
.dama-dot-chart {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
}
.dama-dot-chart .d {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--dama-purple-100);
  min-height: 6px;
}
.dama-dot-chart .d.--m { background: var(--dama-purple-light); }
.dama-dot-chart .d.--h { background: var(--dama-purple); }
.dama-dot-chart .d.--u { background: var(--dama-navy); }
.dama-kpi-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--dama-muted); }
.dama-dot-legend { display: flex; gap: 4px; }
.dama-dot-legend .dot { width:10px; height:10px; border-radius:50%; }
.dama-dot-legend .dot--l { background: var(--dama-purple-100); }
.dama-dot-legend .dot--m { background: var(--dama-purple-light); }
.dama-dot-legend .dot--h { background: var(--dama-purple); }
.dama-dot-legend .dot--u { background: var(--dama-navy); }

/* Split tile (the 80/20 card) */
.dama-split-card {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: transparent; box-shadow: none;
}
.dama-split-tile {
  border-radius: var(--dama-radius);
  padding: 20px;
  min-height: 180px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--dama-surface);
}
.dama-split-tile--dark { background: var(--dama-navy); }
.dama-split-tile--outline {
  background: rgba(255,255,255,0.75);
  color: var(--dama-ink);
  border: 1px dashed var(--dama-purple-light);
}
.dama-split-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
}
.dama-split-tile--outline .dama-split-icon { background: var(--dama-purple-100); color: var(--dama-purple-dark); }
.dama-split-icon svg { width: 20px; height: 20px; }
.dama-split-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.dama-split-label { font-size: 12px; opacity: 0.75; margin-top: -4px; }

/* Chart card */
.dama-card--chart .dama-card-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.dama-card-title-sm { color: var(--dama-muted); font-size: 13px; font-weight: 500; }
.dama-card-title { font-size: 20px; font-weight: 800; margin-top: 2px; letter-spacing: -0.4px; }
.dama-card-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 12px; gap: 12px; }
.dama-card-foot { display:flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--dama-muted); }
.pip { width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; }
.pip--g { background: var(--dama-green); }
.pip--gray { background: var(--dama-hair); }

/* Gauge card */
.dama-gauge { position: relative; margin: 6px auto; text-align: center; height: 130px; }
.dama-gauge-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -20%); text-align: center;
}
.dama-gauge-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.dama-gauge-label { color: var(--dama-muted); font-size: 12px; }
.dama-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dama-legend-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.dama-legend-key { display: flex; align-items: center; gap: 8px; }
.dama-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Upcoming list */
.dama-upcoming { list-style: none; padding: 0; margin: 12px 0; }
.dama-upcoming li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
}
.dama-upcoming li:last-child { border-bottom: none; }
.dama-upcoming-priority { width: 6px; height: 32px; border-radius: 4px; background: var(--dama-purple); }
.dama-upcoming-title { flex: 1; font-weight: 600; }
.dama-upcoming-when { color: var(--dama-muted); font-size: 12px; }
.dama-bar-chart {
  display: flex; gap: 6px; align-items: end;
  height: 60px; margin-top: 8px;
}
.dama-bar-chart .bar {
  flex: 1;
  background: var(--dama-green);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  opacity: 0.9;
}
.dama-bar-chart .bar.gray { background: var(--dama-hair); }

/* Side / right column */
.dama-side { padding: 22px; border-radius: var(--dama-radius); box-shadow: var(--dama-shadow-sm); position: sticky; top: 20px; align-self: start; }
.dama-side-title-sm { color: var(--dama-muted); font-size: 13px; }
.dama-side-title { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin-top: 2px; margin-bottom: 12px; }
.dama-recent-list { list-style: none; padding: 0; margin: 12px 0 20px; }
.dama-recent-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background 0.2s;
}
.dama-recent-list li:hover { background: var(--dama-purple-50); }
.dama-recent-avatar {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden;
  background: var(--dama-tile-mint); display: flex; align-items: center; justify-content: center;
  color: var(--dama-purple); font-weight:800; font-size: 18px;
}
.dama-recent-info { flex: 1; }
.dama-recent-name { font-weight: 600; font-size: 14px; }
.dama-recent-meta { color: var(--dama-muted); font-size: 12px; }
.dama-recent-status { padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.dama-recent-status.--in { background: var(--dama-tile-mint); color: var(--dama-purple-dark); }
.dama-recent-status.--ex { background: var(--dama-tile-peach); color: var(--dama-green-dark); }
.dama-payout-card {
  background: var(--dama-navy);
  color: var(--dama-surface);
  border-radius: var(--dama-radius);
  padding: 18px;
  margin-top: 14px;
}
.dama-payout-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.dama-payout-row + .dama-payout-row { border-top: 1px solid rgba(255,255,255,0.08); }
.dama-payout-row--big { font-size: 22px; font-weight: 800; margin-top: 6px; padding-top: 12px; }
.dama-payout-amt { font-weight: 700; }
.dama-payout-amt--r { color: var(--dama-neg-soft); }
.dama-payout-amt--g { color: var(--dama-green); }
.dama-payout-foot { display: flex; justify-content: end; margin-top: 12px; }
.dama-payout-foot .dama-round-btn { background: var(--dama-green); color:var(--dama-surface); border-color: transparent; }

/* =============================================================
   Tasks view
   ============================================================= */
.dama-tasks-toolbar {
  display: flex; gap: 10px; padding: 14px; border-radius: var(--dama-radius);
  margin-bottom: 16px; flex-wrap: wrap;
}
.dama-tasks-toolbar .dama-input { flex: 1; min-width: 180px; }

.dama-tabs { display: inline-flex; background: var(--dama-purple-50); padding: 4px; border-radius: 999px; }
.dama-tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 13px; color: var(--dama-muted); cursor: pointer;
}
.dama-tab.is-active { background: var(--dama-surface); color: var(--dama-purple-dark); box-shadow: var(--dama-shadow-sm); }
.dama-tab-panel { display: none; }
.dama-tab-panel.is-active { display: block; }

/* =============================================================
   Money grid — dashboard + finance income/expense breakdown
   Two big panels (income = green tint, expense = warm tint) each with
   three cells: week / month (emphasized) / year.
   ============================================================= */
.dama-money-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.dama-money-section {
  border-radius: 22px;
  padding: 22px 26px;
  box-shadow: var(--dama-shadow);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.dama-money-section--income {
  background: linear-gradient(135deg, var(--dama-pos-soft) 0%, var(--dama-pos-soft) 100%);
  border-color: rgba(13,148,136,0.15);
}
.dama-money-section--expense {
  background: linear-gradient(135deg, var(--dama-warn-soft) 0%, var(--dama-neg-soft) 100%);
  border-color: rgba(229,72,77,0.15);
}
.dama-money-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.dama-money-section-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dama-surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dama-money-section-icon--in  { background: var(--dama-pos); }
.dama-money-section-icon--out { background: var(--dama-neg); }
.dama-money-section-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
  letter-spacing: -0.3px !important;
}
.dama-money-cells {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 12px;
}
.dama-money-cell {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.dama-money-cell--emphasis {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transform: scale(1.02);
}
.dama-money-cell-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dama-muted);
  margin-bottom: 4px;
}
.dama-money-cell-value {
  font-family: var(--dama-font-display);
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.dama-money-cell--emphasis .dama-money-cell-value {
  font-size: 22px !important;
}
.dama-money-section--income .dama-money-cell-value { color: var(--dama-pos-deep) !important; }
.dama-money-section--expense .dama-money-cell-value { color: var(--dama-neg-deep) !important; }

@media (max-width: 900px) {
  .dama-money-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dama-money-cells { grid-template-columns: 1fr; }
  .dama-money-cell--emphasis { transform: none; }
}

/* =============================================================
   Debts section — Finance page
   ============================================================= */
.dama-debt-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 18px;
}
.dama-debt-summary-tile {
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
}
.dama-debt-summary-tile--out { background: var(--dama-warn-soft); border-color: rgba(229,72,77,0.15); }
.dama-debt-summary-tile--in  { background: var(--dama-pos-soft); border-color: rgba(13,148,136,0.15); }
.dama-debt-summary-tile--net { background: var(--dama-brand-soft); border-color: rgba(13,148,136,0.18); }
.dama-debt-summary-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dama-muted);
  margin-bottom: 6px;
}
.dama-debt-summary-value {
  font-family: var(--dama-font-display);
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
}
.dama-debt-summary-tile--out .dama-debt-summary-value { color: var(--dama-neg-deep) !important; }
.dama-debt-summary-tile--in  .dama-debt-summary-value { color: var(--dama-brand-deep) !important; }
.dama-debt-summary-tile--net .dama-debt-summary-value { color: var(--dama-brand-deep) !important; }

.dama-debt-list { display: flex; flex-direction: column; gap: 10px; }
.dama-debt-item {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.dama-debt-item:hover { box-shadow: var(--dama-shadow-md); transform: translateY(-1px); }
.dama-debt-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dama-debt-badge--i-owe      { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-debt-badge--owed-to-me { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-debt-badge--paid       { background: var(--dama-hair); color: var(--dama-muted); }
.dama-debt-badge--partial    { background: var(--dama-warn-soft); color: var(--dama-warn); }
.dama-debt-item-main {
  min-width: 0;
}
.dama-debt-item-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--dama-ink);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-debt-item-meta {
  font-size: 12px;
  color: var(--dama-muted);
}
.dama-debt-item-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 15px;
  text-align: right;
  color: var(--dama-ink);
  white-space: nowrap;
}
.dama-debt-item-actions { display: flex; gap: 4px; }
.dama-debt-item-actions button {
  background: transparent;
  border: 1px solid var(--dama-hair);
  color: var(--dama-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.dama-debt-item-actions button:hover { background: var(--dama-purple); color: var(--dama-surface); border-color: var(--dama-purple); }
.dama-debt-item-actions button.--pay { color: var(--dama-pos-deep); border-color: var(--dama-pos-soft); }
.dama-debt-item-actions button.--pay:hover { background: var(--dama-pos-deep); color: var(--dama-surface); border-color: var(--dama-pos-deep); }
.dama-debt-item-actions button.--danger:hover { background: var(--dama-neg-deep); border-color: var(--dama-neg-deep); color: var(--dama-surface); }

@media (max-width: 700px) {
  .dama-debt-summary { grid-template-columns: 1fr; }
  .dama-debt-item {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .dama-debt-item-amount { text-align: left; }
}

/* Debts rendered with the transaction node styles — badge alignment */
.dama-debt-row .dama-tx-row-title,
.dama-debt-card .dama-tx-card-title { display: flex; align-items: center; gap: 8px; white-space: normal; }
.dama-debt-row .dama-tx-row-title { flex-wrap: wrap; }
.dama-debt-row .dama-debt-badge,
.dama-debt-card .dama-debt-badge { flex: none; }
.dama-debt-card .dama-tx-card-top { justify-content: space-between; }
.dama-debts-card .dama-split { margin-top: 4px; }

/* =============================================================
   Glass task cards — beautiful frosted look
   ============================================================= */
.dama-task-item {
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.85) !important;
  box-shadow: 0 6px 20px rgba(15,20,25,0.06), 0 1px 3px rgba(15,20,25,0.04) !important;
}
.dama-task-item::before {
  width: 4px !important;
  border-radius: 4px 0 0 4px;
  box-shadow: 0 0 12px var(--dama-priority-color, var(--dama-purple));
}
.dama-task-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
  border-radius: 18px 18px 0 0;
}
.dama-task-item > * { position: relative; z-index: 1; }
.dama-task-item:hover {
  box-shadow: 0 12px 30px rgba(15,20,25,0.10), 0 3px 8px rgba(15,20,25,0.06) !important;
  transform: translateY(-3px);
  border-color: rgba(255,255,255,1) !important;
}
.dama-task-item.is-completed {
  background: rgba(245,245,247,0.6) !important;
}
/* =============================================================
   Two-panel Tasks layout — Today (highlighted) + All-other-tasks
   ============================================================= */

/* ---- TODAY panel ---- */
.dama-today-panel {
  background: linear-gradient(135deg, var(--dama-pos-soft) 0%, var(--dama-pos-soft) 50%, var(--dama-pos-soft) 100%);
  border: 1px solid rgba(14,143,110,0.2);
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 30px;
  box-shadow: 0 8px 28px rgba(14,143,110,0.12), 0 2px 6px rgba(14,143,110,0.06);
  position: relative;
  overflow: hidden;
}
.dama-today-panel::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 220px; height: 220px;
  background: radial-gradient(circle at top right, rgba(13,148,136,0.15), transparent 60%);
  pointer-events: none;
}
.dama-today-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  gap: 16px;
  flex-wrap: wrap;
}
.dama-today-panel-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.dama-today-panel-date {
  width: 68px; height: 68px;
  background: var(--dama-pos);
  color: var(--dama-surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(14,143,110,0.35);
  flex-shrink: 0;
}
.today-day-num {
  font-family: var(--dama-font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}
.today-day-mon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 3px;
  opacity: 0.9;
}
.today-panel-crumb {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dama-pos-deep);
  opacity: 0.75;
  margin-bottom: 4px;
}
.today-panel-h2 {
  font-family: var(--dama-font-display);
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--dama-ink-2) !important;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0 !important;
}
.dama-today-panel-count {
  background: var(--dama-surface);
  border-radius: 14px;
  padding: 12px 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(14,143,110,0.1);
  border: 1px solid rgba(14,143,110,0.1);
}
.dama-today-panel-count > span:first-child {
  display: block;
  font-family: var(--dama-font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--dama-pos-deep);
  line-height: 1;
}
.today-count-lbl {
  display: block;
  font-size: 11px;
  color: var(--dama-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}
.today-toolbar {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.9);
  position: relative;
  z-index: 1;
}
.today-empty {
  background: rgba(255,255,255,0.85);
  padding: 30px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--dama-pos-deep);
  font-weight: 600;
  border-radius: 14px;
  border: 1px dashed rgba(14,143,110,0.3);
}

/* Today panel — TX variant: count pill also shows Income + Expense totals */
.today-tx-count { min-width: 220px; }
.today-tx-count-row { display: block; }
.today-tx-count-num {
  font-family: var(--dama-font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--dama-pos-deep);
  line-height: 1;
}
.today-tx-count-money {
  font-size: 11px;
  color: var(--dama-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.today-tx-count-money strong {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.today-tx-in-lbl { color: var(--dama-pos); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.today-tx-ex-lbl { color: var(--dama-neg); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.today-tx-sep    { color: var(--dama-muted); }
@media (max-width: 700px) {
  .today-tx-count { min-width: 0; }
  .today-tx-count-money { justify-content: flex-start; }
}

/* ---- OTHER panel ---- */
.dama-other-panel {
  background: transparent;
}
.dama-other-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
  flex-wrap: wrap;
}
.other-panel-h2 {
  font-family: var(--dama-font-display);
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
  letter-spacing: -0.4px;
  margin: 0 !important;
}
.other-panel-sub {
  font-size: 12px;
  color: var(--dama-muted);
  margin-top: 3px;
}
.dama-other-panel-count {
  font-size: 12px;
  color: var(--dama-muted);
  padding: 6px 12px;
  background: var(--dama-tint);
  border-radius: 999px;
  font-weight: 600;
}
.dama-other-panel-count > span:first-child {
  color: var(--dama-ink);
  font-weight: 800;
}

/* Mobile: everything stacks + goes tighter */
@media (max-width: 700px) {
  .dama-today-panel { padding: 18px 16px; border-radius: 18px; margin-bottom: 22px; }
  .dama-today-panel-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .dama-today-panel-title { justify-content: flex-start; }
  .dama-today-panel-date { width: 56px; height: 56px; }
  .today-day-num { font-size: 24px; }
  .today-panel-h2 { font-size: 17px !important; }
  .dama-today-panel-count { padding: 10px 16px; }
  .dama-today-panel-count > span:first-child { font-size: 22px; }
  .dama-other-panel-head { flex-direction: column; align-items: flex-start; }
}
.dama-view-mode {
  display: inline-flex;
  gap: 2px;
  background: var(--dama-tint);
  padding: 3px;
  border-radius: 10px;
}
.dama-view-mode-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--dama-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.dama-view-mode-btn:hover { background: rgba(0,0,0,0.05); color: var(--dama-ink); }
.dama-view-mode-btn.is-active { background: var(--dama-surface); color: var(--dama-purple); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* =============================================================
   Task container — layout depends on the view mode
   ============================================================= */
.dama-task-list {
  display: grid;
  gap: 12px;
}
.dama-task-list--grid    { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.dama-task-list--list    { grid-template-columns: 1fr; gap: 10px; }
.dama-task-list--compact { grid-template-columns: 1fr; gap: 4px; }

/* =============================================================
   Task LIST row — the OFSPACE-style row with a coloured date badge
   ============================================================= */
.dama-task-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}
.dama-task-row:hover {
  box-shadow: 0 4px 12px rgba(15,20,25,0.08);
  transform: translateY(-1px);
  border-color: var(--dama-hair);
}
.dama-task-row.is-completed { background: var(--dama-surface-2); }
.dama-task-row.is-completed .dama-task-row-title { text-decoration: line-through; color: var(--dama-muted); }
.dama-task-row.is-overdue    { border-left: 4px solid var(--dama-neg); }

/* Colored date badge — big DAY + small MON */
.dama-task-date {
  width: 60px; height: 60px;
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--dama-hair);
  color: var(--dama-ink-2);
  font-family: var(--dama-font-display);
  flex-shrink: 0;
}
.dama-task-date--today   { background: var(--dama-pos); color: var(--dama-surface); }
.dama-task-date--overdue { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-task-date--done    { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-date-day { font-size: 20px; font-weight: 800; line-height: 1; }
.dama-task-date-mon { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; margin-top: 2px; opacity: 0.85; }

.dama-task-row-main { min-width: 0; }
.dama-task-row-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--dama-ink);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-task-row-meta {
  font-size: 12px;
  color: var(--dama-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-task-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Additional badge state for "today" */
.dama-task-badge.--st-today { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }

/* =============================================================
   Task COMPACT row — dense single line
   ============================================================= */
.dama-task-compact {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  background: var(--dama-surface);
  border-bottom: 1px solid var(--dama-hair);
  transition: background 0.15s;
}
.dama-task-compact:hover { background: var(--dama-surface-2); }
.dama-task-compact.is-completed .dama-task-compact-title {
  text-decoration: line-through; color: var(--dama-muted);
}
.dama-task-compact.is-overdue .dama-task-compact-title { color: var(--dama-neg-deep); font-weight: 700; }
.dama-task-compact:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.dama-task-compact:last-child  { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; border-bottom: none; }

.dama-task-compact-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dama-task-compact-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--dama-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-task-compact-when {
  font-size: 12px;
  color: var(--dama-muted);
  white-space: nowrap;
}
.dama-task-compact .dama-task-actions { gap: 2px; }
.dama-task-compact .dama-task-actions button { padding: 4px 6px; }

/* Mobile: list rows collapse gracefully */
@media (max-width: 700px) {
  .dama-task-row {
    grid-template-columns: 52px 1fr;
    gap: 12px;
    padding: 10px 12px;
  }
  .dama-task-date { width: 52px; height: 52px; }
  .dama-task-date-day { font-size: 18px; }
  .dama-task-row-right {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed var(--dama-hair);
    margin-top: 4px;
  }
  .dama-task-compact {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .dama-task-compact-when { display: none; }
  .dama-task-compact .dama-task-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Toolbar spacing so view-mode buttons fit */
.dama-tasks-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
}
.dama-tasks-toolbar .dama-input { min-width: 140px; }
.dama-tasks-toolbar #task-search { flex: 1; min-width: 180px; }
@media (max-width: 700px) {
  .dama-tasks-toolbar { padding: 10px; gap: 8px; }
  .dama-tasks-toolbar .dama-input { min-width: 0; width: 100%; }
  .dama-view-mode { width: 100%; justify-content: center; }
  .dama-view-mode-btn { flex: 1; padding: 10px; min-height: 44px; }
}

/* =============================================================
   Original grid card style (preserved)
   ============================================================= */
.dama-task-item {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--dama-shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.dama-task-item::before {
  /* Vertical priority stripe on the left */
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 5px;
  background: var(--dama-priority-color, var(--dama-purple));
}
.dama-task-item:hover {
  box-shadow: var(--dama-shadow-md);
  transform: translateY(-2px);
  border-color: var(--dama-hair);
}
.dama-task-item.is-completed { background: var(--dama-surface-2); }
.dama-task-item.is-completed .dama-task-title { text-decoration: line-through; color: var(--dama-muted); }

.dama-task-header {
  display: flex; align-items: start; justify-content: space-between; gap: 10px;
}
.dama-task-title {
  font-weight: 700 !important; font-size: 16px !important;
  color: var(--dama-ink);
  line-height: 1.35;
  flex: 1;
}
.dama-task-priority-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--dama-priority-tint, var(--dama-pos-soft));
  color: var(--dama-priority-color, var(--dama-purple));
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 800; font-size: 12px;
}

.dama-task-desc {
  color: var(--dama-muted);
  font-size: 13px; line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dama-task-meta {
  display: flex; gap: 6px; font-size: 11px; align-items: center; flex-wrap: wrap;
}
.dama-task-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.dama-task-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.dama-task-badge.--pri-low      { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-badge.--pri-medium   { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-badge.--pri-high     { background: var(--dama-warn-soft); color: var(--dama-warn); }
.dama-task-badge.--pri-urgent   { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-task-badge.--st-completed { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-badge.--st-pending   { background: var(--dama-tint); color: var(--dama-muted); }
.dama-task-badge.--st-in_progress { background: var(--dama-info-soft); color: var(--dama-info); }
.dama-task-badge.--overdue      { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

.dama-task-when {
  display: flex; align-items: center; gap: 6px;
  color: var(--dama-muted);
  font-size: 12px;
  padding: 4px 10px;
  background: var(--dama-tint);
  border-radius: 999px;
  font-weight: 500;
  margin-left: auto;
}
.dama-task-when svg { width: 12px; height: 12px; opacity: 0.7; }

.dama-task-footer {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--dama-hair);
  align-items: center;
}
.dama-task-category-tag {
  font-size: 11px; color: var(--dama-muted);
  padding: 3px 10px;
  background: var(--dama-tint);
  border-radius: 999px;
  font-weight: 500;
}

.dama-task-actions {
  display: flex; gap: 4px;
  margin-left: auto;
}
.dama-task-actions button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--dama-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dama-task-actions button:hover {
  background: var(--dama-pos-soft);
  color: var(--dama-purple);
  border-color: transparent;
}
.dama-task-actions button.--complete:hover { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-actions button.--danger:hover { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

/* Calendar */
.dama-calendar { padding: 20px; border-radius: var(--dama-radius); }
.dama-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dama-cal-title { font-weight: 800; font-size: 20px; }
.dama-cal-nav { display: flex; gap: 8px; }
.dama-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.dama-cal-daylabel { font-size: 11px; color: var(--dama-muted); text-align: center; padding: 6px 0; font-weight: 700; text-transform: uppercase; }
.dama-cal-cell {
  min-height: 90px; border-radius: 12px; padding: 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--dama-line);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s;
}
.dama-cal-cell:hover {  box-shadow: var(--dama-shadow-sm); }
.dama-cal-cell.other-month { opacity: 0.35; }
.dama-cal-cell.today { border: 2px solid var(--dama-purple); background: var(--dama-purple-50); }
.dama-cal-date { font-weight: 700; font-size: 13px; }
.dama-cal-task {
  background: var(--dama-purple);
  color: var(--dama-surface);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dama-cal-task.--overdue { background: var(--dama-red); }
.dama-cal-task.--completed { background: var(--dama-green-dark); text-decoration: line-through; opacity: 0.7; }

/* =============================================================
   Finance view
   ============================================================= */
.dama-fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.dama-fin-kpi { padding: 16px 18px; border-radius: var(--dama-radius); }
.dama-fin-kpi-label { color: var(--dama-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
.dama-fin-kpi-net { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-top: 4px; }
.dama-fin-kpi-sub { color: var(--dama-muted); font-size: 12px; margin-top: 4px; }
.dama-fin-kpi--primary { background: var(--dama-purple) !important; color:var(--dama-surface) !important; border: none; }
.dama-fin-kpi--primary * { color: var(--dama-surface) !important; }
.dama-fin-kpi--primary .dama-fin-kpi-label, .dama-fin-kpi--primary .dama-fin-kpi-sub { color: rgba(255,255,255,0.85); }

.dama-fin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dama-fin-grid { grid-template-columns: 1fr; } }

/* Shrunk chart wrappers — keep charts compact so they don't eat page height */
.dama-mini-chart-wrap {
  height: 140px;
  position: relative;
  margin-top: 8px;
}
.dama-mini-chart-wrap canvas { max-height: 140px !important; }

/* =============================================================
   Transaction views — three modes matching the task design system
   ============================================================= */
.dama-tx-list           { display: grid; gap: 8px; }
.dama-tx-list--list     { grid-template-columns: 1fr; gap: 8px; }
.dama-tx-list--compact  { grid-template-columns: 1fr; gap: 2px; }
.dama-tx-list--grid     { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ---- LIST mode: colored date badge + main + amount + actions ---- */
.dama-tx-row {
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  gap: 14px;
  align-items: center;
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.dama-tx-row:hover { box-shadow: 0 4px 10px rgba(15,20,25,0.06); transform: translateY(-1px); }
.dama-tx-date {
  width: 54px; height: 54px;
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--dama-font-display);
  font-weight: 800;
  flex-shrink: 0;
}
.dama-tx-date.--income  { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-tx-date.--expense { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-tx-date > span:first-child { font-size: 18px; line-height: 1; }
.dama-tx-date .mon { font-size: 9px; letter-spacing: 0.5px; margin-top: 2px; opacity: 0.85; }
.dama-tx-row-main { min-width: 0; }
.dama-tx-row-title {
  font-size: 14px; font-weight: 700; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
}
.dama-tx-row-meta { font-size: 11px; color: var(--dama-muted); text-transform: capitalize; }
.dama-tx-row-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dama-tx-row-amount.--income  { color: var(--dama-pos); }
.dama-tx-row-amount.--expense { color: var(--dama-neg); }

/* ---- COMPACT mode: single dense row ---- */
.dama-tx-compact {
  display: grid;
  grid-template-columns: 8px 1fr auto auto auto auto;
  gap: 10px;
  align-items: center;
  background: var(--dama-surface);
  border-bottom: 1px solid var(--dama-tint);
  padding: 8px 14px;
  transition: background 0.15s;
}
.dama-tx-compact:hover { background: var(--dama-surface-2); }
.dama-tx-compact:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.dama-tx-compact:last-child  { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-bottom: none; }
.dama-tx-compact-dot { width: 8px; height: 8px; border-radius: 50%; }
.dama-tx-compact-dot.--income  { background: var(--dama-pos); }
.dama-tx-compact-dot.--expense { background: var(--dama-neg); }
.dama-tx-compact-title {
  font-size: 13px; font-weight: 600; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-tx-compact-cat, .dama-tx-compact-when {
  font-size: 11px; color: var(--dama-muted);
  text-transform: capitalize;
  white-space: nowrap;
}
.dama-tx-compact-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dama-tx-compact-amount.--income  { color: var(--dama-pos); }
.dama-tx-compact-amount.--expense { color: var(--dama-neg); }

/* ---- GRID mode: card style ---- */
.dama-tx-card {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
}
.dama-tx-card:hover { box-shadow: 0 6px 16px rgba(15,20,25,0.08); transform: translateY(-2px); }
.dama-tx-card.--income  { border-left: 3px solid var(--dama-pos); }
.dama-tx-card.--expense { border-left: 3px solid var(--dama-neg); }
.dama-tx-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dama-tx-card .dama-tx-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px;
}
.dama-tx-card.--income  .dama-tx-icon { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-tx-card.--expense .dama-tx-icon { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-tx-type-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.dama-tx-type-pill.--income  { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-tx-type-pill.--expense { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-tx-card-title {
  font-size: 14px; font-weight: 700; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 4px;
}
.dama-tx-card-meta {
  font-size: 11px; color: var(--dama-muted);
  margin-bottom: 12px;
  text-transform: capitalize;
}
.dama-tx-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--dama-tint);
}
.dama-tx-card-date { font-size: 11px; color: var(--dama-muted); }
.dama-tx-card-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.dama-tx-card-amount.--income  { color: var(--dama-pos); }
.dama-tx-card-amount.--expense { color: var(--dama-neg); }

/* Actions common to all three modes */
.dama-tx-row .dama-tx-actions,
.dama-tx-compact .dama-tx-actions {
  display: flex;
  gap: 2px;
}
.dama-tx-card .dama-tx-actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.dama-tx-card:hover .dama-tx-actions { opacity: 1; }
.dama-tx-actions button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--dama-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.dama-tx-actions button:hover { background: var(--dama-tint); color: var(--dama-ink); }
.dama-tx-actions button.--danger:hover { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

/* Mobile refinements */
@media (max-width: 700px) {
  .dama-tx-row {
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .dama-tx-date { width: 44px; height: 44px; }
  .dama-tx-date > span:first-child { font-size: 15px; }
  .dama-tx-row .dama-tx-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px dashed var(--dama-hair);
  }
  .dama-tx-compact { grid-template-columns: 8px 1fr auto auto; padding: 10px 12px; }
  .dama-tx-compact-cat, .dama-tx-compact-when { display: none; }
  .dama-tx-list--grid { grid-template-columns: 1fr; }
  .dama-tx-card .dama-tx-actions { opacity: 1; }
}

/* Fallback: keep old .dama-tx-item styles for anything still using them */
.dama-tx-item {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  border: 1px solid var(--dama-line);
}
.dama-tx-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--dama-purple-50); color: var(--dama-purple-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.dama-tx-item.--income .dama-tx-icon { background: var(--dama-green-50); color: var(--dama-green-dark); }
.dama-tx-item.--expense .dama-tx-icon { background: var(--dama-neg-soft); color: var(--dama-red); }
.dama-tx-info { display: flex; flex-direction: column; }
.dama-tx-desc { font-weight: 600; font-size: 14px; }
.dama-tx-meta { color: var(--dama-muted); font-size: 12px; }
.dama-tx-amount { font-weight: 800; font-size: 16px; }
.dama-tx-item.--income .dama-tx-amount { color: var(--dama-green-dark); }
.dama-tx-item.--expense .dama-tx-amount { color: var(--dama-red); }
.dama-tx-actions button {
  background: none; border: none; color: var(--dama-muted); cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.dama-tx-actions button:hover { background: var(--dama-neg-soft); color: var(--dama-red); }

/* =============================================================
   Budgets
   ============================================================= */
.dama-budgets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.dama-budget-card {
  background: rgba(255,255,255,0.85);
  border-radius: var(--dama-radius);
  padding: 22px;
  box-shadow: var(--dama-shadow-sm);
  border-top: 6px solid var(--dama-green);
}
.dama-budget-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 12px; }
.dama-budget-title { font-weight: 800; font-size: 18px; }
.dama-budget-period { color: var(--dama-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.dama-progress {
  height: 8px; background: var(--dama-purple-100); border-radius: 999px; overflow: hidden; margin: 12px 0;
}
.dama-progress-bar { height: 100%; background: var(--dama-purple); border-radius: 999px; transition: width 0.4s ease; }
.dama-budget-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--dama-muted); margin-bottom: 10px; }
.dama-budget-items { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.dama-budget-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(245, 243, 255, 0.6);
  border: 1px solid var(--dama-purple-100);
  transition: background 0.2s;
}
.dama-budget-item.purchased { background: var(--dama-green-50); border-color: var(--dama-green-light); }
.dama-budget-item.purchased .dama-budget-item-name { text-decoration: line-through; color: var(--dama-muted); }
.dama-budget-item input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--dama-green-dark); cursor: pointer;
}
.dama-budget-item-name { flex: 1; font-weight: 500; font-size: 14px; }
.dama-budget-item-amount { font-weight: 700; font-size: 14px; color: var(--dama-purple-dark); }
.dama-budget-item.purchased .dama-budget-item-amount { color: var(--dama-green-dark); }
.dama-budget-item-remove { background: none; border: none; color: var(--dama-muted); cursor: pointer; padding: 2px; }
.dama-budget-item-remove:hover { color: var(--dama-red); }

.dama-add-item-form { display: flex; gap: 6px; margin-top: 8px; }
.dama-add-item-form input { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--dama-line); font-family: inherit; font-size: 13px; }
.dama-add-item-form input:focus { outline: none; border-color: var(--dama-purple); }
.dama-add-item-form button { padding: 8px 14px; border-radius: 10px; border: none; background: var(--dama-purple); color: var(--dama-surface); font-family: inherit; cursor: pointer; font-weight: 600; }

.dama-budget-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--dama-line); }

/* =============================================================
   Profile view
   ============================================================= */
.dama-profile-grid { display: grid; grid-template-columns: 320px 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dama-profile-grid { grid-template-columns: 1fr; } }
.dama-avatar-big { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid var(--dama-line); box-shadow: var(--dama-shadow-sm); }
.dama-profile-name-big { font-size: 22px; font-weight: 800; margin-top: 14px; letter-spacing: -0.5px; }
.dama-file-btn {
  display: inline-block;
  background: var(--dama-purple);
  color: var(--dama-surface); padding: 10px 22px; border-radius: 999px; font-weight: 600; cursor: pointer;
  box-shadow: none;
}
.dama-file-btn:hover { background: var(--dama-purple-dark); }
.dama-file-btn input { display: none; }

/* Forms */
.dama-form { display: flex; flex-direction: column; gap: 14px; }
.dama-field { display: flex; flex-direction: column; gap: 6px; }
.dama-field label { font-size: 13px; color: var(--dama-muted); font-weight: 600; }
.dama-input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--dama-line); font-family: inherit; font-size: 14px;
  background: rgba(255,255,255,0.8);
  transition: border 0.2s, box-shadow 0.2s;
}
.dama-input:focus { outline: none; border-color: var(--dama-purple); box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.dama-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dama-field-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.dama-check { display: flex; align-items: center; gap: 8px; color: var(--dama-muted); font-size: 13px; }
.dama-link { color: var(--dama-purple-dark); text-decoration: none; font-weight: 600; }
.dama-link:hover { text-decoration: underline; }

/* =============================================================
   Modal
   ============================================================= */
.dama-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 20, 50, 0.45);
  
  display: none;
  align-items: center; justify-content: center;
  z-index: 99999;
  padding: 20px;
}
.dama-modal-backdrop.is-open { display: flex; }
.dama-modal {
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
  border-radius: var(--dama-radius-lg);
  padding: 30px;
  box-shadow: var(--dama-shadow-lg);
  position: relative;
  animation: dama-modal-in 0.3s cubic-bezier(0.4,0.0,0.2,1);
}
@keyframes dama-modal-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.dama-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,0.05); border: none; width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 22px; line-height: 1; color: var(--dama-muted);
}
.dama-modal-close:hover { background: var(--dama-red); color: var(--dama-surface); }
.dama-modal h2 { font-size: 22px; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.4px; }

/* =============================================================
   Auth screens
   ============================================================= */
/* =============================================================
   AUTH SCREENS — login, register, password reset.

   Two columns on a wide screen, one column on a tablet, and the
   marketing panel drops away entirely on a phone where it would
   only push the form below the fold. Sized in viewport units so
   it holds together from 320px to ultrawide.
   ============================================================= */
.dama-auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 2.5vw, 28px);
  padding: clamp(12px, 3vw, 34px);
  box-sizing: border-box;
  background:
    radial-gradient(1100px 560px at 92% -12%, var(--dama-brand-soft), transparent 62%),
    radial-gradient(880px 480px at -12% 112%, var(--dama-tint), transparent 60%),
    var(--dama-canvas);
  font-family: var(--dama-font-body, var(--dama-font));
  color: var(--dama-ink);
}
.dama-auth-shell * { box-sizing: border-box; }

.dama-auth-card, .dama-auth-side {
  border-radius: calc(var(--dama-radius, 18px) + 8px);
  padding: clamp(20px, 3.4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.dama-auth-card {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  box-shadow: 0 24px 60px -42px rgba(16,24,20,.55);
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}

.dama-auth-brand {
  display: flex; align-items: center; gap: clamp(10px, 2vw, 16px);
  margin-bottom: clamp(16px, 2.6vw, 26px);
  flex-wrap: wrap;
}
.dama-auth-brand svg { flex: none; width: clamp(40px, 7vw, 56px); height: auto; }
.dama-auth-title {
  font-family: var(--dama-font-display, inherit);
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
  color: var(--dama-ink);
}
.dama-auth-sub { color: var(--dama-muted); font-size: clamp(12.5px, 1.4vw, 14px); margin-top: 3px; }

.dama-auth-card .dama-field { margin-bottom: 14px; min-width: 0; }
.dama-auth-card .dama-field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--dama-ink-2); margin-bottom: 6px;
}
.dama-auth-card .dama-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;              /* 16px keeps iOS from zooming the page on focus */
  line-height: 1.35;
  border: 1px solid var(--dama-hair);
  border-radius: var(--dama-radius-sm, 12px);
  background: var(--dama-surface);
  color: var(--dama-ink);
  font-family: inherit;
}
.dama-auth-card .dama-input:focus {
  outline: none;
  border-color: var(--dama-brand);
  box-shadow: 0 0 0 3px var(--dama-brand-soft);
}
.dama-field-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin: 4px 0 16px; font-size: 13px;
}
.dama-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.dama-btn-block {
  width: 100%; justify-content: center;
  padding: 13px 18px; font-size: 15px;
  min-height: 46px;             /* comfortable touch target */
}
.dama-auth-swap {
  text-align: center; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--dama-hair);
  font-size: 13.5px; color: var(--dama-muted);
}
.dama-auth-card .dama-link { color: var(--dama-brand); font-weight: 600; text-decoration: none; }
.dama-auth-card .dama-link:hover { text-decoration: underline; }

.dama-auth-side {
  background: var(--dama-brand);
  color: var(--dama-on-brand);
  position: relative; overflow: hidden;
}
.dama-auth-side-inner {
  padding: clamp(18px, 3vw, 40px);
  border-radius: var(--dama-radius, 18px);
  background: rgba(255,255,255,0.10);
}
.dama-auth-side h2 {
  font-family: var(--dama-font-display, inherit);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-top: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.2;
}
.dama-auth-side p { font-size: clamp(13px, 1.5vw, 14.5px); line-height: 1.6; }
.dama-check-list { list-style: none; padding: 0; margin-top: 20px; }
.dama-check-list li {
  padding-left: 30px; position: relative; margin: 10px 0;
  font-size: clamp(12.5px, 1.4vw, 14px); line-height: 1.5;
}
.dama-check-list li::before {
  content: '\2713'; position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.22); color: var(--dama-on-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* Tablet — stack, keep the panel but make it secondary */
@media (max-width: 960px) {
  .dama-auth-shell { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .dama-auth-card { max-width: 560px; }
  .dama-auth-side { max-width: 560px; margin-inline: auto; width: 100%; }
  .dama-auth-side h2 { font-size: 1.35rem; }
}

/* Phone — the marketing panel only pushes the form down, so drop it */
@media (max-width: 680px) {
  .dama-auth-shell {
    padding: 12px;
    min-height: 100vh;
    align-content: center;
  }
  .dama-auth-side { display: none; }
  .dama-auth-card {
    max-width: 100%;
    padding: 22px 18px;
    border-radius: var(--dama-radius, 18px);
  }
  .dama-auth-brand { gap: 12px; margin-bottom: 18px; }
  .dama-auth-title { font-size: 1.3rem; }
}

/* Small phones */
@media (max-width: 380px) {
  .dama-auth-shell { padding: 8px; }
  .dama-auth-card { padding: 18px 14px; border-radius: 16px; }
  .dama-auth-brand svg { width: 38px; }
  .dama-auth-title { font-size: 1.18rem; }
  .dama-field-row { font-size: 12.5px; }
}

/* Landscape phones and short windows — never trap the button below the fold */
@media (max-height: 620px) and (max-width: 960px) {
  .dama-auth-shell {
    min-height: 0; align-items: start; align-content: start;
    padding-top: 14px; padding-bottom: 24px;
  }
  .dama-auth-brand { margin-bottom: 12px; }
  .dama-auth-card .dama-field { margin-bottom: 10px; }
}

/* Respect a user who asked for less motion */
@media (prefers-reduced-motion: reduce) {
  .dama-auth-shell, .dama-auth-card { transition: none !important; animation: none !important; }
}
.dama-chip--green { background: var(--dama-green-light); color: var(--dama-green-dark); }
.dama-chip--red   { background: var(--dama-neg-soft); color: var(--dama-red); }
.dama-dot-chart {
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
}
.dama-dot-chart .d {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--dama-purple-100);
  min-height: 6px;
}
.dama-dot-chart .d.--m { background: var(--dama-purple-light); }
.dama-dot-chart .d.--h { background: var(--dama-purple); }
.dama-dot-chart .d.--u { background: var(--dama-navy); }
.dama-kpi-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--dama-muted); }
.dama-dot-legend { display: flex; gap: 4px; }
.dama-dot-legend .dot { width:10px; height:10px; border-radius:50%; }
.dama-dot-legend .dot--l { background: var(--dama-purple-100); }
.dama-dot-legend .dot--m { background: var(--dama-purple-light); }
.dama-dot-legend .dot--h { background: var(--dama-purple); }
.dama-dot-legend .dot--u { background: var(--dama-navy); }

/* Split tile (the 80/20 card) */
.dama-split-card {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: transparent; box-shadow: none;
}
.dama-split-tile {
  border-radius: var(--dama-radius);
  padding: 20px;
  min-height: 180px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--dama-surface);
}
.dama-split-tile--dark { background: var(--dama-navy); }
.dama-split-tile--outline {
  background: rgba(255,255,255,0.75);
  color: var(--dama-ink);
  border: 1px dashed var(--dama-purple-light);
}
.dama-split-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
}
.dama-split-tile--outline .dama-split-icon { background: var(--dama-purple-100); color: var(--dama-purple-dark); }
.dama-split-icon svg { width: 20px; height: 20px; }
.dama-split-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.dama-split-label { font-size: 12px; opacity: 0.75; margin-top: -4px; }

/* Chart card */
.dama-card--chart .dama-card-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.dama-card-title-sm { color: var(--dama-muted); font-size: 13px; font-weight: 500; }
.dama-card-title { font-size: 20px; font-weight: 800; margin-top: 2px; letter-spacing: -0.4px; }
.dama-card-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 12px; gap: 12px; }
.dama-card-foot { display:flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--dama-muted); }
.pip { width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; }
.pip--g { background: var(--dama-green); }
.pip--gray { background: var(--dama-hair); }

/* Gauge card */
.dama-gauge { position: relative; margin: 6px auto; text-align: center; height: 130px; }
.dama-gauge-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -20%); text-align: center;
}
.dama-gauge-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.dama-gauge-label { color: var(--dama-muted); font-size: 12px; }
.dama-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dama-legend-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.dama-legend-key { display: flex; align-items: center; gap: 8px; }
.dama-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Upcoming list */
.dama-upcoming { list-style: none; padding: 0; margin: 12px 0; }
.dama-upcoming li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
}
.dama-upcoming li:last-child { border-bottom: none; }
.dama-upcoming-priority { width: 6px; height: 32px; border-radius: 4px; background: var(--dama-purple); }
.dama-upcoming-title { flex: 1; font-weight: 600; }
.dama-upcoming-when { color: var(--dama-muted); font-size: 12px; }
.dama-bar-chart {
  display: flex; gap: 6px; align-items: end;
  height: 60px; margin-top: 8px;
}
.dama-bar-chart .bar {
  flex: 1;
  background: var(--dama-green);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  opacity: 0.9;
}
.dama-bar-chart .bar.gray { background: var(--dama-hair); }

/* Side / right column */
.dama-side { padding: 22px; border-radius: var(--dama-radius); box-shadow: var(--dama-shadow-sm); position: sticky; top: 20px; align-self: start; }
.dama-side-title-sm { color: var(--dama-muted); font-size: 13px; }
.dama-side-title { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin-top: 2px; margin-bottom: 12px; }
.dama-recent-list { list-style: none; padding: 0; margin: 12px 0 20px; }
.dama-recent-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background 0.2s;
}
.dama-recent-list li:hover { background: var(--dama-purple-50); }
.dama-recent-avatar {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden;
  background: var(--dama-tile-mint); display: flex; align-items: center; justify-content: center;
  color: var(--dama-purple); font-weight:800; font-size: 18px;
}
.dama-recent-info { flex: 1; }
.dama-recent-name { font-weight: 600; font-size: 14px; }
.dama-recent-meta { color: var(--dama-muted); font-size: 12px; }
.dama-recent-status { padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.dama-recent-status.--in { background: var(--dama-tile-mint); color: var(--dama-purple-dark); }
.dama-recent-status.--ex { background: var(--dama-tile-peach); color: var(--dama-green-dark); }
.dama-payout-card {
  background: var(--dama-navy);
  color: var(--dama-surface);
  border-radius: var(--dama-radius);
  padding: 18px;
  margin-top: 14px;
}
.dama-payout-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.dama-payout-row + .dama-payout-row { border-top: 1px solid rgba(255,255,255,0.08); }
.dama-payout-row--big { font-size: 22px; font-weight: 800; margin-top: 6px; padding-top: 12px; }
.dama-payout-amt { font-weight: 700; }
.dama-payout-amt--r { color: var(--dama-neg-soft); }
.dama-payout-amt--g { color: var(--dama-green); }
.dama-payout-foot { display: flex; justify-content: end; margin-top: 12px; }
.dama-payout-foot .dama-round-btn { background: var(--dama-green); color:var(--dama-surface); border-color: transparent; }

/* =============================================================
   Tasks view
   ============================================================= */
.dama-tasks-toolbar {
  display: flex; gap: 10px; padding: 14px; border-radius: var(--dama-radius);
  margin-bottom: 16px; flex-wrap: wrap;
}
.dama-tasks-toolbar .dama-input { flex: 1; min-width: 180px; }

.dama-tabs { display: inline-flex; background: var(--dama-purple-50); padding: 4px; border-radius: 999px; }
.dama-tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 13px; color: var(--dama-muted); cursor: pointer;
}
.dama-tab.is-active { background: var(--dama-surface); color: var(--dama-purple-dark); box-shadow: var(--dama-shadow-sm); }
.dama-tab-panel { display: none; }
.dama-tab-panel.is-active { display: block; }

/* =============================================================
   Money grid — dashboard + finance income/expense breakdown
   Two big panels (income = green tint, expense = warm tint) each with
   three cells: week / month (emphasized) / year.
   ============================================================= */
.dama-money-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.dama-money-section {
  border-radius: 22px;
  padding: 22px 26px;
  box-shadow: var(--dama-shadow);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.dama-money-section--income {
  background: linear-gradient(135deg, var(--dama-pos-soft) 0%, var(--dama-pos-soft) 100%);
  border-color: rgba(13,148,136,0.15);
}
.dama-money-section--expense {
  background: linear-gradient(135deg, var(--dama-warn-soft) 0%, var(--dama-neg-soft) 100%);
  border-color: rgba(229,72,77,0.15);
}
.dama-money-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.dama-money-section-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dama-surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dama-money-section-icon--in  { background: var(--dama-pos); }
.dama-money-section-icon--out { background: var(--dama-neg); }
.dama-money-section-title {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
  letter-spacing: -0.3px !important;
}
.dama-money-cells {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 12px;
}
.dama-money-cell {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.dama-money-cell--emphasis {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transform: scale(1.02);
}
.dama-money-cell-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--dama-muted);
  margin-bottom: 4px;
}
.dama-money-cell-value {
  font-family: var(--dama-font-display);
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.dama-money-cell--emphasis .dama-money-cell-value {
  font-size: 22px !important;
}
.dama-money-section--income .dama-money-cell-value { color: var(--dama-pos-deep) !important; }
.dama-money-section--expense .dama-money-cell-value { color: var(--dama-neg-deep) !important; }

@media (max-width: 900px) {
  .dama-money-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dama-money-cells { grid-template-columns: 1fr; }
  .dama-money-cell--emphasis { transform: none; }
}

/* =============================================================
   Debts section — Finance page
   ============================================================= */
.dama-debt-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 18px;
}
.dama-debt-summary-tile {
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
}
.dama-debt-summary-tile--out { background: var(--dama-warn-soft); border-color: rgba(229,72,77,0.15); }
.dama-debt-summary-tile--in  { background: var(--dama-pos-soft); border-color: rgba(13,148,136,0.15); }
.dama-debt-summary-tile--net { background: var(--dama-brand-soft); border-color: rgba(13,148,136,0.18); }
.dama-debt-summary-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dama-muted);
  margin-bottom: 6px;
}
.dama-debt-summary-value {
  font-family: var(--dama-font-display);
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
}
.dama-debt-summary-tile--out .dama-debt-summary-value { color: var(--dama-neg-deep) !important; }
.dama-debt-summary-tile--in  .dama-debt-summary-value { color: var(--dama-brand-deep) !important; }
.dama-debt-summary-tile--net .dama-debt-summary-value { color: var(--dama-brand-deep) !important; }

.dama-debt-list { display: flex; flex-direction: column; gap: 10px; }
.dama-debt-item {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.dama-debt-item:hover { box-shadow: var(--dama-shadow-md); transform: translateY(-1px); }
.dama-debt-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dama-debt-badge--i-owe      { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-debt-badge--owed-to-me { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-debt-badge--paid       { background: var(--dama-hair); color: var(--dama-muted); }
.dama-debt-badge--partial    { background: var(--dama-warn-soft); color: var(--dama-warn); }
.dama-debt-item-main {
  min-width: 0;
}
.dama-debt-item-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--dama-ink);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-debt-item-meta {
  font-size: 12px;
  color: var(--dama-muted);
}
.dama-debt-item-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 15px;
  text-align: right;
  color: var(--dama-ink);
  white-space: nowrap;
}
.dama-debt-item-actions { display: flex; gap: 4px; }
.dama-debt-item-actions button {
  background: transparent;
  border: 1px solid var(--dama-hair);
  color: var(--dama-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.dama-debt-item-actions button:hover { background: var(--dama-purple); color: var(--dama-surface); border-color: var(--dama-purple); }
.dama-debt-item-actions button.--pay { color: var(--dama-pos-deep); border-color: var(--dama-pos-soft); }
.dama-debt-item-actions button.--pay:hover { background: var(--dama-pos-deep); color: var(--dama-surface); border-color: var(--dama-pos-deep); }
.dama-debt-item-actions button.--danger:hover { background: var(--dama-neg-deep); border-color: var(--dama-neg-deep); color: var(--dama-surface); }

@media (max-width: 700px) {
  .dama-debt-summary { grid-template-columns: 1fr; }
  .dama-debt-item {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .dama-debt-item-amount { text-align: left; }
}

/* Debts rendered with the transaction node styles — badge alignment */
.dama-debt-row .dama-tx-row-title,
.dama-debt-card .dama-tx-card-title { display: flex; align-items: center; gap: 8px; white-space: normal; }
.dama-debt-row .dama-tx-row-title { flex-wrap: wrap; }
.dama-debt-row .dama-debt-badge,
.dama-debt-card .dama-debt-badge { flex: none; }
.dama-debt-card .dama-tx-card-top { justify-content: space-between; }
.dama-debts-card .dama-split { margin-top: 4px; }

/* =============================================================
   Glass task cards — beautiful frosted look
   ============================================================= */
.dama-task-item {
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.85) !important;
  box-shadow: 0 6px 20px rgba(15,20,25,0.06), 0 1px 3px rgba(15,20,25,0.04) !important;
}
.dama-task-item::before {
  width: 4px !important;
  border-radius: 4px 0 0 4px;
  box-shadow: 0 0 12px var(--dama-priority-color, var(--dama-purple));
}
.dama-task-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  pointer-events: none;
  border-radius: 18px 18px 0 0;
}
.dama-task-item > * { position: relative; z-index: 1; }
.dama-task-item:hover {
  box-shadow: 0 12px 30px rgba(15,20,25,0.10), 0 3px 8px rgba(15,20,25,0.06) !important;
  transform: translateY(-3px);
  border-color: rgba(255,255,255,1) !important;
}
.dama-task-item.is-completed {
  background: rgba(245,245,247,0.6) !important;
}
/* =============================================================
   Two-panel Tasks layout — Today (highlighted) + All-other-tasks
   ============================================================= */

/* ---- TODAY panel ---- */
.dama-today-panel {
  background: linear-gradient(135deg, var(--dama-pos-soft) 0%, var(--dama-pos-soft) 50%, var(--dama-pos-soft) 100%);
  border: 1px solid rgba(14,143,110,0.2);
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 30px;
  box-shadow: 0 8px 28px rgba(14,143,110,0.12), 0 2px 6px rgba(14,143,110,0.06);
  position: relative;
  overflow: hidden;
}
.dama-today-panel::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 220px; height: 220px;
  background: radial-gradient(circle at top right, rgba(13,148,136,0.15), transparent 60%);
  pointer-events: none;
}
.dama-today-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  gap: 16px;
  flex-wrap: wrap;
}
.dama-today-panel-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.dama-today-panel-date {
  width: 68px; height: 68px;
  background: var(--dama-pos);
  color: var(--dama-surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(14,143,110,0.35);
  flex-shrink: 0;
}
.today-day-num {
  font-family: var(--dama-font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}
.today-day-mon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 3px;
  opacity: 0.9;
}
.today-panel-crumb {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dama-pos-deep);
  opacity: 0.75;
  margin-bottom: 4px;
}
.today-panel-h2 {
  font-family: var(--dama-font-display);
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--dama-ink-2) !important;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0 !important;
}
.dama-today-panel-count {
  background: var(--dama-surface);
  border-radius: 14px;
  padding: 12px 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(14,143,110,0.1);
  border: 1px solid rgba(14,143,110,0.1);
}
.dama-today-panel-count > span:first-child {
  display: block;
  font-family: var(--dama-font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--dama-pos-deep);
  line-height: 1;
}
.today-count-lbl {
  display: block;
  font-size: 11px;
  color: var(--dama-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}
.today-toolbar {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.9);
  position: relative;
  z-index: 1;
}
.today-empty {
  background: rgba(255,255,255,0.85);
  padding: 30px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--dama-pos-deep);
  font-weight: 600;
  border-radius: 14px;
  border: 1px dashed rgba(14,143,110,0.3);
}

/* Today panel — TX variant: count pill also shows Income + Expense totals */
.today-tx-count { min-width: 220px; }
.today-tx-count-row { display: block; }
.today-tx-count-num {
  font-family: var(--dama-font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--dama-pos-deep);
  line-height: 1;
}
.today-tx-count-money {
  font-size: 11px;
  color: var(--dama-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.today-tx-count-money strong {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.today-tx-in-lbl { color: var(--dama-pos); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.today-tx-ex-lbl { color: var(--dama-neg); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.today-tx-sep    { color: var(--dama-muted); }
@media (max-width: 700px) {
  .today-tx-count { min-width: 0; }
  .today-tx-count-money { justify-content: flex-start; }
}

/* ---- OTHER panel ---- */
.dama-other-panel {
  background: transparent;
}
.dama-other-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
  flex-wrap: wrap;
}
.other-panel-h2 {
  font-family: var(--dama-font-display);
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--dama-ink) !important;
  letter-spacing: -0.4px;
  margin: 0 !important;
}
.other-panel-sub {
  font-size: 12px;
  color: var(--dama-muted);
  margin-top: 3px;
}
.dama-other-panel-count {
  font-size: 12px;
  color: var(--dama-muted);
  padding: 6px 12px;
  background: var(--dama-tint);
  border-radius: 999px;
  font-weight: 600;
}
.dama-other-panel-count > span:first-child {
  color: var(--dama-ink);
  font-weight: 800;
}

/* Mobile: everything stacks + goes tighter */
@media (max-width: 700px) {
  .dama-today-panel { padding: 18px 16px; border-radius: 18px; margin-bottom: 22px; }
  .dama-today-panel-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .dama-today-panel-title { justify-content: flex-start; }
  .dama-today-panel-date { width: 56px; height: 56px; }
  .today-day-num { font-size: 24px; }
  .today-panel-h2 { font-size: 17px !important; }
  .dama-today-panel-count { padding: 10px 16px; }
  .dama-today-panel-count > span:first-child { font-size: 22px; }
  .dama-other-panel-head { flex-direction: column; align-items: flex-start; }
}
.dama-view-mode {
  display: inline-flex;
  gap: 2px;
  background: var(--dama-tint);
  padding: 3px;
  border-radius: 10px;
}
.dama-view-mode-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--dama-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.dama-view-mode-btn:hover { background: rgba(0,0,0,0.05); color: var(--dama-ink); }
.dama-view-mode-btn.is-active { background: var(--dama-surface); color: var(--dama-purple); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* =============================================================
   Task container — layout depends on the view mode
   ============================================================= */
.dama-task-list {
  display: grid;
  gap: 12px;
}
.dama-task-list--grid    { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.dama-task-list--list    { grid-template-columns: 1fr; gap: 10px; }
.dama-task-list--compact { grid-template-columns: 1fr; gap: 4px; }

/* =============================================================
   Task LIST row — the OFSPACE-style row with a coloured date badge
   ============================================================= */
.dama-task-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}
.dama-task-row:hover {
  box-shadow: 0 4px 12px rgba(15,20,25,0.08);
  transform: translateY(-1px);
  border-color: var(--dama-hair);
}
.dama-task-row.is-completed { background: var(--dama-surface-2); }
.dama-task-row.is-completed .dama-task-row-title { text-decoration: line-through; color: var(--dama-muted); }
.dama-task-row.is-overdue    { border-left: 4px solid var(--dama-neg); }

/* Colored date badge — big DAY + small MON */
.dama-task-date {
  width: 60px; height: 60px;
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--dama-hair);
  color: var(--dama-ink-2);
  font-family: var(--dama-font-display);
  flex-shrink: 0;
}
.dama-task-date--today   { background: var(--dama-pos); color: var(--dama-surface); }
.dama-task-date--overdue { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-task-date--done    { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-date-day { font-size: 20px; font-weight: 800; line-height: 1; }
.dama-task-date-mon { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; margin-top: 2px; opacity: 0.85; }

.dama-task-row-main { min-width: 0; }
.dama-task-row-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--dama-ink);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-task-row-meta {
  font-size: 12px;
  color: var(--dama-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-task-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Additional badge state for "today" */
.dama-task-badge.--st-today { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }

/* =============================================================
   Task COMPACT row — dense single line
   ============================================================= */
.dama-task-compact {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  background: var(--dama-surface);
  border-bottom: 1px solid var(--dama-hair);
  transition: background 0.15s;
}
.dama-task-compact:hover { background: var(--dama-surface-2); }
.dama-task-compact.is-completed .dama-task-compact-title {
  text-decoration: line-through; color: var(--dama-muted);
}
.dama-task-compact.is-overdue .dama-task-compact-title { color: var(--dama-neg-deep); font-weight: 700; }
.dama-task-compact:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.dama-task-compact:last-child  { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; border-bottom: none; }

.dama-task-compact-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dama-task-compact-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--dama-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dama-task-compact-when {
  font-size: 12px;
  color: var(--dama-muted);
  white-space: nowrap;
}
.dama-task-compact .dama-task-actions { gap: 2px; }
.dama-task-compact .dama-task-actions button { padding: 4px 6px; }

/* Mobile: list rows collapse gracefully */
@media (max-width: 700px) {
  .dama-task-row {
    grid-template-columns: 52px 1fr;
    gap: 12px;
    padding: 10px 12px;
  }
  .dama-task-date { width: 52px; height: 52px; }
  .dama-task-date-day { font-size: 18px; }
  .dama-task-row-right {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed var(--dama-hair);
    margin-top: 4px;
  }
  .dama-task-compact {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .dama-task-compact-when { display: none; }
  .dama-task-compact .dama-task-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Toolbar spacing so view-mode buttons fit */
.dama-tasks-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
}
.dama-tasks-toolbar .dama-input { min-width: 140px; }
.dama-tasks-toolbar #task-search { flex: 1; min-width: 180px; }
@media (max-width: 700px) {
  .dama-tasks-toolbar { padding: 10px; gap: 8px; }
  .dama-tasks-toolbar .dama-input { min-width: 0; width: 100%; }
  .dama-view-mode { width: 100%; justify-content: center; }
  .dama-view-mode-btn { flex: 1; padding: 10px; min-height: 44px; }
}

/* =============================================================
   Original grid card style (preserved)
   ============================================================= */
.dama-task-item {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--dama-shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.dama-task-item::before {
  /* Vertical priority stripe on the left */
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 5px;
  background: var(--dama-priority-color, var(--dama-purple));
}
.dama-task-item:hover {
  box-shadow: var(--dama-shadow-md);
  transform: translateY(-2px);
  border-color: var(--dama-hair);
}
.dama-task-item.is-completed { background: var(--dama-surface-2); }
.dama-task-item.is-completed .dama-task-title { text-decoration: line-through; color: var(--dama-muted); }

.dama-task-header {
  display: flex; align-items: start; justify-content: space-between; gap: 10px;
}
.dama-task-title {
  font-weight: 700 !important; font-size: 16px !important;
  color: var(--dama-ink);
  line-height: 1.35;
  flex: 1;
}
.dama-task-priority-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--dama-priority-tint, var(--dama-pos-soft));
  color: var(--dama-priority-color, var(--dama-purple));
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 800; font-size: 12px;
}

.dama-task-desc {
  color: var(--dama-muted);
  font-size: 13px; line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dama-task-meta {
  display: flex; gap: 6px; font-size: 11px; align-items: center; flex-wrap: wrap;
}
.dama-task-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
.dama-task-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.dama-task-badge.--pri-low      { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-badge.--pri-medium   { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-badge.--pri-high     { background: var(--dama-warn-soft); color: var(--dama-warn); }
.dama-task-badge.--pri-urgent   { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-task-badge.--st-completed { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-badge.--st-pending   { background: var(--dama-tint); color: var(--dama-muted); }
.dama-task-badge.--st-in_progress { background: var(--dama-info-soft); color: var(--dama-info); }
.dama-task-badge.--overdue      { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

.dama-task-when {
  display: flex; align-items: center; gap: 6px;
  color: var(--dama-muted);
  font-size: 12px;
  padding: 4px 10px;
  background: var(--dama-tint);
  border-radius: 999px;
  font-weight: 500;
  margin-left: auto;
}
.dama-task-when svg { width: 12px; height: 12px; opacity: 0.7; }

.dama-task-footer {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--dama-hair);
  align-items: center;
}
.dama-task-category-tag {
  font-size: 11px; color: var(--dama-muted);
  padding: 3px 10px;
  background: var(--dama-tint);
  border-radius: 999px;
  font-weight: 500;
}

.dama-task-actions {
  display: flex; gap: 4px;
  margin-left: auto;
}
.dama-task-actions button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--dama-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dama-task-actions button:hover {
  background: var(--dama-pos-soft);
  color: var(--dama-purple);
  border-color: transparent;
}
.dama-task-actions button.--complete:hover { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-task-actions button.--danger:hover { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

/* Calendar */
.dama-calendar { padding: 20px; border-radius: var(--dama-radius); }
.dama-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dama-cal-title { font-weight: 800; font-size: 20px; }
.dama-cal-nav { display: flex; gap: 8px; }
.dama-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.dama-cal-daylabel { font-size: 11px; color: var(--dama-muted); text-align: center; padding: 6px 0; font-weight: 700; text-transform: uppercase; }
.dama-cal-cell {
  min-height: 90px; border-radius: 12px; padding: 8px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--dama-line);
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s;
}
.dama-cal-cell:hover {  box-shadow: var(--dama-shadow-sm); }
.dama-cal-cell.other-month { opacity: 0.35; }
.dama-cal-cell.today { border: 2px solid var(--dama-purple); background: var(--dama-purple-50); }
.dama-cal-date { font-weight: 700; font-size: 13px; }
.dama-cal-task {
  background: var(--dama-purple);
  color: var(--dama-surface);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dama-cal-task.--overdue { background: var(--dama-red); }
.dama-cal-task.--completed { background: var(--dama-green-dark); text-decoration: line-through; opacity: 0.7; }

/* =============================================================
   Finance view
   ============================================================= */
.dama-fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.dama-fin-kpi { padding: 16px 18px; border-radius: var(--dama-radius); }
.dama-fin-kpi-label { color: var(--dama-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
.dama-fin-kpi-net { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-top: 4px; }
.dama-fin-kpi-sub { color: var(--dama-muted); font-size: 12px; margin-top: 4px; }
.dama-fin-kpi--primary { background: var(--dama-purple) !important; color:var(--dama-surface) !important; border: none; }
.dama-fin-kpi--primary * { color: var(--dama-surface) !important; }
.dama-fin-kpi--primary .dama-fin-kpi-label, .dama-fin-kpi--primary .dama-fin-kpi-sub { color: rgba(255,255,255,0.85); }

.dama-fin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dama-fin-grid { grid-template-columns: 1fr; } }

/* Shrunk chart wrappers — keep charts compact so they don't eat page height */
.dama-mini-chart-wrap {
  height: 140px;
  position: relative;
  margin-top: 8px;
}
.dama-mini-chart-wrap canvas { max-height: 140px !important; }

/* =============================================================
   Transaction views — three modes matching the task design system
   ============================================================= */
.dama-tx-list           { display: grid; gap: 8px; }
.dama-tx-list--list     { grid-template-columns: 1fr; gap: 8px; }
.dama-tx-list--compact  { grid-template-columns: 1fr; gap: 2px; }
.dama-tx-list--grid     { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ---- LIST mode: colored date badge + main + amount + actions ---- */
.dama-tx-row {
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  gap: 14px;
  align-items: center;
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.dama-tx-row:hover { box-shadow: 0 4px 10px rgba(15,20,25,0.06); transform: translateY(-1px); }
.dama-tx-date {
  width: 54px; height: 54px;
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--dama-font-display);
  font-weight: 800;
  flex-shrink: 0;
}
.dama-tx-date.--income  { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-tx-date.--expense { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-tx-date > span:first-child { font-size: 18px; line-height: 1; }
.dama-tx-date .mon { font-size: 9px; letter-spacing: 0.5px; margin-top: 2px; opacity: 0.85; }
.dama-tx-row-main { min-width: 0; }
.dama-tx-row-title {
  font-size: 14px; font-weight: 700; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
}
.dama-tx-row-meta { font-size: 11px; color: var(--dama-muted); text-transform: capitalize; }
.dama-tx-row-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dama-tx-row-amount.--income  { color: var(--dama-pos); }
.dama-tx-row-amount.--expense { color: var(--dama-neg); }

/* ---- COMPACT mode: single dense row ---- */
.dama-tx-compact {
  display: grid;
  grid-template-columns: 8px 1fr auto auto auto auto;
  gap: 10px;
  align-items: center;
  background: var(--dama-surface);
  border-bottom: 1px solid var(--dama-tint);
  padding: 8px 14px;
  transition: background 0.15s;
}
.dama-tx-compact:hover { background: var(--dama-surface-2); }
.dama-tx-compact:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.dama-tx-compact:last-child  { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-bottom: none; }
.dama-tx-compact-dot { width: 8px; height: 8px; border-radius: 50%; }
.dama-tx-compact-dot.--income  { background: var(--dama-pos); }
.dama-tx-compact-dot.--expense { background: var(--dama-neg); }
.dama-tx-compact-title {
  font-size: 13px; font-weight: 600; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-tx-compact-cat, .dama-tx-compact-when {
  font-size: 11px; color: var(--dama-muted);
  text-transform: capitalize;
  white-space: nowrap;
}
.dama-tx-compact-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dama-tx-compact-amount.--income  { color: var(--dama-pos); }
.dama-tx-compact-amount.--expense { color: var(--dama-neg); }

/* ---- GRID mode: card style ---- */
.dama-tx-card {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
}
.dama-tx-card:hover { box-shadow: 0 6px 16px rgba(15,20,25,0.08); transform: translateY(-2px); }
.dama-tx-card.--income  { border-left: 3px solid var(--dama-pos); }
.dama-tx-card.--expense { border-left: 3px solid var(--dama-neg); }
.dama-tx-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dama-tx-card .dama-tx-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px;
}
.dama-tx-card.--income  .dama-tx-icon { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-tx-card.--expense .dama-tx-icon { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-tx-type-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.dama-tx-type-pill.--income  { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-tx-type-pill.--expense { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-tx-card-title {
  font-size: 14px; font-weight: 700; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 4px;
}
.dama-tx-card-meta {
  font-size: 11px; color: var(--dama-muted);
  margin-bottom: 12px;
  text-transform: capitalize;
}
.dama-tx-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--dama-tint);
}
.dama-tx-card-date { font-size: 11px; color: var(--dama-muted); }
.dama-tx-card-amount {
  font-family: var(--dama-font-display);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.dama-tx-card-amount.--income  { color: var(--dama-pos); }
.dama-tx-card-amount.--expense { color: var(--dama-neg); }

/* Actions common to all three modes */
.dama-tx-row .dama-tx-actions,
.dama-tx-compact .dama-tx-actions {
  display: flex;
  gap: 2px;
}
.dama-tx-card .dama-tx-actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.dama-tx-card:hover .dama-tx-actions { opacity: 1; }
.dama-tx-actions button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--dama-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.dama-tx-actions button:hover { background: var(--dama-tint); color: var(--dama-ink); }
.dama-tx-actions button.--danger:hover { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

/* Mobile refinements */
@media (max-width: 700px) {
  .dama-tx-row {
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .dama-tx-date { width: 44px; height: 44px; }
  .dama-tx-date > span:first-child { font-size: 15px; }
  .dama-tx-row .dama-tx-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 6px;
    border-top: 1px dashed var(--dama-hair);
  }
  .dama-tx-compact { grid-template-columns: 8px 1fr auto auto; padding: 10px 12px; }
  .dama-tx-compact-cat, .dama-tx-compact-when { display: none; }
  .dama-tx-list--grid { grid-template-columns: 1fr; }
  .dama-tx-card .dama-tx-actions { opacity: 1; }
}

/* Fallback: keep old .dama-tx-item styles for anything still using them */
.dama-tx-item {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  border: 1px solid var(--dama-line);
}
.dama-tx-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--dama-purple-50); color: var(--dama-purple-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.dama-tx-item.--income .dama-tx-icon { background: var(--dama-green-50); color: var(--dama-green-dark); }
.dama-tx-item.--expense .dama-tx-icon { background: var(--dama-neg-soft); color: var(--dama-red); }
.dama-tx-info { display: flex; flex-direction: column; }
.dama-tx-desc { font-weight: 600; font-size: 14px; }
.dama-tx-meta { color: var(--dama-muted); font-size: 12px; }
.dama-tx-amount { font-weight: 800; font-size: 16px; }
.dama-tx-item.--income .dama-tx-amount { color: var(--dama-green-dark); }
.dama-tx-item.--expense .dama-tx-amount { color: var(--dama-red); }
.dama-tx-actions button {
  background: none; border: none; color: var(--dama-muted); cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.dama-tx-actions button:hover { background: var(--dama-neg-soft); color: var(--dama-red); }

/* =============================================================
   Budgets
   ============================================================= */
.dama-budgets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.dama-budget-card {
  background: rgba(255,255,255,0.85);
  border-radius: var(--dama-radius);
  padding: 22px;
  box-shadow: var(--dama-shadow-sm);
  border-top: 6px solid var(--dama-green);
}
.dama-budget-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 12px; }
.dama-budget-title { font-weight: 800; font-size: 18px; }
.dama-budget-period { color: var(--dama-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.dama-progress {
  height: 8px; background: var(--dama-purple-100); border-radius: 999px; overflow: hidden; margin: 12px 0;
}
.dama-progress-bar { height: 100%; background: var(--dama-purple); border-radius: 999px; transition: width 0.4s ease; }
.dama-budget-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--dama-muted); margin-bottom: 10px; }
.dama-budget-items { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.dama-budget-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(245, 243, 255, 0.6);
  border: 1px solid var(--dama-purple-100);
  transition: background 0.2s;
}
.dama-budget-item.purchased { background: var(--dama-green-50); border-color: var(--dama-green-light); }
.dama-budget-item.purchased .dama-budget-item-name { text-decoration: line-through; color: var(--dama-muted); }
.dama-budget-item input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--dama-green-dark); cursor: pointer;
}
.dama-budget-item-name { flex: 1; font-weight: 500; font-size: 14px; }
.dama-budget-item-amount { font-weight: 700; font-size: 14px; color: var(--dama-purple-dark); }
.dama-budget-item.purchased .dama-budget-item-amount { color: var(--dama-green-dark); }
.dama-budget-item-remove { background: none; border: none; color: var(--dama-muted); cursor: pointer; padding: 2px; }
.dama-budget-item-remove:hover { color: var(--dama-red); }

.dama-add-item-form { display: flex; gap: 6px; margin-top: 8px; }
.dama-add-item-form input { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--dama-line); font-family: inherit; font-size: 13px; }
.dama-add-item-form input:focus { outline: none; border-color: var(--dama-purple); }
.dama-add-item-form button { padding: 8px 14px; border-radius: 10px; border: none; background: var(--dama-purple); color: var(--dama-surface); font-family: inherit; cursor: pointer; font-weight: 600; }

.dama-budget-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--dama-line); }

/* =============================================================
   Profile view
   ============================================================= */
.dama-profile-grid { display: grid; grid-template-columns: 320px 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dama-profile-grid { grid-template-columns: 1fr; } }
.dama-avatar-big { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid var(--dama-line); box-shadow: var(--dama-shadow-sm); }
.dama-profile-name-big { font-size: 22px; font-weight: 800; margin-top: 14px; letter-spacing: -0.5px; }
.dama-file-btn {
  display: inline-block;
  background: var(--dama-purple);
  color: var(--dama-surface); padding: 10px 22px; border-radius: 999px; font-weight: 600; cursor: pointer;
  box-shadow: none;
}
.dama-file-btn:hover { background: var(--dama-purple-dark); }
.dama-file-btn input { display: none; }

/* Forms */
.dama-form { display: flex; flex-direction: column; gap: 14px; }
.dama-field { display: flex; flex-direction: column; gap: 6px; }
.dama-field label { font-size: 13px; color: var(--dama-muted); font-weight: 600; }
.dama-input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--dama-line); font-family: inherit; font-size: 14px;
  background: rgba(255,255,255,0.8);
  transition: border 0.2s, box-shadow 0.2s;
}
.dama-input:focus { outline: none; border-color: var(--dama-purple); box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.dama-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dama-field-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.dama-check { display: flex; align-items: center; gap: 8px; color: var(--dama-muted); font-size: 13px; }
.dama-link { color: var(--dama-purple-dark); text-decoration: none; font-weight: 600; }
.dama-link:hover { text-decoration: underline; }

/* =============================================================
   Modal
   ============================================================= */
.dama-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(30, 20, 50, 0.45);
  
  display: none;
  align-items: center; justify-content: center;
  z-index: 99999;
  padding: 20px;
}
.dama-modal-backdrop.is-open { display: flex; }
.dama-modal {
  max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
  border-radius: var(--dama-radius-lg);
  padding: 30px;
  box-shadow: var(--dama-shadow-lg);
  position: relative;
  animation: dama-modal-in 0.3s cubic-bezier(0.4,0.0,0.2,1);
}
@keyframes dama-modal-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.dama-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,0.05); border: none; width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 22px; line-height: 1; color: var(--dama-muted);
}
.dama-modal-close:hover { background: var(--dama-red); color: var(--dama-surface); }
.dama-modal h2 { font-size: 22px; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.4px; }

/* =============================================================
   Auth screens
   ============================================================= */


/* Admin users grid */
.dama-users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.dama-user-card {
  padding: 16px; border-radius: 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--dama-line);
  text-align: center; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s;
}
.dama-user-card:hover {  box-shadow: var(--dama-shadow); border-color: var(--dama-purple-light); }
.dama-user-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }
.dama-user-card-name { font-weight: 700; font-size: 14px; }
.dama-user-card-email { color: var(--dama-muted); font-size: 12px; }

/* =============================================================
   Hamburger toggle (mobile only)
   ============================================================= */
.dama-hamburger {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s;
}
.dama-hamburger:hover { background: rgba(0,0,0,0.05); }
.dama-hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--dama-ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.dama-hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.dama-hamburger.is-open span:nth-child(2) { opacity: 0; }
.dama-hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 1100px) {
  .dama-grid { grid-template-columns: repeat(2, 1fr); }
  .dama-featured { grid-column: span 2; }
  .dama-card--glass { grid-column: span 2; }
}

/* ----- Tablet ----- */
@media (max-width: 900px) {
  #dama-app { padding: 16px; }
  .dama-hello, .dama-view-head h1 { font-size: 28px !important; }
}

/* ----- Phone ----- */
@media (max-width: 700px) {
  #dama-app { padding: 10px; }

  /* Topbar becomes a compact bar with a hamburger */
  .dama-topbar {
    padding: 10px 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .dama-brand { flex: 1; }
  .dama-brand-name { font-size: 17px !important; }
  .dama-hamburger { display: inline-flex; order: 2; }

  /* Switcher becomes a drawer that toggles open */
  .dama-switcher {
    display: none !important;
    order: 5;
    width: 100%;
    flex-direction: column;
    background: rgba(255,255,255,0.98) !important;
    padding: 8px !important;
    gap: 4px !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    animation: dama-slidedown 0.2s ease;
  }
  .dama-switcher.is-open { display: flex !important; }
  @keyframes dama-slidedown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .dama-switch-btn {
    justify-content: flex-start !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
    min-height: 44px;  /* iOS touch target */
    width: 100%;
  }
  .dama-switcher-pill { display: none !important; }

  /* Right-side icons stay in the topbar next to hamburger */
  .dama-topbar-right { order: 3; gap: 4px; }
  .dama-icon-btn {
    width: 40px; height: 40px;
    min-width: 40px;
  }
  .dama-avatar-wrap { width: 36px; height: 36px; }
  .dama-avatar { width: 36px; height: 36px; }

  /* Greeting stacks */
  .dama-greeting, .dama-view-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px;
    margin-bottom: 18px;
  }
  .dama-hello, .dama-view-head h1 { font-size: 22px !important; margin: 4px 0 !important; }
  .dama-crumb { font-size: 12px; }

  /* Action buttons wrap and take full width */
  .dama-greeting-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .dama-greeting-actions .dama-pill-btn {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px !important;
    font-size: 14px !important;
    justify-content: center;
  }

  /* Money grid stacks vertically */
  .dama-money-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin-bottom: 16px;
  }
  .dama-money-section {
    padding: 16px !important;
    border-radius: 18px;
  }
  .dama-money-cells {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px;
  }
  .dama-money-cell {
    padding: 10px 12px !important;
    text-align: center;
  }
  .dama-money-cell--emphasis { transform: none !important; }
  .dama-money-cell-label { font-size: 10px !important; letter-spacing: 0.3px; }
  .dama-money-cell-value { font-size: 14px !important; }
  .dama-money-cell--emphasis .dama-money-cell-value { font-size: 16px !important; }
  .dama-money-section-title { font-size: 15px !important; }
  .dama-money-section-icon { width: 32px !important; height: 32px !important; }

  /* KPI tiles stack */
  .dama-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .dama-featured, .dama-card--glass { grid-column: auto; }
  .dama-kpi-tile { padding: 16px !important; min-height: auto !important; }
  .dama-kpi-tile-value { font-size: 24px !important; }
  .dama-featured { padding: 18px !important; min-height: 200px !important; }
  .dama-featured-title { font-size: 18px !important; }
  .dama-featured-value { font-size: 24px !important; }
  .dama-card { padding: 16px !important; }
  .dama-card-title { font-size: 15px !important; }

  /* Debt items go single-column */
  .dama-debt-summary { grid-template-columns: 1fr !important; gap: 8px; }
  .dama-debt-summary-tile { padding: 12px 14px !important; }
  .dama-debt-summary-value { font-size: 18px !important; }
  .dama-debt-item {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }
  .dama-debt-item-amount { text-align: left; }
  .dama-debt-item-actions { justify-content: flex-start; flex-wrap: wrap; }
  .dama-debt-item-actions button { min-height: 36px; padding: 6px 12px !important; }

  /* Task cards */
  .dama-task-list { grid-template-columns: 1fr !important; }
  .dama-task-item { padding: 14px 16px !important; }
  .dama-task-title { font-size: 15px !important; }
  .dama-task-actions button { padding: 8px 12px !important; font-size: 13px !important; min-height: 36px; }

  /* Split card */
  .dama-split-card { grid-template-columns: 1fr !important; }
  .dama-row { grid-template-columns: 1fr !important; }

  /* Finance grids */
  .dama-fin-grid { grid-template-columns: 1fr !important; }
  .dama-mini-chart-wrap { height: 180px; }
  .dama-mini-chart-wrap canvas { max-height: 180px !important; }

  /* Modal is full-screen on mobile */
  .dama-modal {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 20px 16px !important;
    overflow-y: auto;
  }
  .dama-modal-backdrop { padding: 0 !important; }
  .dama-modal-close {
    top: 10px !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 24px !important;
  }
  .dama-input { min-height: 44px; font-size: 16px !important; /* prevents iOS zoom */ }
  .dama-form label { font-size: 13px; }
  .dama-pill-btn { min-height: 44px; }

  /* Profile page */
  .dama-profile-grid { grid-template-columns: 1fr !important; }

  /* Recent transactions - tighter */
  .dama-recent-list li { padding: 8px 10px; }
  .dama-recent-avatar { width: 34px; height: 34px; }

  /* Upcoming tasks - tighter */
  .dama-upcoming li { padding: 8px 10px; }

  /* Reduce excessive shadow/border-radius on mobile for perf */
  .dama-card, .dama-kpi-tile, .dama-featured {
    box-shadow: 0 2px 8px rgba(15,20,25,0.06) !important;
  }
}

/* ----- Very small phones ----- */
@media (max-width: 400px) {
  .dama-money-cells { grid-template-columns: 1fr !important; }
  .dama-money-cell-value { font-size: 16px !important; }
  .dama-brand-name { display: none; }
  .dama-topbar-right .dama-icon-btn:not([title="Log out"]) { display: none; }
}

/* =============================================================
   v1.2.0 — Pager, savings/bank accounts, chart rows,
   task completion toggle, bulk selection
   ============================================================= */

/* ---------- Google-style pager ---------- */
.dama-pager { margin-top: 16px; }
.dama-pager-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 4px 2px;
}
.dama-pager-info { font-size: 12px; color: var(--dama-muted); }
.dama-pager-info strong { color: var(--dama-ink); font-weight: 700; }
.dama-pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dama-pager-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid var(--dama-hair);
  background: var(--dama-surface);
  color: var(--dama-ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.dama-pager-btn:hover:not(:disabled):not(.is-current) {
  background: var(--dama-green-50, var(--dama-pos-soft));
  border-color: var(--dama-green, var(--dama-pos));
  color: var(--dama-green-dark, var(--dama-pos-deep));
}
.dama-pager-btn:active:not(:disabled) { transform: translateY(1px); }
.dama-pager-btn.is-current {
  background: var(--dama-green, var(--dama-pos));
  border-color: var(--dama-green, var(--dama-pos));
  color: var(--dama-surface);
  cursor: default;
}
.dama-pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.dama-pager-gap { padding: 0 4px; color: var(--dama-muted); font-size: 13px; user-select: none; }

/* ---------- Savings / bank summary tiles ---------- */
.dama-pot-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.dama-pot-tile {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
}
.dama-pot-tile--main {
  background: linear-gradient(135deg, var(--dama-pos-soft) 0%, var(--dama-pos-soft) 100%);
  border-color: rgba(14,143,110,0.22);
}
.dama-pot-tile--main.dama-pot-tile--bank {
  background: linear-gradient(135deg, var(--dama-info-soft) 0%, var(--dama-info-soft) 100%);
  border-color: rgba(37,99,235,0.22);
}
.dama-pot-tile-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--dama-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.dama-pot-tile-value {
  font-family: var(--dama-font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--dama-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  word-break: break-word;
}
.dama-pot-tile--main .dama-pot-tile-value { font-size: 24px; }
.dama-pot-tile-value.--in  { color: var(--dama-pos); }
.dama-pot-tile-value.--out { color: var(--dama-neg); }
.dama-pot-tile-sub { font-size: 11px; color: var(--dama-muted); margin-top: 4px; }

/* ---------- Account cards ---------- */
.dama-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.dama-acct-card {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-left: 4px solid var(--acct-colour, var(--dama-pos));
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15,20,25,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.dama-acct-card:hover { box-shadow: 0 6px 16px rgba(15,20,25,0.08); transform: translateY(-2px); }
.dama-acct-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dama-acct-name {
  font-size: 14px; font-weight: 700; color: var(--dama-ink);
  line-height: 1.25; word-break: break-word;
}
.dama-acct-meta { font-size: 11px; color: var(--dama-muted); margin-top: 2px; }
.dama-acct-num {
  font-family: 'Courier New', monospace;
  letter-spacing: -0.5px;
  background: var(--dama-tint);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
}
.dama-acct-actions { display: flex; gap: 2px; flex-shrink: 0; }
.dama-acct-actions button {
  background: transparent; border: none; cursor: pointer;
  color: var(--dama-muted); padding: 5px 6px; border-radius: 7px;
  display: inline-flex; align-items: center; transition: all 0.15s;
}
.dama-acct-actions button:hover { background: var(--dama-tint); color: var(--dama-ink); }
.dama-acct-actions button.--danger:hover { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-acct-balance {
  font-family: var(--dama-font-display);
  font-size: 22px; font-weight: 800;
  color: var(--dama-ink);
  font-variant-numeric: tabular-nums;
  margin: 10px 0 6px;
}
.dama-acct-progress {
  height: 6px; background: var(--dama-hair); border-radius: 999px;
  overflow: hidden; margin-bottom: 4px;
}
.dama-acct-progress-bar { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.dama-acct-progress-lbl { font-size: 10px; color: var(--dama-muted); margin-bottom: 6px; }
.dama-acct-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; padding-top: 8px;
  border-top: 1px solid var(--dama-tint);
}
.dama-acct-stats .--in  { color: var(--dama-pos); font-weight: 700; }
.dama-acct-stats .--out { color: var(--dama-neg); font-weight: 700; }
.dama-acct-cta { display: flex; gap: 6px; margin-top: 10px; }
.dama-acct-cta .dama-pill-btn { flex: 1; }

.dama-pill-btn--sm { padding: 6px 12px !important; font-size: 12px !important; }
.dama-pill-btn--danger {
  background: var(--dama-neg-soft) !important; color: var(--dama-neg-deep) !important; border-color: var(--dama-neg-soft) !important;
}
.dama-pill-btn--danger:hover:not(:disabled) { background: var(--dama-neg-soft) !important; color: var(--dama-neg-deep) !important; }
.dama-pill-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.dama-empty-card {
  grid-column: 1 / -1;
  padding: 26px 20px; text-align: center;
  background: var(--dama-surface-2); border: 1px dashed var(--dama-hair);
  border-radius: 14px; color: var(--dama-muted); font-size: 13px;
  line-height: 1.6;
}
.dama-empty-card--sm { padding: 16px; font-size: 12px; }

/* ---------- Sub-sections (activity ledgers) ---------- */
.dama-subsection { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dama-hair); }
.dama-subsection-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.dama-subsection-head h4 {
  margin: 0 !important; font-size: 14px !important; font-weight: 700 !important;
  color: var(--dama-ink) !important;
}
.dama-inline-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.dama-input--sm { padding: 6px 10px !important; font-size: 12px !important; min-width: 130px; }
.dama-hint {
  margin: 14px 0 0; font-size: 11px; color: var(--dama-muted);
  font-style: italic; padding: 8px 12px;
  background: var(--dama-surface-2); border-radius: 8px;
}
.dama-help { display: block; font-size: 11px; color: var(--dama-muted); margin-top: 4px; }

/* ---------- Ledger entry rows ---------- */
.dama-entry-list { display: flex; flex-direction: column; gap: 6px; }
.dama-entry-row {
  display: grid;
  grid-template-columns: 46px 1fr auto auto;
  gap: 12px; align-items: center;
  background: var(--dama-surface); border: 1px solid var(--dama-hair);
  border-radius: 11px; padding: 8px 12px;
  transition: box-shadow 0.15s;
}
.dama-entry-row:hover { box-shadow: 0 2px 8px rgba(15,20,25,0.06); }
.dama-entry-date {
  width: 46px; height: 46px; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--dama-font-display); font-weight: 800; flex-shrink: 0;
}
.dama-entry-row.--in  .dama-entry-date { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-entry-row.--out .dama-entry-date { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-entry-date > span:first-child { font-size: 15px; line-height: 1; }
.dama-entry-date .mon { font-size: 8px; letter-spacing: 0.4px; margin-top: 2px; opacity: 0.85; }
.dama-entry-main { min-width: 0; }
.dama-entry-title {
  font-size: 13px; font-weight: 700; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-entry-meta {
  font-size: 11px; color: var(--dama-muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-entry-amount {
  font-family: var(--dama-font-display); font-weight: 800; font-size: 14px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dama-entry-amount.--in  { color: var(--dama-pos); }
.dama-entry-amount.--out { color: var(--dama-neg); }
.dama-entry-actions button {
  background: transparent; border: none; cursor: pointer;
  color: var(--dama-muted); padding: 6px; border-radius: 7px;
  display: inline-flex; align-items: center; transition: all 0.15s;
}
.dama-entry-actions button.--danger:hover { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }

/* ---------- Four-across chart row ---------- */
.dama-chart-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.dama-chart-cell {
  display: flex; flex-direction: column;
  padding: 16px 16px 12px !important;
  min-width: 0;
}
.dama-chart-cell-title {
  font-size: 12px; font-weight: 700; color: var(--dama-ink);
  margin-bottom: 10px; letter-spacing: -0.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dama-chart-cell .dama-mini-chart-wrap {
  flex: 1; min-height: 165px; height: 165px; position: relative;
}
.dama-chart-cell .dama-mini-chart-wrap canvas { max-width: 100%; }
.dama-chart-cell-stat {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--dama-tint);
  font-size: 11px; color: var(--dama-muted); text-align: center;
}
.dama-chart-cell-stat strong {
  color: var(--dama-green-dark, var(--dama-pos-deep));
  font-family: var(--dama-font-display); font-size: 14px; font-weight: 800;
}

/* ---------- Statement toggles ---------- */
.dama-toggle-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dama-toggle-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--dama-hair); background: var(--dama-surface);
  font-size: 13px; cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.dama-toggle-chip:hover { border-color: var(--dama-green, var(--dama-pos)); }
.dama-toggle-chip input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--dama-green, var(--dama-pos)); }
.dama-toggle-chip:has(input:checked) {
  background: var(--dama-green-50, var(--dama-pos-soft));
  border-color: var(--dama-green, var(--dama-pos));
  color: var(--dama-green-dark, var(--dama-pos-deep));
  font-weight: 600;
}

/* ---------- Active / Completed segmented toggle ---------- */
.dama-seg-wrap { margin-bottom: 20px; }
.dama-seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--dama-hair); border-radius: 12px;
}
.dama-seg-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border: none; background: transparent;
  border-radius: 9px; font-family: inherit; font-size: 13px;
  font-weight: 600; color: var(--dama-muted); cursor: pointer;
  transition: all 0.18s;
}
.dama-seg-btn:hover:not(.is-active) { color: var(--dama-ink); }
.dama-seg-btn.is-active {
  background: var(--dama-surface); color: var(--dama-ink);
  box-shadow: 0 1px 4px rgba(15,20,25,0.1);
}
.dama-seg-count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--dama-hair); color: var(--dama-muted);
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.dama-seg-btn.is-active .dama-seg-count {
  background: var(--dama-green, var(--dama-pos)); color: var(--dama-surface);
}
.dama-seg-note { font-size: 12px; color: var(--dama-muted); margin-top: 8px; }

/* ---------- Completed tasks panel ---------- */
.dama-done-panel {
  background: linear-gradient(135deg, var(--dama-tint) 0%, var(--dama-surface-2) 100%);
  border: 1px solid var(--dama-hair);
  border-radius: 22px;
  padding: 24px 26px;
  box-shadow: 0 4px 18px rgba(15,20,25,0.05);
}
.dama-done-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.dama-done-panel-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.dama-done-badge {
  width: 62px; height: 62px; border-radius: 16px;
  background: var(--dama-green, var(--dama-pos)); color: var(--dama-surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(14,143,110,0.3); flex-shrink: 0;
}
.dama-done-panel-count {
  background: var(--dama-surface); border: 1px solid var(--dama-hair);
  border-radius: 14px; padding: 12px 20px; text-align: center;
}
.dama-done-panel-count > span:first-child {
  display: block; font-family: var(--dama-font-display);
  font-size: 24px; font-weight: 800; color: var(--dama-green-dark, var(--dama-pos-deep)); line-height: 1;
}
.done-toolbar { background: rgba(255,255,255,0.8); }

/* ---------- Bulk selection bar ---------- */
.dama-bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--dama-surface); border: 1px solid var(--dama-hair); border-radius: 11px;
}
.dama-bulk-check {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--dama-ink); cursor: pointer; user-select: none;
}
.dama-bulk-check input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--dama-green, var(--dama-pos)); }
.dama-bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dama-bulk-count { font-size: 12px; color: var(--dama-muted); font-weight: 600; }
.dama-task-select {
  display: inline-flex; align-items: center; padding-right: 4px; cursor: pointer;
}
.dama-task-select input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--dama-green, var(--dama-pos)); }
.dama-task-row.has-select { grid-template-columns: auto 54px 1fr auto auto; }
.dama-task-compact.has-select { grid-template-columns: auto 8px 1fr auto auto auto; }
.dama-task-item.has-select { position: relative; padding-top: 38px; }
.dama-task-item.has-select .dama-task-select { position: absolute; top: 12px; left: 14px; }

/* =============================================================
   Responsive — all new components
   ============================================================= */
@media (max-width: 1200px) {
  .dama-chart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dama-pot-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dama-account-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 700px) {
  .dama-chart-row { grid-template-columns: 1fr; gap: 12px; }
  .dama-chart-cell .dama-mini-chart-wrap { min-height: 190px; height: 190px; }
  .dama-pot-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dama-pot-tile { padding: 12px; }
  .dama-pot-tile-value { font-size: 17px; }
  .dama-pot-tile--main .dama-pot-tile-value { font-size: 20px; }
  .dama-account-grid { grid-template-columns: 1fr; }

  .dama-pager-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .dama-pager-info { text-align: center; }
  .dama-pager-btns { justify-content: center; }
  .dama-pager-btn { min-width: 40px; height: 40px; }

  .dama-entry-row { grid-template-columns: 40px 1fr auto; gap: 10px; padding: 8px 10px; }
  .dama-entry-date { width: 40px; height: 40px; }
  .dama-entry-date > span:first-child { font-size: 13px; }
  .dama-entry-actions {
    grid-column: 1 / -1; display: flex; justify-content: flex-end;
    padding-top: 6px; border-top: 1px dashed var(--dama-hair);
  }

  .dama-seg { display: flex; width: 100%; }
  .dama-seg-btn { flex: 1; justify-content: center; padding: 11px 10px; font-size: 12px; }

  .dama-done-panel { padding: 18px 15px; border-radius: 18px; }
  .dama-done-panel-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .dama-done-badge { width: 52px; height: 52px; }

  .dama-bulk-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .dama-bulk-actions { justify-content: space-between; }
  .dama-bulk-actions .dama-pill-btn { flex: 1; }

  .dama-subsection-head { flex-direction: column; align-items: stretch; }
  .dama-inline-controls { width: 100%; }
  .dama-input--sm { flex: 1; min-width: 0; }

  .dama-toggle-grid { gap: 6px; }
  .dama-toggle-chip { padding: 9px 12px; font-size: 12px; flex: 1 1 calc(50% - 6px); justify-content: center; }

  .dama-acct-cta { flex-direction: column; }
  .dama-task-row.has-select { grid-template-columns: auto 44px 1fr auto; }
}
@media (max-width: 420px) {
  .dama-pot-summary { grid-template-columns: 1fr; }
  .dama-pager-btn { min-width: 36px; height: 36px; padding: 0 7px; font-size: 12px; }
}

/* =============================================================
   v1.3.0 — Brand accent (teal-blue/green), account cards, split columns
   ============================================================= */
:root {
  --dama-violet:      var(--dama-brand);
  --dama-violet-2:    var(--dama-brand-2);
  --dama-violet-soft: var(--dama-brand-soft);
  --dama-violet-deep: var(--dama-brand-deep);
}

/* ---------- Statement card ---------- */
.dama-stmt-card {
  background: linear-gradient(135deg, var(--dama-brand) 0%, var(--dama-brand-2) 45%, var(--dama-brand-2) 100%) !important;
  border: none !important;
  color: var(--dama-surface);
  position: relative;
  overflow: hidden;
}
.dama-stmt-card::after {
  content: '';
  position: absolute; right: -60px; top: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 62%);
  pointer-events: none;
}
.dama-stmt-card .dama-card-title { color: var(--dama-surface) !important; position: relative; z-index: 1; }
.dama-stmt-sub { font-size: 12.5px; color: rgba(255,255,255,0.82); margin-top: 3px; }
.dama-stmt-body {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.dama-stmt-dates { display: flex; gap: 10px; }
.dama-stmt-dates .dama-field { margin: 0; }
.dama-stmt-dates label { color: rgba(255,255,255,0.85) !important; font-size: 11px !important; }
.dama-stmt-dates .dama-input {
  background: rgba(255,255,255,0.16) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  color: var(--dama-surface) !important; min-width: 145px;
}
.dama-stmt-dates .dama-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.8; }
.dama-stmt-opts { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
.dama-stmt-opts .dama-toggle-chip {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.92);
  font-size: 12px; padding: 7px 13px;
}
.dama-stmt-opts .dama-toggle-chip:has(input:checked) {
  background: var(--dama-surface); border-color: var(--dama-surface); color: var(--dama-violet-deep); font-weight: 650;
}
.dama-stmt-opts .dama-toggle-chip input { accent-color: var(--dama-violet); }
.dama-stmt-btn {
  background: var(--dama-surface) !important; color: var(--dama-violet-deep) !important;
  border-color: var(--dama-surface) !important; font-weight: 700 !important;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}
.dama-stmt-btn:hover { transform: translateY(-1px); }

/* ---------- Head tools ---------- */
.dama-head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dama-view-mode--acct .dama-view-mode-btn.is-active {
  background: var(--dama-violet) !important; color: var(--dama-surface) !important;
}

/* ---------- Account grids ---------- */
.dama-account-grid--card { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 14px; }
.dama-account-grid--tile { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.dama-account-grid--row  { display: flex; flex-direction: column; gap: 7px; }

/* ---------- RICH CARD ---------- */
.dama-acct-card2 {
  position: relative; overflow: hidden;
  border-radius: 18px;
  padding: 18px 18px 16px;
  color: var(--dama-surface);
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--acct-colour) 92%, #000 8%) 0%,
      var(--acct-colour) 52%,
      color-mix(in srgb, var(--acct-colour) 72%, var(--dama-surface) 28%) 100%);
  box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--acct-colour) 55%, transparent);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dama-acct-card2:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -8px color-mix(in srgb, var(--acct-colour) 62%, transparent);
}
.dama-acct-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 88% -18%, rgba(255,255,255,0.34), transparent 58%),
    radial-gradient(70% 60% at 8% 108%, rgba(0,0,0,0.16), transparent 62%);
}
.dama-acct-card2 > *:not(.dama-acct-sheen) { position: relative; z-index: 1; }
.dama-acct-card2-head { display: flex; align-items: flex-start; gap: 11px; }
.dama-acct-glyph {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center;
}
.dama-acct-glyph svg { width: 19px; height: 19px; stroke: var(--dama-surface); }
.dama-acct-card2-id { flex: 1; min-width: 0; }
.dama-acct-card2-name {
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-acct-card2-sub { font-size: 11px; color: rgba(255,255,255,0.78); margin-top: 2px; }
.dama-acct-card2 .dama-acct-actions button { color: rgba(255,255,255,0.8); }
.dama-acct-card2 .dama-acct-actions button:hover { background: rgba(255,255,255,0.2); color: var(--dama-surface); }
.dama-acct-card2 .dama-acct-actions button.--danger:hover { background: rgba(255,90,80,0.9); color: var(--dama-surface); }
.dama-acct-card2-balwrap { margin: 16px 0 12px; }
.dama-acct-card2-ballbl {
  font-size: 9px; letter-spacing: 1.7px; text-transform: uppercase;
  color: rgba(255,255,255,0.7); font-weight: 700;
}
.dama-acct-card2-bal {
  font-family: var(--dama-font-display);
  font-size: 27px; font-weight: 800; letter-spacing: -0.9px;
  font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.05;
}
.dama-acct-goal { margin-bottom: 12px; }
.dama-acct-goal-top {
  display: flex; justify-content: space-between;
  font-size: 10px; color: rgba(255,255,255,0.85);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; margin-bottom: 5px;
}
.dama-acct-card2 .dama-acct-progress { height: 5px; background: rgba(255,255,255,0.24); border-radius: 999px; }
.dama-acct-card2 .dama-acct-progress-bar { background: var(--dama-surface); height: 100%; border-radius: 999px; }
.dama-acct-goal-lbl { font-size: 10px; color: rgba(255,255,255,0.72); margin-top: 4px; }
.dama-acct-card2-foot {
  display: flex; gap: 16px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.dama-acct-flow { display: flex; flex-direction: column; gap: 1px; }
.dama-acct-flow .k {
  font-size: 8.5px; letter-spacing: 1.1px; text-transform: uppercase;
  color: rgba(255,255,255,0.62); font-weight: 700;
}
.dama-acct-flow .v { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dama-acct-card2-num {
  margin-top: 10px; font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px; letter-spacing: 1.6px; color: rgba(255,255,255,0.62);
}
.dama-acct-card2-cta { display: flex; gap: 7px; margin-top: 13px; }
.dama-acct-card2-cta .dama-pill-btn {
  flex: 1;
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.3) !important;
  color: var(--dama-surface) !important;
}
.dama-acct-card2-cta .dama-pill-btn--primary {
  background: var(--dama-surface) !important;
  color: color-mix(in srgb, var(--acct-colour) 80%, #000 20%) !important;
  border-color: var(--dama-surface) !important; font-weight: 700 !important;
}

/* ---------- COMPACT TILE ---------- */
.dama-acct-tile {
  background: var(--dama-surface);
  border: 1px solid var(--dama-hair);
  border-top: 3px solid var(--acct-colour);
  border-radius: 14px;
  padding: 13px 14px 12px;
  transition: box-shadow 0.16s, transform 0.16s;
}
.dama-acct-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,18,24,0.09); }
.dama-acct-tile-top { display: flex; align-items: center; justify-content: space-between; }
.dama-acct-tile-glyph {
  width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in srgb, var(--acct-colour) 12%, var(--dama-surface));
  display: flex; align-items: center; justify-content: center;
}
.dama-acct-tile-glyph svg { width: 16px; height: 16px; stroke: var(--acct-colour); }
.dama-acct-tile-name {
  font-size: 12.5px; font-weight: 650; color: var(--dama-ink); margin-top: 9px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-acct-tile-bal {
  font-family: var(--dama-font-display); font-size: 18px; font-weight: 800;
  color: var(--dama-ink); font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px; margin-top: 2px;
}
.dama-acct-spark { height: 4px; background: var(--dama-tint); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.dama-acct-spark i { display: block; height: 100%; background: var(--acct-colour); border-radius: 999px; }
.dama-acct-tile-cta { display: flex; gap: 5px; margin-top: 10px; }
.dama-acct-mini {
  flex: 1; padding: 5px 8px; border-radius: 7px;
  border: 1px solid var(--dama-hair); background: var(--dama-surface);
  font-family: inherit; font-size: 11px; font-weight: 650;
  cursor: pointer; transition: all 0.15s; color: var(--dama-muted);
}
.dama-acct-mini.--in:hover  { background: var(--dama-pos-soft); border-color: var(--dama-pos); color: var(--dama-pos-deep); }
.dama-acct-mini.--out:hover { background: var(--dama-neg-soft); border-color: var(--dama-neg); color: var(--dama-neg-deep); }

/* ---------- LEDGER ROW ---------- */
.dama-acct-row {
  display: grid;
  grid-template-columns: 4px 1fr auto auto auto auto;
  align-items: center; gap: 14px;
  background: var(--dama-surface); border: 1px solid var(--dama-hair);
  border-radius: 11px; padding: 10px 14px 10px 0;
  overflow: hidden; transition: box-shadow 0.15s;
}
.dama-acct-row:hover { box-shadow: 0 3px 12px rgba(16,18,24,0.07); }
.dama-acct-row-swatch { width: 4px; align-self: stretch; background: var(--acct-colour); }
.dama-acct-row-id { min-width: 0; padding-left: 10px; }
.dama-acct-row-name {
  font-size: 13px; font-weight: 650; color: var(--dama-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-acct-row-sub { font-size: 11px; color: var(--dama-muted); margin-top: 1px; }
.dama-acct-row-flows { display: flex; gap: 12px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.dama-acct-row-flows .--in  { color: var(--dama-pos); }
.dama-acct-row-flows .--out { color: var(--dama-neg); }
.dama-acct-row-bal {
  font-family: var(--dama-font-display); font-size: 15px; font-weight: 800;
  color: var(--dama-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dama-acct-row-cta { display: flex; gap: 4px; }
.dama-acct-row-cta .dama-acct-mini { min-width: 30px; flex: none; padding: 4px 9px; }

/* ---------- Split two-column layout ---------- */
.dama-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.dama-split-col { min-width: 0; }
.dama-split-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px; margin-bottom: 11px;
  border-bottom: 2px solid var(--dama-tint);
}
.dama-split-head h4 {
  margin: 0 !important; font-size: 12px !important; font-weight: 750 !important;
  text-transform: uppercase; letter-spacing: 1.1px; color: var(--dama-ink) !important;
}
.dama-split-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dama-split-head--in  { border-bottom-color: var(--dama-pos-soft); }
.dama-split-head--in  .dama-split-dot { background: var(--dama-pos); }
.dama-split-head--out { border-bottom-color: var(--dama-neg-soft); }
.dama-split-head--out .dama-split-dot { background: var(--dama-neg); }
.dama-split-count {
  margin-left: auto; min-width: 22px; padding: 1px 8px;
  border-radius: 999px; background: var(--dama-tint); color: var(--dama-muted);
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.dama-split-head--in  .dama-split-count { background: var(--dama-pos-soft); color: var(--dama-pos-deep); }
.dama-split-head--out .dama-split-count { background: var(--dama-neg-soft); color: var(--dama-neg-deep); }
.dama-split-empty {
  padding: 20px 14px; text-align: center; font-size: 12px;
  color: var(--dama-muted); background: var(--dama-surface-2);
  border: 1px dashed var(--dama-hair); border-radius: 11px;
}
.dama-tx-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--dama-tint);
}
.dama-pager--sm .dama-pager-inner { padding: 8px 0 0; }
.dama-pager--sm .dama-pager-btn { min-width: 28px; height: 28px; font-size: 12px; }
.dama-pager--sm .dama-pager-info { font-size: 11px; }

/* ---------- Transactions row: today | all other ---------- */
.dama-tx-row-wrap {
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 18px; align-items: start; margin-top: 24px;
}
.dama-tx-row-wrap .dama-today-panel { margin-bottom: 0; }
.dama-tx-other-panel { min-width: 0; }

@media (max-width: 1180px) {
  .dama-tx-row-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .dama-split { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 700px) {
  .dama-stmt-body { flex-direction: column; align-items: stretch; }
  .dama-stmt-dates { width: 100%; }
  .dama-stmt-dates .dama-field { flex: 1; }
  .dama-stmt-dates .dama-input { min-width: 0; width: 100%; }
  .dama-stmt-opts .dama-toggle-chip { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .dama-stmt-btn { width: 100%; justify-content: center; }
  .dama-head-tools { width: 100%; justify-content: space-between; }
  .dama-account-grid--card,
  .dama-account-grid--tile { grid-template-columns: 1fr; }
  .dama-acct-row {
    grid-template-columns: 4px 1fr auto;
    grid-template-areas: "sw id bal" "sw flows flows" "sw cta acts";
    row-gap: 8px; padding-bottom: 12px;
  }
  .dama-acct-row-swatch { grid-area: sw; }
  .dama-acct-row-id     { grid-area: id; }
  .dama-acct-row-bal    { grid-area: bal; }
  .dama-acct-row-flows  { grid-area: flows; padding-left: 10px; }
  .dama-acct-row-cta    { grid-area: cta; padding-left: 10px; }
  .dama-acct-row .dama-acct-actions { grid-area: acts; justify-self: end; }
}

/* =============================================================
   Interactive dashboard — pulse rings, analytics, heatmap
   ============================================================= */
.dama-card-sub { font-size: 12px; color: var(--dama-muted); margin-top: 3px; }

/* ---------- Pulse strip ---------- */
.dama-pulse-row {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px; margin-top: 18px;
}
.dama-pulse {
  display: flex; align-items: center; gap: 14px;
  background: var(--dama-surface); border: 1px solid var(--dama-hair);
  border-radius: 16px; padding: 15px 16px;
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: default;
}
.dama-pulse:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px rgba(16,18,24,0.2); }
.dama-pulse-ring { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.dama-pulse-ring canvas { width: 58px !important; height: 58px !important; }
.dama-pulse-ring-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--dama-font-display); font-size: 12.5px; font-weight: 800;
  color: var(--dama-ink); letter-spacing: -0.3px;
}
.dama-pulse-meta { min-width: 0; }
.dama-pulse-k {
  font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--dama-muted); font-weight: 750;
}
.dama-pulse-v {
  font-family: var(--dama-font-display); font-size: 18px; font-weight: 800;
  color: var(--dama-ink); letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dama-pulse-s {
  font-size: 10.5px; color: var(--dama-muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Analytics grids ---------- */
.dama-dash-analytics {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px; margin-top: 18px; align-items: stretch;
}
.dama-dash-analytics-2 {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px; margin-top: 16px;
}
.dama-chart-tall { height: 300px; position: relative; }
.dama-chart-med  { height: 215px; position: relative; }

/* ---------- Range chips ---------- */
.dama-chip-group { display: inline-flex; gap: 4px; padding: 3px; background: var(--dama-tint); border-radius: 10px; }
.dama-chip {
  padding: 6px 13px; border: none; background: transparent;
  border-radius: 7px; font-family: inherit; font-size: 12px; font-weight: 650;
  color: var(--dama-muted); cursor: pointer; transition: all 0.16s; white-space: nowrap;
}
.dama-chip:hover:not(.is-active) { color: var(--dama-ink); }
.dama-chip.is-active { background: var(--dama-violet); color: var(--dama-surface); box-shadow: 0 2px 8px -2px rgba(13,148,136,0.6); }

/* ---------- Heatmap ---------- */
.dama-heat { overflow-x: auto; padding-bottom: 4px; }
.dama-heat-months {
  display: grid; grid-template-columns: repeat(13, 1fr);
  gap: 4px; margin-bottom: 5px; min-width: 480px;
}
.dama-heat-months span { font-size: 9.5px; color: var(--dama-muted); font-weight: 650; }
.dama-heat-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; min-width: 480px; }
.dama-heat-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.dama-heat-col i, .dama-heat-legend i {
  display: block; width: 100%; aspect-ratio: 1; border-radius: 3px;
  background: var(--dama-tint); transition: transform 0.12s;
}
.dama-heat-col i:hover { transform: scale(1.28); }
.dama-heat-col i.is-future { opacity: 0.28; }
.lv0 { background: var(--dama-tint) !important; }
.lv1 { background: var(--dama-brand-soft) !important; }
.lv2 { background: var(--dama-brand-2) !important; }
.lv3 { background: var(--dama-brand-2) !important; }
.lv4 { background: var(--dama-brand-deep) !important; }
.dama-heat-legend { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--dama-muted); }
.dama-heat-legend i { width: 11px; height: 11px; aspect-ratio: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .dama-pulse-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dama-dash-analytics { grid-template-columns: 1fr; }
  .dama-dash-analytics-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .dama-pulse-row { grid-template-columns: 1fr; gap: 10px; }
  .dama-dash-analytics-2 { grid-template-columns: 1fr; }
  .dama-chart-tall { height: 250px; }
  .dama-chart-med { height: 200px; }
  .dama-chip-group { width: 100%; }
  .dama-chip { flex: 1; text-align: center; }
  .dama-card-head { flex-wrap: wrap; gap: 10px; }
}

/* =============================================================
   v1.5.0 — Layout repair + dock.cool-inspired surface design
   Each finance section owns a full row; list items degrade
   gracefully at any column width instead of shredding.
   ============================================================= */

/* ---------- Full-row sections ---------- */
.dama-tx-row-wrap{display:block !important;}
.dama-today-panel--tx,
.dama-tx-other-panel,
.dama-split-card{width:100%;}
.dama-today-panel--tx{margin-bottom:24px;}

/* ---------- THE FIX: nothing may overflow its column ---------- */
.dama-split,
.dama-split-col,
.dama-debt-list,
.dama-tx-list{min-width:0;}
.dama-split-col > *{min-width:0;max-width:100%;}

/* Debt item — rebuilt as a stacked card that never collides */
.dama-debt-item{
  display:grid !important;
  grid-template-columns:1fr auto;
  grid-template-areas:
    "badge  amount"
    "main   amount"
    "acts   acts";
  gap:6px 14px;
  align-items:start;
  padding:16px 18px;
  background:var(--dama-surface,var(--dama-surface));
  border:1px solid var(--dama-hair,var(--dama-hair));
  border-radius:16px;
  min-width:0;
  transition:box-shadow .18s,transform .18s,border-color .18s;
}
.dama-debt-item:hover{
  transform:translateY(-2px);
  border-color:var(--dama-hair-2,var(--dama-hair));
  box-shadow:0 10px 26px -14px rgba(16,18,24,.4);
}
.dama-debt-item + .dama-debt-item{margin-top:10px;}
.dama-debt-item .dama-debt-badge{grid-area:badge;justify-self:start;}
.dama-debt-item-main{grid-area:main;min-width:0;}
.dama-debt-item-name{
  font-size:14px;font-weight:700;color:var(--dama-ink);
  line-height:1.3;margin-bottom:3px;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;
  overflow:hidden;word-break:break-word;
}
.dama-debt-item-meta{
  font-size:11.5px;color:var(--dama-muted);line-height:1.5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;word-break:break-word;
}
.dama-debt-item-amount{
  grid-area:amount;text-align:right;white-space:nowrap;align-self:center;
}
.dama-debt-item-remaining{
  font-family:var(--dama-font-display);font-size:16px;font-weight:800;
  letter-spacing:-.4px;font-variant-numeric:tabular-nums;color:var(--dama-ink);
}
.dama-debt-item-original{font-size:10.5px;color:var(--dama-muted);margin-top:2px;}
.dama-debt-item-actions{
  grid-area:acts;display:flex;gap:6px;flex-wrap:wrap;
  padding-top:10px;margin-top:4px;border-top:1px solid var(--dama-hair,var(--dama-tint));
}
.dama-debt-item-actions button{
  flex:1;min-width:0;padding:7px 10px;border-radius:9px;
  border:1px solid var(--dama-hair-2,var(--dama-hair));background:transparent;
  font-family:inherit;font-size:11.5px;font-weight:650;color:var(--dama-muted);
  cursor:pointer;transition:all .15s;white-space:nowrap;
}
.dama-debt-item-actions button:hover{background:var(--dama-tint,var(--dama-tint));color:var(--dama-ink);}
.dama-debt-item-actions button.--pay:hover{background:var(--dama-pos-soft);border-color:var(--dama-pos);color:var(--dama-pos-deep);}
.dama-debt-item-actions button.--danger:hover{background:var(--dama-neg-soft);border-color:var(--dama-neg);color:var(--dama-neg-deep);}

/* Transaction row — same defensive treatment */
.dama-tx-row{
  grid-template-columns:46px minmax(0,1fr) auto !important;
  grid-template-areas:"date main amount" "date meta amount" "acts acts acts";
  gap:4px 12px !important;
  padding:12px 14px !important;
  border-radius:14px !important;
  align-items:center;
}
.dama-tx-row .dama-tx-date{grid-area:date;width:46px;height:46px;align-self:center;}
.dama-tx-row-main{grid-area:main;min-width:0;}
.dama-tx-row-title{
  font-size:13.5px;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;
  overflow:hidden;white-space:normal !important;word-break:break-word;
}
.dama-tx-row-meta{
  font-size:11px;line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;
  overflow:hidden;white-space:normal !important;
}
.dama-tx-row-amount{grid-area:amount;align-self:center;font-size:14px !important;}
.dama-tx-row .dama-tx-actions{
  grid-area:acts;justify-content:flex-end;
  padding-top:8px;margin-top:4px;border-top:1px solid var(--dama-hair,var(--dama-tint));
}
.dama-tx-compact{grid-template-columns:8px minmax(0,1fr) auto auto !important;}
.dama-tx-compact-title{min-width:0;}
.dama-tx-compact-cat{display:none;}

/* Split columns get breathing room now they own the full width */
.dama-split{gap:24px !important;}
.dama-split-head{
  position:sticky;top:0;z-index:2;
  background:var(--dama-surface,var(--dama-surface));
  padding-top:2px;
}

/* ---------- dock.cool-inspired surfaces ---------- */
.dama-card,.dama-today-panel,.dama-done-panel,.dama-acct-card2,.dama-acct-tile{
  border-radius:20px;
}
.dama-card{
  background:var(--dama-surface,var(--dama-surface));
  border:1px solid var(--dama-hair,var(--dama-hair));
  box-shadow:0 1px 2px rgba(16,18,24,.04);
}
.dama-card-title{
  font-family:var(--dama-font-display);
  letter-spacing:-.03em;font-weight:800;
}
.dama-view-head h1,.dama-hello{letter-spacing:-.04em;}

/* =============================================================
   Unified site chrome — app/auth screens wrapped in the
   marketing header + footer for one consistent product shell.
   ============================================================= */
.dama-chrome-body { min-height: 55vh; padding: 6px 0 44px; }
.dama-chrome-body > .dama-shell,
.dama-chrome-body > .dama-app { margin-top: 0; }

/* =============================================================
   v1.7.0 — habits grid, compact heatmap, small chart wells
   ============================================================= */
.dama-habit-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:16px;margin-top:18px;
}
.dama-habit-heat{ grid-column:span 1; }
.dama-chart-sm{ height:190px;position:relative; }
.dama-heat--sm{ gap:3px; }
.dama-heat--sm i{ width:9px!important;height:9px!important;border-radius:2px!important; }
.dama-heat--sm .dama-heat-col{ gap:3px; }
@media (max-width:640px){
  .dama-habit-grid{ grid-template-columns:1fr; }
  .dama-chart-sm{ height:170px; }
}

/* =============================================================
   v1.8.0 — Contrast safety.

   Anywhere a filled colour is used as a background, the text on
   it is driven by the matching --dama-on-* token. Those tokens
   are computed from the background's luminance server-side, so
   whatever palette a user saves stays readable.
   ============================================================= */
.dama-shell .dama-pill-btn--primary,
.dama-shell .dama-btn--primary,
.dama-shell .dama-badge--brand,
.dama-shell .dama-chip--brand,
.dama-shell .dama-switch-btn.is-active,
.dama-shell .dama-seg-btn.is-active,
.dama-shell .dama-view-mode-btn.is-active,
.dama-shell .dama-tab.is-active,
.dama-shell .dama-fintab.is-active {
  background: var(--dama-brand);
  color: var(--dama-on-brand) !important;
  border-color: var(--dama-brand);
}
.dama-shell .dama-pill-btn--primary svg,
.dama-shell .dama-switch-btn.is-active svg,
.dama-shell .dama-fintab.is-active svg { color: var(--dama-on-brand); }

.dama-shell .dama-badge--pos,
.dama-shell .dama-debt-badge--paid,
.dama-shell .--pay:hover        { background: var(--dama-pos); color: var(--dama-on-pos) !important; border-color: var(--dama-pos); }
.dama-shell .dama-badge--neg,
.dama-shell .--danger:hover     { background: var(--dama-neg); color: var(--dama-on-neg) !important; border-color: var(--dama-neg); }
.dama-shell .dama-badge--warn   { background: var(--dama-warn); color: var(--dama-on-warn) !important; }
.dama-shell .dama-badge--info   { background: var(--dama-info); color: var(--dama-on-info) !important; }

.dama-shell .dama-kpi-tile--t1, .dama-shell .dama-kpi-tile--aqua,
.dama-shell .dama-kpi-tile--lilac { color: var(--dama-on-tile-1); }
.dama-shell .dama-kpi-tile--t2, .dama-shell .dama-kpi-tile--mint  { color: var(--dama-on-tile-2); }
.dama-shell .dama-kpi-tile--t3, .dama-shell .dama-kpi-tile--blue  { color: var(--dama-on-tile-3); }
.dama-shell .dama-kpi-tile--t4, .dama-shell .dama-kpi-tile--peach { color: var(--dama-on-tile-4); }
.dama-shell .dama-kpi-tile--t5 { color: var(--dama-on-tile-5); }
.dama-shell .dama-kpi-tile--t6, .dama-shell .dama-kpi-tile--pink  { color: var(--dama-on-tile-6); }
.dama-shell [class*="dama-kpi-tile--"] .dama-kpi-tile-label { color: inherit; opacity: .72; }
.dama-shell [class*="dama-kpi-tile--"] .dama-kpi-tile-value { color: inherit; }

.dama-shell .dama-stmt-card,
.dama-shell .dama-dark-tile { background: var(--dama-navy); color: var(--dama-on-navy); }
.dama-shell .dama-stmt-card *,
.dama-shell .dama-dark-tile * { color: inherit; }

/* Hover states — teal wash, never pink */
.dama-shell .dama-icon-btn:hover,
.dama-shell .dama-round-btn:hover,
.dama-shell .dama-recent-list li:hover,
.dama-shell .dama-lang-menu button:hover {
  background: var(--dama-brand-soft);
  color: var(--dama-on-brand-soft);
}
.dama-shell .dama-tx-row:hover,
.dama-shell .dama-task-item:hover { background: var(--dama-brand-soft); }
.dama-shell .dama-debt-item-actions button:hover {
  background: var(--dama-brand); color: var(--dama-on-brand); border-color: var(--dama-brand);
}

/* =============================================================
   Palette transitions.

   Carried over from the retired theme stylesheet so a change in the
   brand studio eases in rather than snapping. Skipped for anyone who
   has asked their system for reduced motion.
   ============================================================= */
.dama-app, .dama-card, .dama-input, .dama-topbar, .dama-tx-row, .dama-debt-item {
  transition: background-color .28s ease, border-color .28s ease, color .28s ease;
}
@media (prefers-reduced-motion: reduce) {
  .dama-app, .dama-card, .dama-input, .dama-topbar, .dama-tx-row, .dama-debt-item {
    transition: none;
  }
}
