/* =================================================================
   CALENDAR · PLANIFICATOR — stiluri
   Organizat pe secțiuni:
     1. Variabile (temă)
     2. Reset & bază
     3. Componente reutilizabile (butoane, câmpuri)
     4. Ecran de logare
     5. Bara de sus
     6. Toolbar calendar + grilă
     7. Modal cu sarcini
     8. Toast
     9. Responsive (telefon)
   ================================================================= */

/* ---------- 1. Variabile (temă) ---------- */
:root {
  /* culori */
  --bg:          #FFF6EC;   /* fundal cald, crem */
  --surface:     #FFFFFF;   /* carduri */
  --ink:         #211B17;   /* text principal */
  --muted:       #8A7F76;   /* text secundar */
  --line:        #EFE3D5;   /* linii / borduri */
  --accent:      #F4622E;   /* portocaliu viu (acțiune) */
  --accent-dark: #D94E1F;
  --accent-soft: #FDE7DD;
  --done:        #2FA86A;   /* verde — îndeplinit */
  --done-soft:   #E4F4EB;
  --danger:      #E2453B;

  /* forme */
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 10px 30px rgba(33, 27, 23, 0.10);
  --shadow-sm: 0 3px 10px rgba(33, 27, 23, 0.07);

  /* fonturi */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body:    "Plus Jakarta Sans", system-ui, sans-serif;
}

/* ---------- 2. Reset & bază ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 100% -10%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(700px 500px at -10% 110%, var(--accent-soft) 0%, transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; }

[hidden] { display: none !important; }

.screen { min-height: 100%; }


/* ---------- 3. Componente reutilizabile ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(244, 98, 46, 0.35); }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--hover); }

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.875rem; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  font-size: 1.25rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(0.94); }

.field { display: block; margin-bottom: 1rem; text-align: left; }
.field-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 0.35rem; }
.field input,
.task-form input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.task-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}


/* ---------- 4. Ecran de logare ---------- */
#login-screen {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem 2rem;
  text-align: center;
}
.brand-mark {
  font-size: 2.6rem;
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border-radius: 22px;
  transform: rotate(-4deg);
}
.login-title { font-size: 1.7rem; }
.login-sub { color: var(--muted); margin: 0.4rem 0 1.6rem; font-size: 0.95rem; }
.form-error {
  margin: 0.9rem 0 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}


