/* ===========================================================
   БРЕНДОВІ ТЕМИ (стиль Mangomint: м'яко, повітряно, градієнт).
   Накладається поверх styles.css при body.theme-* .
   Палітра задаётся переменными --th* ; структура — общая.
   Доступні класи: theme-mint | theme-lavender | theme-gold | theme-ocean
   (theme-mango = алиас lavender для сумісності).
   Откат: убрать класс theme-* у <body>.
   =========================================================== */

/* ---- палітри ---- */
body.theme-mint{
  --th:#10b39e; --th2:#34d399; --th-bg:#eff9f6; --th-tint:#e7f6f0;
  --th-line:#dcefe8; --th-glow:rgba(16,179,158,.12); --th-shadow:rgba(16,179,158,.5);
}
body.theme-lavender,body.theme-mango{
  --th:#7c5cff; --th2:#a855f7; --th-bg:#f5f4fb; --th-tint:#f1eeff;
  --th-line:#ece9f6; --th-glow:rgba(124,92,255,.10); --th-shadow:rgba(124,92,255,.55);
}
body.theme-gold{
  --th:#caa006; --th2:#f0b400; --th-bg:#faf7ee; --th-tint:#f6f1e1;
  --th-line:#efe8d4; --th-glow:rgba(230,184,0,.16); --th-shadow:rgba(202,160,6,.45);
}
body.theme-ocean{
  --th:#2563eb; --th2:#06b6d4; --th-bg:#eef4fc; --th-tint:#e7f0fb;
  --th-line:#dce8f6; --th-glow:rgba(37,99,235,.12); --th-shadow:rgba(37,99,235,.5);
}
body.theme-graphite{
  --th:#5d626b; --th2:#878c94; --th-bg:#f4f5f6; --th-tint:#eceef0;
  --th-line:#e2e4e7; --th-glow:rgba(93,98,107,.12); --th-shadow:rgba(80,85,94,.42);
}
/* «світла» = алиас на графіт (поточний дефолт КОДу). */
body.theme-light{
  --th:#5d626b; --th2:#878c94; --th-bg:#f4f5f6; --th-tint:#eceef0;
  --th-line:#e2e4e7; --th-glow:rgba(93,98,107,.12); --th-shadow:rgba(80,85,94,.42);
}
/* «темна» — окрема палітра, не успадковує body[class*="theme-"] світлі правила */
body.theme-dark{
  --th:#e6b800; --th2:#f0c829;
  --bg:#15171c; --panel:#1c1f26; --panel2:#22252d; --line:#2b2f37;
  --fg:#e6e8ec; --muted:#8a8f99;
  --accent:#e6b800; --accent2:#f0c829;
  --ok:#22c55e; --err:#ef4444;
  --radius:14px;
  --shadow:0 1px 2px rgba(0,0,0,.5), 0 18px 38px -22px rgba(0,0,0,.8);
  --shadow-lg:0 28px 70px -18px rgba(0,0,0,.85);
  --ring:0 0 0 3px rgba(230,184,0,.20);
  background:var(--bg) !important;
  color:var(--fg);
}
body.theme-dark .sidebar{background:linear-gradient(180deg,#1c1f26,#181a20);border-right:1px solid var(--line)}
body.theme-dark .topbar{background:#1c1f26;border-bottom:1px solid var(--line)}
body.theme-dark .logo span, body.theme-dark .tb-logo span{color:var(--accent)}
body.theme-dark #nav a{color:var(--fg)}
body.theme-dark #nav a:hover{background:var(--panel2)}
body.theme-dark #nav a.active{background:linear-gradient(135deg,var(--accent),#c9a200);color:#15171c;box-shadow:0 10px 22px -7px rgba(230,184,0,.35)}
body.theme-dark #nav a.active svg{color:#15171c}
body.theme-dark input, body.theme-dark select, body.theme-dark textarea{background:var(--panel2);color:var(--fg);border-color:var(--line)}
body.theme-dark .login-card, body.theme-dark .modal{background:var(--panel);color:var(--fg);border-color:var(--line)}
body.theme-dark table, body.theme-dark th, body.theme-dark td{border-color:var(--line)}
body.theme-dark .cal-wrap{border-color:var(--line)}
body.theme-dark .cal-headrow{background:var(--panel)}
body.theme-dark .auth-note{background:var(--panel2);color:var(--fg);border-color:var(--line)}
/* «користувацька» — палітра з inline-стилів body (--th, --th-bg, --accent ...). */
body.theme-custom{
  --th-bg:var(--user-bg,#f4f5f6);
  --th-tint:var(--user-tint,#eceef0);
  --th-line:var(--user-line,#e2e4e7);
  --th:var(--user-accent,#5d626b);
  --th2:var(--user-accent,#878c94);
  --th-glow:var(--user-glow,rgba(93,98,107,.12));
  --th-shadow:var(--user-shadow,rgba(80,85,94,.42));
}

/* ---- спільна структура (для будь-якої теми) ---- */
body[class*="theme-"]{
  --bg:var(--th-bg); --panel:#ffffff; --panel2:var(--th-tint); --line:var(--th-line);
  --accent:var(--th); --accent2:var(--th); --radius:16px;
  --shadow:0 1px 2px rgba(30,25,60,.05), 0 18px 42px -22px rgba(40,30,90,.2);
  --shadow-lg:0 28px 70px -18px rgba(30,25,70,.38);
  --ring:0 0 0 3px var(--th-glow);
  background:
    radial-gradient(1100px 460px at 90% -8%, var(--th-glow), transparent 60%),
    radial-gradient(900px 420px at -6% 4%, var(--th-glow), transparent 60%),
    var(--th-bg);
}

/* ліве меню */
body[class*="theme-"] .sidebar{background:linear-gradient(180deg,#ffffff,var(--th-tint));border-right:1px solid var(--line)}
body[class*="theme-"] .logo span,
body[class*="theme-"] .tb-logo span{color:var(--th)}
body[class*="theme-"] #nav{gap:4px;margin-top:10px}
body[class*="theme-"] #nav a{border-radius:13px;padding:11px 13px;font-weight:550}
body[class*="theme-"] #nav a:hover{background:var(--th-tint)}
body[class*="theme-"] #nav a:hover svg{color:var(--th)}
body[class*="theme-"] #nav a.active{
  background:linear-gradient(135deg,var(--th),var(--th2));
  color:#fff;font-weight:700;box-shadow:0 10px 22px -7px var(--th-shadow);
  transition:box-shadow .16s ease,transform .08s ease;
}
body[class*="theme-"] #nav a.active svg{color:#fff}
body[class*="theme-"] .who a{color:var(--th)}
body[class*="theme-"] main{padding:30px 36px}
body[class*="theme-"] .head h1{letter-spacing:-.03em}

/* календар */
body[class*="theme-"] .cal-wrap{
  border:1px solid var(--th-line);border-radius:22px;
  box-shadow:0 1px 2px rgba(30,25,60,.04), 0 30px 60px -30px rgba(40,30,90,.3);
  --cl-line:var(--th-line);--cl-hatch:var(--th-tint);
}
body[class*="theme-"] .cal-headrow{background:rgba(255,255,255,.86)}
body[class*="theme-"] .cal-head{min-height:68px;padding:13px 15px}
body[class*="theme-"] .cal-head img,
body[class*="theme-"] .cal-head .ph{width:42px;height:42px;box-shadow:0 0 0 2px #fff,0 3px 8px rgba(40,30,90,.16)}
body[class*="theme-"] .cal-head .cnt{color:var(--th);background:var(--th-tint)}
body[class*="theme-"] .cal-head.today{background:linear-gradient(180deg,var(--th-tint),#fff);box-shadow:inset 0 -2px 0 var(--th)}

/* картки записів */
body[class*="theme-"] .cal-card{border-radius:14px;border-left-width:4px;padding:8px 10px;box-shadow:0 2px 6px -1px rgba(40,30,90,.12)}
body[class*="theme-"] .cal-card:hover{box-shadow:0 12px 26px -8px rgba(40,30,90,.3)}
/* «нова» запис — у фірмовому кольорі теми; решта статусів семантичні */
body[class*="theme-"] .cal-card.new{background:var(--th-tint);border-color:var(--th);color:#33333d}
