/* Dark teal theme with soft glow (html[data-theme=dark]), loaded after app.css; the home banner and tiles use it in both themes. */
html[data-theme=dark]{--bg:#062631;--bg2:#0b4556;--panel:rgba(9,58,73,.78);--panel-solid:#0b3d4c;--line:rgba(126,222,240,.18);  --ink:#eaf8fb;--muted:#9fc6d1;--accent:#2ec5e6;--accent2:#1a8fd8;--glow:rgba(46,197,230,.45);--white:#0b3d4c}
html[data-theme=dark]{background:var(--bg)}
html[data-theme=dark] body{color:var(--ink);background:  radial-gradient(1200px 500px at 85% -10%,rgba(46,197,230,.22),transparent 60%),  radial-gradient(900px 600px at -10% 110%,rgba(26,143,216,.20),transparent 60%),  linear-gradient(160deg,#04202a 0%,#073443 45%,#0b4a5c 100%) fixed}
html[data-theme=dark] a{color:#7fe3f7}html[data-theme=dark] a:hover{color:#b6f1fb}
html[data-theme=dark] :focus-visible{outline-color:var(--accent)}
html[data-theme=dark] .skip-link{background:var(--panel-solid);color:var(--ink)}

/* Sidebar */
html[data-theme=dark] .sidebar{background:linear-gradient(180deg,#041b23,#062a35);border-right:1px solid var(--line);box-shadow:4px 0 30px rgba(0,0,0,.25)}
html[data-theme=dark] .brand,html[data-theme=dark] .brand small{color:var(--ink)}html[data-theme=dark] .brand small{color:var(--muted)}
html[data-theme=dark] .brand img,html[data-theme=dark] .app-title img{background:white;border-radius:50%;padding:3px;box-shadow:0 0 18px var(--glow)}
html[data-theme=dark] nav a{color:#a9cfd9}
html[data-theme=dark] nav a:hover{background:rgba(46,197,230,.12);color:#e6fbff}
html[data-theme=dark] nav a.active{background:linear-gradient(90deg,rgba(46,197,230,.35),rgba(46,197,230,.08));color:#fff;box-shadow:inset 3px 0 0 var(--accent)}
html[data-theme=dark] .account{color:var(--muted)}

/* Top bar and text */
html[data-theme=dark] .app-title strong{color:var(--ink)}html[data-theme=dark] .app-title span,html[data-theme=dark] .muted,html[data-theme=dark] footer{color:var(--muted)}
html[data-theme=dark] h1{letter-spacing:.01em;text-shadow:0 0 22px rgba(46,197,230,.35)}
html[data-theme=dark] .avatar{background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;box-shadow:0 0 16px var(--glow)}

/* Cards */
html[data-theme=dark] .card{background:var(--panel);border:1px solid var(--line);box-shadow:0 10px 30px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.04);backdrop-filter:blur(6px)}
html[data-theme=dark] article{border-bottom-color:var(--line)}

/* Buttons */
html[data-theme=dark] button,html[data-theme=dark] .button{background:linear-gradient(135deg,#27c0e3,#1679c9);color:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.08),0 6px 18px rgba(22,121,201,.35)}
html[data-theme=dark] button:hover,html[data-theme=dark] .button:hover{box-shadow:0 0 0 1px rgba(255,255,255,.15),0 0 22px var(--glow);color:#fff}
html[data-theme=dark] .secondary,html[data-theme=dark] button.secondary,html[data-theme=dark] .button.secondary{background:rgba(46,197,230,.12);color:#bff3fd;box-shadow:inset 0 0 0 1px rgba(46,197,230,.45)}
html[data-theme=dark] .secondary:hover,html[data-theme=dark] .button.secondary:hover{background:rgba(46,197,230,.22);color:#fff}

/* Forms */
html[data-theme=dark] input:not([type=checkbox]):not([type=radio]):not([type=hidden]),html[data-theme=dark] select,html[data-theme=dark] textarea{background:rgba(3,30,39,.75);border:1px solid var(--line);color:var(--ink)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#6f98a4}
html[data-theme=dark] input:focus,html[data-theme=dark] select:focus,html[data-theme=dark] textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(46,197,230,.18);outline:none}
html[data-theme=dark] select option{background:#0b3d4c;color:var(--ink)}
html[data-theme=dark] input[type=date]{color-scheme:dark}
html[data-theme=dark] fieldset{border-color:var(--line)}
html[data-theme=dark] .helptext,html[data-theme=dark] form .helptext{color:var(--muted)}
html[data-theme=dark] details summary{color:#7fe3f7}

/* Tables, labels, notices */
html[data-theme=dark] th,html[data-theme=dark] td{border-bottom-color:var(--line)}html[data-theme=dark] th{color:var(--muted)}
html[data-theme=dark] .pill{background:rgba(46,197,230,.16);color:#9debfb}
html[data-theme=dark] .green{background:rgba(52,199,120,.16);color:#7be3a8}html[data-theme=dark] .amber{background:rgba(240,176,60,.16);color:#f5c76a}html[data-theme=dark] .red{background:rgba(240,90,105,.16);color:#ff9aa5}
html[data-theme=dark] .error,html[data-theme=dark] .errorlist{color:#ff9aa5}
html[data-theme=dark] .notice{background:rgba(52,199,120,.14);color:#aef0c9;border:1px solid rgba(52,199,120,.3)}

/* Work plan calendar */
html[data-theme=dark] .plan-views a{background:rgba(46,197,230,.08);color:#a9cfd9}html[data-theme=dark] .plan-views a.active{background:linear-gradient(135deg,#27c0e3,#1679c9);color:#fff}
html[data-theme=dark] .plan-month,html[data-theme=dark] .plan-week{border-color:var(--line)}
html[data-theme=dark] .plan-weekday,html[data-theme=dark] .plan-week-head,html[data-theme=dark] .plan-week-place{background:rgba(3,30,39,.55);color:var(--muted);border-color:var(--line)}
html[data-theme=dark] .plan-day,html[data-theme=dark] .plan-week>*{border-color:var(--line)}
html[data-theme=dark] .plan-day.outside{background:rgba(0,0,0,.12)}html[data-theme=dark] .plan-day.today,html[data-theme=dark] .plan-week-head.today{background:rgba(46,197,230,.16);color:#fff}
html[data-theme=dark] .plan-mini .plan-day.busy{background:rgba(46,197,230,.18)}
html[data-theme=dark] .plan-day-number,html[data-theme=dark] .plan-week-head{color:var(--ink)}
html[data-theme=dark] .plan-chip{background:rgba(46,197,230,.16);color:#d6f7fd;border-left:3px solid var(--accent)}html[data-theme=dark] .plan-chip:hover{background:rgba(46,197,230,.3)}
html[data-theme=dark] .plan-count{color:#7fe3f7}

/* Home: banner and tile menu (both themes) */
.hero{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:32px 36px;margin:0 0 26px;border-radius:22px;border:1px solid rgba(126,222,240,.18);
  background:radial-gradient(600px 220px at 75% 50%,rgba(46,197,230,.35),transparent 70%),linear-gradient(120deg,#05222c,#0a4152 55%,#0d5468);box-shadow:0 18px 40px rgba(0,0,0,.35)}
.hero::before,.hero::after{content:"";position:absolute;inset:auto -10% -40% -10%;height:120%;pointer-events:none;
  background:repeating-radial-gradient(ellipse at 30% 120%,transparent 0 18px,rgba(120,230,250,.07) 19px 20px);transform:rotate(-6deg)}
.hero::after{inset:-60% -20% auto 30%;transform:rotate(12deg);opacity:.7}
.hero>*{position:relative;z-index:1}
.hero h1{font-size:34px;font-weight:800;text-transform:uppercase;margin:0 0 6px;text-shadow:0 0 26px rgba(46,197,230,.6)}
.hero .hero-role{font-size:17px;color:#cdeef6;margin:0 0 14px}
.hero .hero-chips{display:flex;flex-wrap:wrap;gap:8px}
.hero .hero-chips span{border:1px solid rgba(190,240,250,.6);border-radius:20px;padding:5px 14px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#e6fbff}
.hero-photo{flex-shrink:0;width:132px;height:132px;border-radius:50%;display:grid;place-items:center;font-size:46px;font-weight:800;color:#fff;
  background:linear-gradient(135deg,#27c0e3,#1679c9);box-shadow:0 0 0 4px rgba(255,255,255,.08),0 0 40px rgba(46,197,230,.45);overflow:hidden}
.hero-photo img{width:100%;height:100%;object-fit:cover}
.tiles-title{font-size:22px;font-weight:700;margin:6px 0 12px}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px;margin-bottom:28px}
.tile{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;min-height:150px;padding:18px;border-radius:16px;text-decoration:none;color:#fff;
  border:1px solid rgba(126,222,240,.18);background:radial-gradient(160px 120px at 80% 85%,rgba(46,197,230,.35),transparent 70%),linear-gradient(150deg,#06303c,#0a4a5d);box-shadow:0 10px 24px rgba(0,0,0,.28);transition:transform .15s,box-shadow .15s}
.tile::after{content:"";position:absolute;left:-20%;right:-20%;bottom:28%;height:40px;background:radial-gradient(ellipse at center,rgba(120,230,250,.25),transparent 70%);transform:rotate(-8deg);pointer-events:none}
.tile:hover{transform:translateY(-3px);box-shadow:0 14px 30px rgba(0,0,0,.35),0 0 26px rgba(46,197,230,.45);color:#fff}
.tile-name{position:relative;z-index:1;font-weight:800;font-size:14px;text-transform:uppercase;letter-spacing:.03em;line-height:1.25}
.tile-icon{position:relative;z-index:1;align-self:flex-end;width:62px;height:62px;filter:drop-shadow(0 0 12px rgba(46,197,230,.8))}
.tile-count{position:absolute;top:14px;right:14px;z-index:1;min-width:26px;padding:2px 8px;border-radius:14px;background:#ff6b81;color:#fff;font-size:12px;font-weight:700;text-align:center}
@media(max-width:600px){.hero{flex-direction:column-reverse;align-items:flex-start;padding:22px}.hero h1{font-size:24px}.hero-photo{width:96px;height:96px;font-size:34px}.tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.tile{min-height:130px;padding:14px}.tile-icon{width:48px;height:48px}}

/* Light theme: same teal accents on a light background */
html[data-theme=light]{--bg:#eef7f9;--line:#d5e9ee;--ink:#111;--muted:#555;--accent:#1aa6c8;--glow:rgba(26,166,200,.35)}
html[data-theme=light] body{background:linear-gradient(160deg,#f4fbfc,#e3f2f6) fixed;color:var(--ink)}
html[data-theme=light] a{color:#111}
html[data-theme=light] nav a:hover,html[data-theme=light] nav a.active{background:#dcf2f7;color:#111}
html[data-theme=light] nav a.active{box-shadow:inset 3px 0 0 var(--accent)}
html[data-theme=light] button,html[data-theme=light] .button{background:linear-gradient(135deg,#27c0e3,#1679c9);color:#fff}
html[data-theme=light] .secondary,html[data-theme=light] .button.secondary{background:#dcf2f7;color:#111}
html[data-theme=light] .avatar{background:#d3f0f7;color:#111}
html[data-theme=light] details summary{color:#111}
html[data-theme=light] .pill{background:#dcf2f7;color:#111}
html[data-theme=light] .plan-views a.active{background:linear-gradient(135deg,#27c0e3,#1679c9);color:#fff}
html[data-theme=light] .plan-chip{background:#dcf2f7;color:#111;border-left:3px solid var(--accent)}
html[data-theme=light] .plan-day.today,html[data-theme=light] .plan-week-head.today{background:#e6f6fa}
html[data-theme=light] h1,html[data-theme=light] h2,html[data-theme=light] h3,html[data-theme=light] .brand,html[data-theme=light] nav a{color:#111}
html[data-theme=light] h1{text-shadow:none}html[data-theme=light] .hero h1{color:#fff;text-shadow:0 0 26px rgba(46,197,230,.6)}html[data-theme=light] .hero a{color:#bff3fd}

/* Theme switch in the top bar */
.app-top{flex-wrap:wrap}.theme-switch{margin-left:auto}.theme-switch button{padding:8px 14px;font-size:13px}
.hero{color:#eaf8fb}.hero a{color:#bff3fd}
html[data-theme] .tile,html[data-theme] .tile:hover{color:#fff}.hero .card-portrait{text-align:center}.hero .card-portrait img{width:132px;height:132px;border-radius:50%;box-shadow:0 0 0 4px rgba(255,255,255,.08),0 0 40px rgba(46,197,230,.45);margin:0 auto 6px}.hero .card-portrait p{margin:4px 0;font-size:13px}
html[data-theme=dark] .plan-day.today .plan-day-number{color:#7fe3f7}

/* Logos of the two organisations */
.org-logos{display:flex;align-items:center;gap:8px;flex-shrink:0}
.app-title .org-logos img{width:52px;height:52px}
html[data-theme] .app-title img.logo-school{width:auto;height:52px;border-radius:8px;padding:2px 6px;background:#fff}
.login-logos{display:flex;align-items:center;gap:22px;flex-wrap:wrap;margin:6px 0 22px}
.login-logos img{height:110px;width:110px;object-fit:contain}
.login-logos img.logo-school{width:auto;height:96px;border-radius:14px;padding:6px 12px;background:#fff}
html[data-theme=dark] .login-logos img{box-shadow:0 0 22px var(--glow)}
html[data-theme=dark] .login-logos img:first-child{background:#fff;border-radius:50%;padding:4px}
@media(max-width:600px){.login-logos img{height:80px;width:80px}.login-logos img.logo-school{height:70px;width:auto}}

/* Round photo: banner, top bar and the upload page */
a.hero-photo{position:relative;text-decoration:none;color:#fff}
.hero-photo-edit{position:absolute;left:0;right:0;bottom:0;padding:6px 0 10px;background:rgba(3,25,33,.62);color:#fff;font-size:11px;font-weight:700;text-align:center;opacity:0;transition:opacity .15s}
a.hero-photo:hover .hero-photo-edit,a.hero-photo:focus .hero-photo-edit{opacity:1}
.avatar{overflow:hidden;text-decoration:none}.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-edit{display:flex;align-items:center;gap:28px;flex-wrap:wrap}

/* «Общее / организации / филиалы» buttons */
.scope-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.scope-buttons a,html[data-theme] .scope-buttons a{border:1px solid rgba(190,240,250,.6);border-radius:20px;padding:6px 16px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#e6fbff;text-decoration:none;transition:background .15s,box-shadow .15s}
.scope-buttons a:hover,html[data-theme] .scope-buttons a:hover{background:rgba(126,222,240,.18);box-shadow:0 0 14px rgba(46,197,230,.45);color:#fff}
.scope-buttons a.active,html[data-theme] .scope-buttons a.active{background:linear-gradient(135deg,#27c0e3,#1679c9);border-color:transparent;color:#fff}
.stat-value{position:relative;z-index:1;font-size:40px;font-weight:800;line-height:1;margin-top:10px;text-shadow:0 0 18px rgba(46,197,230,.7)}
.stat-tiles .tile-icon{width:46px;height:46px;position:absolute;right:16px;bottom:16px}

/* Staff card: tiles first, one section at a time */
.profile-section{display:none}
.profile-section:target,.profile-section:has(:target),.profile-section.is-open{display:block}
.profile-page:has(.profile-section:target,.profile-section :target,.profile-section.is-open) .profile-tiles,
.profile-page:has(.profile-section:target,.profile-section :target,.profile-section.is-open) .tiles-title{display:none}
.profile-back{margin:0 0 10px;font-size:14px}
.hero .card-photo-round{width:132px;height:132px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 4px rgba(255,255,255,.08),0 0 40px rgba(46,197,230,.45)}
/* Section tabs: the pages of the open menu section, shown above the page. */
html nav.section-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 18px;padding:0 0 12px;border-bottom:1px solid var(--line);overflow:visible;max-width:none}
html nav.section-tabs a,html[data-theme] nav.section-tabs a{flex:0 0 auto;justify-content:flex-start;min-width:0;padding:8px 14px;font-size:14px;border-radius:999px;box-shadow:none;border:1px solid var(--line)}
html[data-theme] nav.section-tabs a.active{box-shadow:none;border-color:var(--accent);font-weight:700}
.nav-count{display:inline-block;min-width:20px;padding:1px 6px;margin-left:4px;border-radius:999px;background:var(--accent);color:#04161c;font-size:12px;font-weight:700;text-align:center;line-height:18px}
.topright .bell{position:relative;text-decoration:none;font-size:20px;line-height:1;padding:6px}
.topright .bell .nav-count{position:absolute;top:-6px;right:-10px}
@media(max-width:1000px){html nav.section-tabs a,html[data-theme] nav.section-tabs a{padding:8px 12px;font-size:14px}}
@media(max-width:600px){html nav.section-tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:8px}}
.my-day h3{margin:16px 0 6px;font-size:16px}.my-day-list{margin:0;padding-left:18px;line-height:1.8}.my-day a.warn{color:#e8a33d;font-weight:700}
.role-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}.role-row span{flex:1 1 280px}.role-row input[name=reason]{flex:0 1 240px}
/* Grant writer's board */
html nav.gb-tabs{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 14px;max-width:none}
html nav.gb-tabs a,html[data-theme] nav.gb-tabs a{flex:0 0 auto;min-width:0;padding:7px 14px;font-size:14px;border-radius:10px;box-shadow:none;border:1px solid var(--line);text-decoration:none;color:var(--ink)}
html[data-theme] nav.gb-tabs a.active{border-color:var(--accent);background:rgba(46,197,230,.16);font-weight:700}
html[data-theme] nav.gb-tabs a.gb-who{margin-left:auto;border-style:dashed}
.gb-board{display:flex;gap:12px;overflow-x:auto;padding-bottom:8px;align-items:flex-start}
.gb-col{flex:1 1 200px;min-width:200px;max-width:340px;background:var(--panel,rgba(0,0,0,.03));border:1px solid var(--line);border-radius:14px;padding:10px}
.gb-col h2{font-size:15px;margin:2px 4px 10px}
.gb-card{background:var(--panel-solid,#fff);border:1px solid var(--line);border-left:5px solid #8a96a3;border-radius:12px;padding:10px 12px;margin:0 0 10px}
.gb-card.p-urgent{border-left-color:#e0453a}.gb-card.p-medium{border-left-color:#e39a12}.gb-card.p-low{border-left-color:#3b9d4b}
.gb-card h3{font-size:15px;margin:6px 0 8px;line-height:1.3}.gb-card h3 a{color:var(--ink)}
.gb-top{margin:0;display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:13px}
.gb-card dl{display:grid;grid-template-columns:auto 1fr;gap:3px 8px;margin:0;font-size:12.5px}
.gb-card dt{color:var(--muted);text-transform:uppercase;font-size:10.5px;letter-spacing:.03em;padding-top:2px}
.gb-card dd{margin:0;overflow-wrap:anywhere}
.gb-late{color:#e0453a;font-weight:700}.gb-near{color:#e39a12;font-weight:700}
.gb-move{display:flex;justify-content:space-between;gap:6px;margin-top:8px}.gb-move form:only-child{margin-left:auto}
.gb-move button{padding:4px 14px;min-width:0}
.gb-empty{font-size:13px;margin:4px}
html button.danger,html[data-theme] button.danger{background:#e0453a;color:#fff;box-shadow:none}
@media (max-width:700px){.gb-col{flex-basis:78vw;min-width:78vw}}
.month-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:4px 12px}
.month-grid p{margin:4px 0}.month-grid input{width:100%}
.plan-line-actions{font-size:12.5px;margin-top:4px}

/* A bill in the window over the charges sheet (?embed=1): no menu, the page fills the window. */
body.embed main{margin-left:0;padding:14px 18px;max-width:none}
dialog.bill-window{width:min(1100px,96vw);height:92vh;max-height:92vh;padding:0;border:1px solid var(--line,#cfd6e4);border-radius:14px;background:var(--bg);color:var(--ink);overflow:hidden}
dialog.bill-window[open]{display:flex;flex-direction:column}
dialog.bill-window::backdrop{background:rgba(5,15,25,.6)}
.bill-window-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--line,#cfd6e4)}
.bill-window iframe{flex:1;width:100%;border:0;background:var(--bg)}
button.small{padding:4px 10px;font-size:.85rem;margin-top:4px}