/* ---------- 5. Bara de sus ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark.sm { font-size: 1.3rem; width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; }
.who { font-weight: 600; color: var(--muted); font-size: 0.9rem; }


/* ---------- 6. Toolbar calendar + grilă ---------- */
.container { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.cal-nav { display: flex; align-items: center; gap: 0.6rem; }
.month-label {
  font-size: 1.45rem;
  min-width: 9.5rem;
  text-align: center;
  text-transform: capitalize;
}
.cal-tools { display: flex; align-items: center; gap: 0.85rem; }
.month-stats { font-size: 0.85rem; color: var(--muted); font-weight: 500; }

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

/* bara de admin (selector de useri) */
.admin-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.picker-label { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.user-picker {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.user-picker:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.readonly-tag {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}
.cell:hover { box-shadow: var(--shadow-sm); border-color: #E0CFBC; transform: translateY(-1px); }
.cell.empty { background: transparent; border: 0; cursor: default; }
.cell.empty:hover { box-shadow: none; transform: none; }

.cell.today { border-color: var(--accent); }
.cell.today .cell-num {
  background: var(--accent); color: #fff;
  width: 1.6rem; height: 1.6rem;
  display: grid; place-items: center;
  border-radius: 50%;
}
.cell-num { font-weight: 700; font-size: 0.92rem; }

/* punctele care arată câte sarcini are ziua */
.cell-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dot.done { background: var(--done); }
.cell-count {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
}


/* ---------- 7. Modal cu sarcini ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(2px);
  animation: fade 0.2s ease;
}
.sheet {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  animation: pop 0.22s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.sheet-title { font-size: 1.25rem; text-transform: capitalize; }

.task-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.empty-hint { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 1.2rem 0; }

.task {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.task:last-child { border-bottom: 0; }

/* checkbox stilizat */
.check { position: relative; cursor: pointer; flex-shrink: 0; padding-top: 2px; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-radius: 7px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check .box::after { content: "✓"; color: #fff; font-size: 0.8rem; font-weight: 700; opacity: 0; transform: scale(0.5); transition: 0.15s ease; }
.check input:checked + .box { background: var(--done); border-color: var(--done); }
.check input:checked + .box::after { opacity: 1; transform: scale(1); }

.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; display: block; word-break: break-word; }
.task-time { color: var(--accent); font-weight: 700; margin-right: 0.35rem; }
.task-note { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.1rem; word-break: break-word; }

.task.done .task-title,
.task.done .task-note { text-decoration: line-through; color: var(--muted); }
.task.done .task-time { color: var(--muted); }

.task-actions { display: flex; gap: 0.2rem; flex-shrink: 0; }
.mini-btn {
  border: 0; background: transparent; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 0.95rem; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.mini-btn:hover { background: var(--hover); color: var(--ink); }
.mini-btn.del:hover { color: var(--danger); }

/* formular adăugare/editare */
.task-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.task-form-row { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.task-form-row #t-time { max-width: 8rem; }
.task-form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.7rem; }


/* ---------- 8. Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.4rem; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 60;
  animation: pop 0.2s ease;
}


/* ---------- 9. Responsive (telefon) ---------- */
@media (max-width: 560px) {
  .container { padding: 1rem 0.8rem 3rem; }
  .month-label { font-size: 1.2rem; min-width: 7.5rem; }
  .grid, .weekdays { gap: 5px; }
  .cell { padding: 0.3rem 0.35rem; border-radius: 9px; }
  .cell-num { font-size: 0.82rem; }
  .cell.today .cell-num { width: 1.4rem; height: 1.4rem; }
  .dot { width: 6px; height: 6px; }

  /* pe telefon modalul urcă de jos ca o „foaie" */
  .modal { align-items: flex-end; }
  .sheet {
    max-width: 100%;
    max-height: 90vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: calc(1.3rem + env(safe-area-inset-bottom));
    animation: slideUp 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
  }
  .task-form-row { flex-direction: column; }
  .task-form-row #t-time { max-width: 100%; }
}

/* ---------- animații ---------- */
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop    { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp{ from { transform: translateY(100%); } to { transform: translateY(0); } }


/* =================================================================
   VEDERI MULTIPLE (Zi / Săptămână / Lună / Listă) + oră 24h
   ================================================================= */

/* --- taburi de vedere --- */
.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1rem;
}
.view-tab {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.4rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.view-tab:hover { background: var(--hover); }
.view-tab.active { background: var(--accent); color: #fff; box-shadow: 0 3px 9px rgba(244,98,46,0.3); }

/* --- rând compact de sarcină (săptămână/zi/listă) --- */
.row-task {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}
.row-task:hover { background: var(--hover); }
.rt-main { flex: 1; min-width: 0; }
.rt-title { font-weight: 600; word-break: break-word; }
.rt-time { color: var(--accent); font-weight: 700; margin-right: 0.35rem; }
.rt-note { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.05rem; word-break: break-word; }
.row-task.done .rt-title, .row-task.done .rt-note { text-decoration: line-through; color: var(--muted); }
.row-task.done .rt-time { color: var(--muted); }

/* --- buton „adaugă" --- */
.add-btn {
  width: 100%;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-dark);
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.add-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

/* --- SĂPTĂMÂNĂ --- */
.week-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
}
.day-card.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.day-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.4rem; padding: 0.2rem 0.3rem 0.5rem;
  border-bottom: 1px solid var(--line); margin-bottom: 0.4rem;
  cursor: pointer;
}
.dc-dow  { font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.dc-date { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.dc-empty { color: var(--line); text-align: center; padding: 0.6rem 0; font-weight: 700; }

/* --- ZI --- */
.day-single {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem;
}

/* --- LISTĂ (agendă) --- */
.agenda {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.6rem 0.8rem;
}
.agenda-day {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: capitalize;
  color: var(--ink);
  padding: 0.8rem 0.3rem 0.35rem;
  position: sticky; top: 0;
  background: var(--surface);
}
.agenda-day:first-child { padding-top: 0.3rem; }

/* --- selector de oră 24h --- */
.time-picker { display: flex; align-items: center; gap: 0.25rem; }
.time-sel {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  cursor: pointer;
}
.time-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.time-colon { font-weight: 700; color: var(--muted); }

/* --- responsive --- */
@media (max-width: 560px) {
  .view-tab { font-size: 0.82rem; padding: 0.5rem 0.2rem; }
  .week-wrap { grid-template-columns: 1fr; } /* pe telefon: o zi sub alta */
}


/* =================================================================
   TEME DE CULOARE (5, inclusiv dark mode)
   Schema implicită (Mandarină) e în :root. Aici doar variabilele extra
   și suprascrierile pentru celelalte teme.
   ================================================================= */
:root {
  --hover:      rgba(0,0,0,0.04);
  --topbar-bg:  rgba(255,255,255,0.75);
  --backdrop:   rgba(33,27,23,0.45);
}

[data-theme="ocean"] {
  --bg:#EFF6FB; --surface:#FFFFFF; --ink:#11202B; --muted:#647785; --line:#DBE8F0;
  --accent:#1E88C7; --accent-dark:#1668A0; --accent-soft:#DDEEF8;
  --topbar-bg:rgba(255,255,255,0.8); --backdrop:rgba(17,32,43,0.45);
}
[data-theme="lavanda"] {
  --bg:#F5F2FC; --surface:#FFFFFF; --ink:#1F1A2B; --muted:#766E8A; --line:#E6DEF5;
  --accent:#7C5CDB; --accent-dark:#6246B8; --accent-soft:#ECE6FB;
  --topbar-bg:rgba(255,255,255,0.8); --backdrop:rgba(31,26,43,0.45);
}
[data-theme="zmeura"] {
  --bg:#FCF3F6; --surface:#FFFFFF; --ink:#2A1620; --muted:#8A6E78; --line:#F1DDE5;
  --accent:#D6336C; --accent-dark:#B02556; --accent-soft:#FBE2EC;
  --topbar-bg:rgba(255,255,255,0.8); --backdrop:rgba(42,22,32,0.45);
}
[data-theme="intuneric"] {
  --bg:#15171C; --surface:#1E2128; --ink:#ECEAE6; --muted:#9AA0A8; --line:#2C313A;
  --accent:#F4733E; --accent-dark:#D95E27; --accent-soft:#3A2A22;
  --done:#36B877; --done-soft:#1E3329;
  --hover:rgba(255,255,255,0.06); --topbar-bg:rgba(24,26,31,0.85); --backdrop:rgba(0,0,0,0.6);
  --shadow:0 10px 30px rgba(0,0,0,0.45); --shadow-sm:0 3px 10px rgba(0,0,0,0.3);
}

/* --- meniul de teme (bara de sus) --- */
.theme-menu { position: relative; }
.theme-pop {
  position: absolute; right: 0; top: 48px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 6px; z-index: 40; min-width: 190px;
  display: flex; flex-direction: column; gap: 2px;
  animation: pop 0.15s ease;
}
.swatch {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 8px;
  padding: 8px 10px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; color: var(--ink);
}
.swatch:hover { background: var(--hover); }
.swatch.active { background: var(--accent-soft); }
.sw-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.12); flex-shrink: 0; }
.sw-dot[data-c="mandarina"] { background: #F4622E; }
.sw-dot[data-c="ocean"]     { background: #1E88C7; }
.sw-dot[data-c="lavanda"]   { background: #7C5CDB; }
.sw-dot[data-c="zmeura"]    { background: #D6336C; }
.sw-dot[data-c="intuneric"] { background: #15171C; }

/* --- repetare în formular --- */
.recur-row { align-items: center; }
.until-wrap, .date-wrap { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.6rem; }
.until-wrap input[type="date"], .date-wrap input[type="date"] {
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.5rem 0.6rem;
}
.until-wrap input[type="date"]:focus, .date-wrap input[type="date"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.date-wrap { margin-bottom: 0.7rem; }

/* --- indicator „se repetă" --- */
.recur-badge { font-size: 0.8rem; opacity: 0.7; margin-left: 4px; }

/* butonul de adăugare din vederea Listă — același aspect ca la „Zi", doar spațiere */
.add-btn-list { margin: 0 0 0.9rem; }


/* =================================================================
   DESIGN REFRESH v2 — strat de rafinare (suprascrie baza)
   Direcție: „warm editorial" — profunzime moale, gradiente pe accent,
   mișcare discretă la încărcare, suprafețe tactile. Adaptat pe teme.
   ================================================================= */

/* --- accent secundar (pentru gradiente) + forme/umbre mai fine --- */
:root {
  --accent-2: #FF8A3D;
  --radius: 20px; --radius-sm: 13px;
  --shadow:    0 1px 2px rgba(20,14,10,0.05), 0 22px 48px -20px rgba(20,14,10,0.30);
  --shadow-sm: 0 2px 10px rgba(20,14,10,0.09);
}
[data-theme="ocean"]    { --accent-2:#3FB0E8; }
[data-theme="lavanda"]  { --accent-2:#9D80F0; }
[data-theme="zmeura"]   { --accent-2:#F0588C; }
[data-theme="intuneric"]{
  --accent-2:#FF935E;
  --shadow:    0 2px 6px rgba(0,0,0,0.45), 0 24px 50px -20px rgba(0,0,0,0.7);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.4);
}

/* --- fundal cu mai multă atmosferă --- */
body {
  background:
    radial-gradient(1200px 640px at 112% -18%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(1000px 760px at -18% 118%, var(--accent-soft) 0%, transparent 55%),
    var(--bg);
  line-height: 1.5;
}

/* --- focus vizibil (accesibilitate + finisaj) --- */
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* --- butoane --- */
.btn { font-weight: 700; letter-spacing: -0.01em; border-radius: var(--radius-sm);
  transition: transform .14s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, filter .2s ease; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 7px 18px -5px var(--accent), 0 2px 4px rgba(0,0,0,0.08);
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 12px 26px -7px var(--accent); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { backdrop-filter: blur(4px); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.icon-btn { box-shadow: var(--shadow-sm); transition: transform .14s cubic-bezier(.2,.8,.2,1), box-shadow .2s, background .2s; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* --- câmpuri --- */
.field input, .task-form input, .time-sel, .user-picker,
.until-wrap input[type="date"], .date-wrap input[type="date"] { border-radius: var(--radius-sm); }
.field input:focus, .task-form input:focus { box-shadow: 0 0 0 4px var(--accent-soft); }

/* --- ecran de logare (intrare animată, siglă pe gradient) --- */
.login-card {
  border-radius: 28px; padding: 2.7rem 2.2rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.brand-mark {
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff; border-radius: 24px; transform: rotate(-6deg);
  box-shadow: 0 12px 26px -8px var(--accent);
}
.brand-mark svg { width: 54%; height: 54%; }
.brand-mark.sm { border-radius: 13px; box-shadow: 0 6px 14px -5px var(--accent); }
.login-title { font-size: 1.95rem; letter-spacing: -0.03em; }
/* intrare în cascadă */
.brand-mark, .login-title, .login-sub, #login-form .field, #login-btn {
  animation: rise .55s cubic-bezier(.2,.8,.2,1) both;
}
.brand-mark   { animation-delay: .02s; }
.login-title  { animation-delay: .08s; }
.login-sub    { animation-delay: .14s; }
#login-form .field:nth-of-type(1) { animation-delay: .20s; }
#login-form .field:nth-of-type(2) { animation-delay: .26s; }
#login-btn    { animation-delay: .32s; }

/* --- bara de sus --- */
.topbar { backdrop-filter: blur(14px) saturate(1.1); }
.brand-name { letter-spacing: -0.02em; font-size: 1.25rem; }

/* --- taburi de vedere --- */
.view-tabs { border-radius: 16px; padding: 5px; box-shadow: var(--shadow-sm); }
.view-tab { border-radius: 11px; transition: color .2s, background .25s, box-shadow .2s; }
.view-tab.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 7px 16px -6px var(--accent);
}

/* --- grila lunii --- */
.weekdays span { letter-spacing: 0.08em; }
.cell { border-radius: 14px; transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s, background .2s; }
.cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.cell.today { border-color: transparent; background: linear-gradient(165deg, var(--accent-soft), var(--surface)); box-shadow: inset 0 0 0 1.6px var(--accent); }
.cell.today .cell-num { background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 4px 10px -3px var(--accent); }
.dot { width: 8px; height: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.14); }

/* --- carduri (săptămână / zi / agendă) --- */
.day-card, .day-single, .agenda { border-radius: 18px; box-shadow: var(--shadow-sm); }
.day-card { transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
.day-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.day-card.today { border-color: transparent; box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent); }
.dc-dow { letter-spacing: -0.02em; }

/* --- rânduri + checkbox tactil --- */
.row-task { border-radius: 12px; }
.check .box { border-radius: 8px; }
.check input:checked + .box { animation: pop-check .28s cubic-bezier(.2,.8,.2,1.4); }
@keyframes pop-check { 0% { transform: scale(.65); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* --- modal --- */
.modal-backdrop { backdrop-filter: blur(7px); }
.sheet { border-radius: 26px; }

/* --- agenda: titlul zilei mai elegant --- */
.agenda-day { letter-spacing: -0.01em; }

/* --- MIȘCARE: fiecare vedere apare cu un „rise" la randare --- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
#view > * { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
#view .grid { animation-delay: .04s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- mobil: foaia rămâne lipită de jos (re-aplicat după refresh) --- */
@media (max-width: 560px) {
  .sheet { border-radius: 26px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .login-card { padding: 2.1rem 1.5rem; }
  .login-title { font-size: 1.7rem; }
}


/* =================================================================
   CATEGORII + FILTRU
   ================================================================= */
.cat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex-shrink: 0; }

/* selectorul din formular */
.cat-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.75rem; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.85rem;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.38rem 0.7rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.cat-chip:hover { border-color: var(--accent); }
.cat-chip:active { transform: scale(.96); }
.cat-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* bara de filtru */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 0.9rem; }
.filter-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.8rem;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.6rem; cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease;
}
.filter-chip:not(.active) { opacity: 0.4; text-decoration: line-through; }

/* pastila cu eticheta categoriei (în modal) */
.cat-pill {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  color: var(--c); border: 1.5px solid var(--c); vertical-align: middle;
  white-space: nowrap;
}

/* bară colorată pe rândul/elementul cu categorie */
.row-task.has-cat, .task.has-cat { position: relative; }
.row-task.has-cat::before, .task.has-cat::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3.5px; border-radius: 3px; background: var(--cat);
}


/* =================================================================
   SETĂRI (modal)
   ================================================================= */
.set-sec { padding: 0.2rem 0 1rem; border-top: 1px solid var(--line); margin-top: 0.6rem; }
.set-sec:first-of-type { border-top: 0; margin-top: 0; }
.set-h { font-family: var(--font-display); font-size: 1.05rem; margin: 0.2rem 0 0.4rem; }
.set-hint { font-size: 0.82rem; color: var(--muted); margin: 0 0 0.7rem; line-height: 1.45; }

.set-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 0.8rem; }
.set-grid label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.set-grid input {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.55rem 0.6rem; width: 100%;
}
.set-grid input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* editor categorii */
.cat-editor { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.7rem; }
.cat-edit-row { display: flex; align-items: center; gap: 0.5rem; }
.cat-edit-row input[type="text"] {
  flex: 1; font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.6rem;
}
.cat-edit-row input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cat-edit-row input[type="color"], .cat-add-row input[type="color"] {
  width: 38px; height: 38px; padding: 2px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex-shrink: 0;
}
.cat-add-row { display: flex; align-items: center; gap: 0.5rem; }
.cat-add-row input[type="text"] {
  flex: 1; font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.6rem;
}
.cat-add-row input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

@media (max-width: 560px) {
  .set-grid { grid-template-columns: 1fr 1fr 1fr; gap: 0.4rem; }
  .set-grid label { font-size: 0.72rem; }
}

/* --- submeniuri în Setări --- */
.set-tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 5px; margin-bottom: 1rem; }
.set-tab {
  flex: 1; font-family: var(--font-body); font-weight: 700; font-size: 0.85rem;
  color: var(--muted); background: transparent; border: 0; border-radius: 10px;
  padding: 0.5rem 0.4rem; cursor: pointer; transition: color .2s, background .25s, box-shadow .2s; white-space: nowrap;
}
.set-tab:hover { color: var(--ink); }
.set-tab.active { color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 6px 14px -6px var(--accent); }
.set-panel { animation: rise .3s cubic-bezier(.2,.8,.2,1) both; }

/* --- rânduri categorii în Setări (comutator + editare) --- */
.cat-edit-row { display: flex; align-items: center; gap: 0.6rem; }
.cat-edit-fields { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.cat-name-static { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }

/* comutator on/off */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-soft); }

/* hint când toate categoriile sunt ascunse */
.filter-empty { font-size: 0.8rem; color: var(--muted); font-style: italic; }

/* --- modalul de setări: panouri scrollabile (antet + taburi fixe) --- */
#settings-modal .sheet { overflow: hidden; }   /* colțurile rotunjite taie scroll-ul, doar aici */
.set-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -0.3rem; padding: 0 0.3rem; }
@supports (height: 100dvh) {
  .sheet { max-height: 88dvh; }
}

/* --- panoul Utilizatori (admin) --- */
.user-new { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.user-new input { flex: 1; min-width: 120px; font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.6rem; }
.user-new input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.user-admin-list { display: flex; flex-direction: column; gap: 0.7rem; }
.user-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.8rem; background: var(--surface); }
.user-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.user-name { font-weight: 700; }
.user-card-actions { display: flex; align-items: center; gap: 0.4rem; }
.user-access { margin-top: 0.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.user-access-note { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.access-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 0.25rem 0.6rem; cursor: pointer; }
.access-chip input { accent-color: var(--accent); }

/* logo = buton Acasă */
.topbar-brand { cursor: pointer; border-radius: 12px; transition: opacity .15s ease, transform .1s ease; }
.topbar-brand:hover { opacity: .85; }
.topbar-brand:active { transform: scale(.97); }
.topbar-brand:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* taburile din Setări: se așază pe mai multe rânduri dacă nu încap */
.set-tabs { flex-wrap: wrap; }
.set-tab { flex: 1 1 auto; }
@media (max-width: 560px) {
  .set-tab { font-size: 0.8rem; padding: 0.45rem 0.55rem; }
}

/* dialog de ștergere serie (3 opțiuni) */
.scope-sheet { max-width: 340px; }
.scope-hint { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0 1rem; }
.scope-btn { display: block; width: 100%; text-align: left; padding: 0.7rem 0.9rem; margin-bottom: 0.5rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all .12s ease; }
.scope-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.scope-btn.danger { color: #dc2626; }
.scope-btn.danger:hover { border-color: #dc2626; background: rgba(220,38,38,.08); }
.scope-btn.ghost { border: none; text-align: center; color: var(--muted); font-weight: 500; margin-bottom: 0; }

/* câmp obligatoriu „până la" */
.req-star { color: #dc2626; font-weight: 700; margin: 0 1px; }
.field-error { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.15) !important; }

/* formular schimbare parolă (tab Cont) */
.pw-form { display: flex; flex-direction: column; gap: 0.6rem; }
.pw-form input { font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.7rem; }
.pw-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pw-form .btn { align-self: flex-start; margin-top: 0.2rem; }

/* selectorul de zile (repetare „zile alese") */
.weekday-row { align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.weekday-label { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.weekday-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.wd-btn { min-width: 38px; padding: 0.4rem 0.5rem; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all .12s ease; }
.wd-btn:hover { border-color: var(--accent); }
.wd-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* selector nivel de acces (admin → Utilizatori) */
.access-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 0.2rem 0.5rem; }
.access-name { font-size: 0.82rem; font-weight: 600; }
.access-sel { border: none; background: transparent; font-family: var(--font-body); font-size: 0.8rem; color: var(--accent); font-weight: 700; cursor: pointer; }
.access-sel:focus { outline: none; }

/* drag & drop (vederea Săptămână) */
.row-task.draggable { cursor: grab; touch-action: none; }
.row-task.dragging { opacity: 0.35; }
.drag-ghost { position: fixed; transform: translate(-50%, -50%); z-index: 999; pointer-events: none;
  background: var(--surface); border-radius: 12px; padding: 0.35rem 0.6rem; box-shadow: var(--shadow); opacity: 0.96; max-width: 240px; }
.day-card.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }

/* --- progres / streak-uri --- */
.prog-body { display: flex; flex-direction: column; gap: 0.9rem; }
.prog-rate { text-align: center; }
.prog-rate-num { display: block; font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.prog-rate-lbl { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.prog-streaks { display: flex; gap: 0.6rem; }
.prog-card { flex: 1; text-align: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.4rem; }
.prog-card-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.prog-card-lbl { display: block; font-size: 0.78rem; color: var(--muted); }
.prog-hint { font-size: 0.8rem; color: var(--muted); text-align: center; margin: -0.3rem 0 0; }
.prog-bars-title { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.prog-bars { display: flex; gap: 4px; align-items: flex-end; }
.pbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pbar-track { width: 100%; height: 56px; background: var(--bg); border-radius: 5px; display: flex; align-items: flex-end; overflow: hidden; }
.pbar-fill { width: 100%; border-radius: 5px; min-height: 2px; background: var(--accent); }
.pbar-fill.full { background: var(--accent); }
.pbar-fill.part { background: var(--accent-soft); }
.pbar-fill.empty { background: transparent; }
.pbar-day { font-size: 0.7rem; color: var(--muted); }
.prog-export { align-self: center; margin-top: 0.3rem; }
