/* G50 Baby – stil mobile-first */
:root {
  --bg: #f5f5fb;
  --surface: #ffffff;
  --surface-2: #f0f0f8;
  --text: #1d1d2c;
  --muted: #6b6b80;
  --border: #e4e4ef;
  --primary: #5b5bd6;
  --primary-2: #4747c2;
  --primary-soft: #ececfd;
  --pos: #16803c;
  --pos-soft: #e5f6ea;
  --neg: #c62f3b;
  --neg-soft: #fdecee;
  --warn: #a15c00;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 50, .05), 0 4px 16px rgba(20, 20, 50, .05);
  --topbar: 56px;
  --bottomnav: 64px;
  --sidebar: 240px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: .95rem; margin: 16px 0 8px; }
p { margin: 0 0 10px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; word-break: break-all; }
code.big { font-size: 1.15em; padding: 4px 10px; letter-spacing: .02em; }
pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 8px; max-height: 300px; overflow: auto; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.grow { flex: 1; min-width: 0; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.zero { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.5) blur(10px);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.logo.big { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; margin: 0 auto 12px; display: grid; }
.topbar-user { margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.user-chip:hover { text-decoration: none; }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px;
}
.avatar-lg { width: 48px; height: 48px; font-size: 14px; }

.sidebar {
  position: fixed; z-index: 60; top: 0; bottom: 0; left: 0;
  width: min(300px, 86vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform .22s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
  padding-bottom: calc(16px + var(--safe-b));
}
body.drawer-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(20, 20, 40, .35); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.drawer-open { overflow: hidden; }
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-head > div { flex: 1; min-width: 0; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; }
.sidebar nav a, .nav-logout {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: 15px;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.sidebar nav a .ic, .nav-logout .ic { color: var(--muted); }
.sidebar nav a:hover, .nav-logout:hover { background: var(--surface-2); text-decoration: none; }
.sidebar nav a.active { background: var(--primary-soft); color: var(--primary); }
.sidebar nav a.active .ic { color: var(--primary); }
.nav-logout { margin-top: 8px; border-top: 1px solid var(--border); border-radius: 0; padding-top: 14px; }
.maint-flag { margin: 8px 16px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600; }

.main {
  padding: 16px 16px calc(var(--bottomnav) + 24px + var(--safe-b));
  max-width: 1180px;
  margin: 0 auto;
}
body.no-nav .main { padding-bottom: 32px; }

.bottomnav {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  height: calc(var(--bottomnav) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.3;
  background: none; border: 0; font-family: inherit; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav .ic { width: 23px; height: 23px; }
.bottomnav a.active { color: var(--primary); }

.only-desktop { display: none; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }

@media (min-width: 900px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: inline; }
  .topbar { padding: 0 20px 0 calc(var(--sidebar) + 20px); }
  .topbar .brand { position: fixed; left: 20px; top: 10px; }
  .sidebar { transform: none; width: var(--sidebar); top: var(--topbar); padding-top: 8px; z-index: 30; }
  .drawer-backdrop, .bottomnav { display: none; }
  body.has-nav .main { margin-left: var(--sidebar); padding: 28px 32px 48px; }
  body.has-nav .main { max-width: calc(1180px + var(--sidebar)); }
  h1 { font-size: 1.7rem; }
}

/* ---------- Componente ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  color: inherit;
  display: block;
}
a.card:hover { text-decoration: none; border-color: #cfcff0; }
.card.no-pad { padding: 0; overflow: hidden; }
.card.narrow { max-width: 640px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.link { font-size: .9rem; font-weight: 600; }
.section { margin: 22px 0 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.empty-state { text-align: center; padding: 32px 16px; }

.grid { display: grid; gap: 14px; }
.grid > .card { margin-bottom: 0; }
.grid + .section, .grid + .card { margin-top: 14px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head p { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.back .ic { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font: 600 14px/1.2 inherit; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--neg-soft); border-color: #f5c9ce; color: var(--neg); }
.btn-danger:hover { background: #fadadf; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.page-head .actions .btn { flex: 1 1 auto; }
@media (min-width: 600px) { .page-head .actions .btn { flex: none; } }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
  background: var(--surface-2); color: var(--muted); vertical-align: middle; white-space: nowrap;
}
.badge-mama { background: #fde8f3; color: #b0266f; }
.badge-tata { background: #e6effd; color: #2459b8; }
.badge-ok { background: var(--pos-soft); color: var(--pos); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-role-admin { background: var(--primary-soft); color: var(--primary); }
.badge-role-editor { background: #e7f5f7; color: #0f7383; }
.badge-src-revolut { background: #eef0ff; color: #3b3fbf; }
.badge-src-cash { background: var(--pos-soft); color: var(--pos); }
.badge-src-eveniment { background: #fdf0e6; color: #a2520c; }
.badge-act-stergere, .badge-ev-login_esuat { background: var(--neg-soft); color: var(--neg); }
.badge-act-creare, .badge-ev-login { background: var(--pos-soft); color: var(--pos); }
.badge-act-parola { background: var(--warn-soft); color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d4d4df; margin-left: 4px; vertical-align: middle; }
.dot-ok { background: var(--pos); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text);
}
a.chip:hover { text-decoration: none; background: #e6e6f2; }
.chip.pos { background: var(--pos-soft); color: var(--pos); }
.chip.neg { background: var(--neg-soft); color: var(--neg); }
.chip.zero { color: var(--muted); }
.chip-active { background: var(--primary); color: #fff !important; }
.chip-active .muted { color: rgba(255, 255, 255, .75); }
.chip-efectuat { background: var(--pos-soft); color: var(--pos); }
.chip-anulat { background: var(--neg-soft); color: var(--neg); }
.chip-programat { background: var(--primary-soft); color: var(--primary); }
.album-chips { margin: 0 0 14px; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--pos-soft); color: #0f5e2c; border-color: #c7ebd2; }
.alert-error { background: var(--neg-soft); color: #9c1d28; border-color: #f5c9ce; }
.alert-info { background: var(--primary-soft); color: #33338f; border-color: #d6d6f7; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); color: inherit; min-width: 0;
}
a.stat:hover { text-decoration: none; border-color: #cfcff0; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 1.3rem; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value.small-value { font-size: 1.05rem; }
.stat-main { grid-column: 1 / -1; }
.stat-main .stat-value { font-size: 1.8rem; }
@media (min-width: 760px) { .stat-main { grid-column: auto; } }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); font-size: 12.5px; font-weight: 600;
}
.qa:hover { text-decoration: none; border-color: #cfcff0; }
.qa .ic { width: 26px; height: 26px; padding: 5px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); box-sizing: content-box; }
.qa-in .ic { background: var(--pos-soft); color: var(--pos); }
.qa-out .ic { background: var(--neg-soft); color: var(--neg); }

/* Child & fund cards */
.child-card-head { display: flex; align-items: center; gap: 12px; }
.child-card-head .ic { width: 14px; height: 14px; }
.balance-big { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 2px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.balance-big small { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.fund-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fund-grid .card { margin: 0; }
.fund-card { display: flex; flex-direction: column; gap: 4px; }
.fund-name { font-weight: 650; }
.fund-balance { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.fund-io { display: flex; gap: 12px; font-size: .85rem; font-weight: 600; }

.next-event { display: flex; gap: 14px; align-items: center; }
.date-badge {
  display: grid; place-items: center; flex: none;
  width: 54px; height: 58px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary); line-height: 1;
}
.date-badge span { font-size: 1.4rem; font-weight: 800; }
.date-badge small { font-size: 11px; font-weight: 700; text-transform: uppercase; margin-top: -8px; }
.date-badge.friday { background: #fdf0e6; color: #a2520c; }
.date-badge.sm { width: 44px; height: 46px; }
.date-badge.sm span { font-size: 1.1rem; }

.event-list { display: flex; flex-direction: column; }
.event-card { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.event-card.past { opacity: .85; }
.event-body { flex: 1; min-width: 0; }
.event-body .chips { margin-top: 6px; }

/* Tabele – pe mobil devin carduri */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafafe; white-space: nowrap; }
.table tbody tr:hover { background: #fafaff; }
.table tfoot td { font-weight: 700; background: #fafafe; border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .row-actions { white-space: nowrap; text-align: right; }
.row-muted { opacity: .55; }
.parent-line { font-size: .88rem; margin-bottom: 2px; }
.table.mini { font-size: 12px; margin-top: 6px; }
.table.mini th, .table.mini td, table.mini th, table.mini td { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.diff summary { cursor: pointer; color: var(--primary); }

@media (max-width: 759px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td, .rtable tfoot { display: block; width: 100%; }
  .rtable tr { padding: 10px 14px; border-bottom: 1px solid var(--border); position: relative; }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rtable td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; flex: none; padding-top: 2px; }
  .rtable td:not([data-label])::before { content: none; }
  .rtable td.num { justify-content: space-between; }
  .rtable td.cell-main { display: block; text-align: left; font-size: 1rem; padding-bottom: 4px; padding-right: 84px; }
  .rtable td.cell-main::before { content: none; }
  .rtable td.row-actions { position: absolute; top: 6px; right: 8px; width: auto; padding: 0; }
  .rtable td[colspan] { display: block; text-align: center; }
  .rtable td[colspan]::before { content: none; }
  .rtable td > div, .rtable td > a { text-align: right; }
  .rtable tfoot tr { background: #fafafe; }
  .rtable td:empty, .rtable td.hide-m { display: none; }
}

/* Toolbar, tabs, search, filters */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.search { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 360px; }
.search .ic { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px !important; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input { flex: 1 1 150px; width: auto; }
.filters .btn { flex: 0 0 auto; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; }
.form h2, .form h3 { margin-bottom: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]), select, textarea {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d6d6e4; border-radius: 10px;
  background: #fff; color: var(--text);
  font: 400 16px/1.3 inherit; font-family: inherit; /* 16px = fără zoom pe iPhone */
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px;
}
.select-sm { min-height: 32px; padding: 4px 30px 4px 8px; font-size: 13px; width: auto; }
textarea { min-height: 88px; resize: vertical; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin: 0; }
.row2 { display: grid; gap: 14px; }
@media (min-width: 520px) { .row2 { grid-template-columns: 1fr 1fr; align-items: end; } }
.money-input { position: relative; }
.form label.money-input { display: grid; grid-template-columns: 1fr; }
.money-input input { padding-right: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.money-input em { position: absolute; right: 12px; bottom: 12px; font-style: normal; color: var(--muted); font-weight: 600; pointer-events: none; }
.money-input.big input { font-size: 1.4rem; min-height: 54px; }
.money-input.big em { bottom: 16px; }
.sum-line { text-align: right; padding: 8px 0; border-top: 1px dashed var(--border); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { flex-direction: row !important; align-items: center; gap: 8px !important; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; background: #fff; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.seg-block { flex-direction: column; }
.seg-block label { align-items: flex-start !important; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 18px; padding: 8px; cursor: pointer; opacity: .6; }
.dropzone {
  border: 2px dashed #cfcfe6; border-radius: var(--radius); padding: 22px 14px; text-align: center; cursor: pointer;
  background: #fafaff; position: relative; font-weight: 500 !important;
}
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .ic { width: 24px; height: 24px; color: var(--primary); }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
form.inline { display: inline; }

/* Picker copii */
.picker-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.picker-tools .search { flex: 1 1 100%; max-width: none; }
@media (min-width: 520px) { .picker-tools .search { flex: 1 1 200px; } }
.picker-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.picker-item { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px !important; padding: 11px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-weight: 500 !important; font-size: 15px !important; }
.picker-item:last-child { border-bottom: 0; }
.picker-item:has(input:checked) { background: var(--primary-soft); }

/* Prezență */
.att-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 600px) { .att-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .att-grid { grid-template-columns: 1fr 1fr 1fr; } }
.att-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; font-weight: 500; }
.att-item input { position: absolute; opacity: 0; pointer-events: none; }
.att-box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #cfcfe0; display: grid; place-items: center; flex: none; color: transparent; }
.att-box .ic { width: 18px; height: 18px; }
.att-item:has(input:checked) { border-color: #9fd8b1; background: var(--pos-soft); }
.att-item:has(input:checked) .att-box { background: var(--pos); border-color: var(--pos); color: #fff; }
.sticky-save { position: sticky; bottom: calc(var(--bottomnav) + var(--safe-b) + 8px); margin-top: 14px; }
@media (min-width: 900px) { .sticky-save { bottom: 12px; } }
.attend-list { list-style: none; margin: 0; padding: 0; }
.attend-list li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.attend-list li:last-child { border-bottom: 0; }
.att { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; flex: none; }
.att-yes { background: var(--pos-soft); color: var(--pos); }
.att-no { background: var(--neg-soft); color: var(--neg); }
.att-na { background: var(--surface-2); color: var(--muted); }

/* Galerie */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumbs-menu { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.thumbs a, .thumb-wrap { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; position: relative; }
.thumbs-menu a, .thumbs-menu .thumb-wrap { aspect-ratio: 1.414; background: #fff; border: 1px solid var(--border); }
.thumbs-menu .thumb-wrap a { border: 0; }
.thumbs-menu img { object-fit: contain; }
.thumbs img, .gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.thumbs a:hover img, .gallery a:hover img { transform: scale(1.03); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 600px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; } }
.gallery-item { margin: 0; position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.gallery-item a { display: block; width: 100%; height: 100%; }
.gallery-del { position: absolute; top: 4px; right: 4px; }
.gallery-del .icon-btn { width: 32px; height: 32px; background: rgba(255, 255, 255, .85); color: var(--neg); }
.file-tile { display: grid !important; place-items: center; height: 100%; font-weight: 700; color: var(--primary); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: inherit; }
.card > .file-row:last-child { border-bottom: 0; }
.card:not(.no-pad) > .file-row { padding: 6px 0; border: 0; }
.file-row > .ic { color: var(--primary); }
.file-row a.grow { color: inherit; }
.week-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 20, .94); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox img { max-width: 100vw; max-height: calc(100vh - 70px); object-fit: contain; user-select: none; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; cursor: pointer; font-size: 30px; line-height: 1; display: grid; place-items: center; }
.lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + var(--safe-b)); display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .5)); }
.lb-bar .btn { background: rgba(255, 255, 255, .15); color: #fff; border-color: transparent; }

/* Diverse */
.login-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 400px; text-align: center; padding: 28px 22px; }
.login-card .form { text-align: left; margin: 18px 0 14px; }
.cred { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
.cred dt { color: var(--muted); font-size: .88rem; }
.cred dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cred-box { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cred-msg { font-family: ui-monospace, Consolas, monospace; font-size: 14px !important; margin-bottom: 10px; }
.parents { display: flex; flex-direction: column; gap: 10px; }
.parent { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.parent-edit { padding: 12px 0; border-bottom: 1px solid var(--border); }
.parent-edit .actions { margin-top: 8px; }
.parent-edit-head { display: flex; align-items: center; gap: 10px; }
.add-parent { margin-top: 12px; padding-top: 4px; }
.class-list { columns: 2 220px; margin: 12px 0; padding-left: 22px; }
.class-list li { padding: 2px 0; }
.class-list li.mine { font-weight: 700; color: var(--primary); }
details > summary { cursor: pointer; }
details.card > summary { list-style: none; display: flex; gap: 8px; align-items: center; }
details.card > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: 12px; }
.help-list { margin: 0; padding-left: 18px; }
.help-list li { margin-bottom: 6px; }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottomnav) + 20px + var(--safe-b)); transform: translateX(-50%); background: #22223a; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 120; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.form label.search { flex-direction: row; gap: 0; font-weight: 400; }
.dropzone input[type=file] { min-height: 0; }
input[type=file] { font-size: 14px; max-width: 100%; }
.row-mine td { background: #f6f6ff; }
.attend-list li.mine a { font-weight: 700; }

/* Date de plată */
.pay-box { display: flex; flex-direction: column; }
.pay-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l b" "v b"; gap: 0 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: 0; }
.pay-label { grid-area: l; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pay-value { grid-area: v; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; user-select: all; }
.pay-row > .btn, .pay-row > span:last-child { grid-area: b; }
.pay-copy.copied { background: var(--pos-soft); border-color: #9fd8b1; color: var(--pos); }
.pay-box.compact .pay-row { padding: 7px 0; }
.pay-box.compact .pay-copy span { display: none; }
.pay-note { margin: 12px 0 0; font-weight: 500; }
.gallery-docs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.gallery-docs .gallery-item { aspect-ratio: auto; background: var(--surface); border: 1px solid var(--border); }
.gallery-docs .gallery-item a { height: auto; aspect-ratio: 1.3; background: #fff; }
.gallery-docs .gallery-item img { object-fit: contain; }
.gallery-docs figcaption { padding: 8px 10px; font-weight: 600; font-size: .9rem; }

/* Fix: câmpurile de sumă (lei nu se mai suprapune) + spațiere în formulare pe carduri */
.money-input input { padding-right: 48px !important; }
.money-input em { bottom: 50%; transform: translateY(50%); }
.form label.money-input { position: relative; }
.form label.money-input > span { display: block; }
.form label.money-input em { top: auto; bottom: 22px; transform: translateY(50%); }
.form label.money-input.big em { bottom: 27px; }
.form > .card { display: flex; flex-direction: column; gap: 14px; }
.form > .card > h2 { margin: 0; }
