@font-face{font-family:"IBM Plex Sans Arabic";src:url("../vendor/arabic-400.woff2") format("woff2");font-weight:400;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:"IBM Plex Sans Arabic";src:url("../vendor/arabic-600.woff2") format("woff2");font-weight:600;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:"IBM Plex Sans Arabic";src:url("../vendor/arabic-700.woff2") format("woff2");font-weight:700;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+0870-08FF,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:"IBM Plex Sans Arabic";src:url("../vendor/latin-400.woff2") format("woff2");font-weight:400;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F}
@font-face{font-family:"IBM Plex Sans Arabic";src:url("../vendor/latin-600.woff2") format("woff2");font-weight:600;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F}
@font-face{font-family:"IBM Plex Sans Arabic";src:url("../vendor/latin-700.woff2") format("woff2");font-weight:700;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F}

:root {
    color-scheme: light;
    --forest: #214d40;
    --deep: #173c30;
    --sage: #8baa91;
    --olive: #778b52;
    --ivory: #f7f5ef;
    --beige: #e8e3d7;
    --gold: #c5aa7b;
    --ink: #26332e;
    --muted: #566257;
    --surface: #fffdf8;
    --line: #e5e1d5;
    --pale: #edf1e4;
    --shadow: 0 6px 20px rgb(58 59 38 / .06), 0 1px 2px rgb(58 59 38 / .045);
    --radius: 19px;
    --danger: #9d3e38;
    --ease: 170ms ease;
    font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
    color: var(--ink);
    background: var(--ivory);
}
*, *::before, *::after { box-sizing:border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
a { color:inherit; text-decoration:none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, summary, select { cursor:pointer; }
button:disabled { cursor:default; opacity:.46; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #65854a; outline-offset: 3px; }
h1,h2,h3,p,ol,dl,dd { margin: 0; }
h1,h2,h3 { line-height:1.25; color:var(--deep); }
h1 { font-size: clamp(2rem,3.7vw,3.15rem); font-weight:700; }
h2 { font-size:1.24rem; }
h3 { font-size:1.05rem; }
small,.muted { color:var(--muted); }
svg.lucide { height:19px; width:19px; stroke-width:1.75; flex:none; vertical-align:middle; }
[hidden] { display:none !important; }
.skip { position:fixed; z-index:20; top:8px; right:8px; transform:translateY(-140%); padding:10px 18px; background:var(--surface); border-radius:8px; }
.skip:focus { transform:none; }

.btn,.icon-btn {
    min-height:44px; display:inline-flex; justify-content:center; align-items:center; gap:8px;
    border:1px solid transparent; border-radius:10px; font-weight:600; white-space:nowrap;
    transition:background var(--ease),border-color var(--ease),box-shadow var(--ease),color var(--ease);
}
.btn { padding:8px 15px; }
.icon-btn { min-width:44px; padding:6px; background:transparent; color:var(--forest); }
.icon-btn:hover,.plain:hover { background:var(--pale); }
.btn.primary { background:var(--forest); border-color:var(--forest); color:white; box-shadow:0 3px 8px #214d4024; }
.btn.primary:hover { background:var(--deep); }
.btn.quiet { border-color:#dedfd1; background:var(--surface); color:var(--forest); }
.btn.quiet:hover { background:var(--pale); border-color:var(--sage); }
.btn.plain { background:transparent; color:var(--forest); }
.btn.destructive { background:var(--danger); color:white; }
.icon-btn.danger { color:var(--danger); }
.icon-btn.danger:hover,.btn.destructive:hover { background:#7d312d; color:white; }
.btn:active,.icon-btn:active { filter:brightness(.91); }
.actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }

.admin { display:grid; grid-template-columns:232px minmax(0,1fr); direction:ltr; min-height:100vh; }
.sidebar,.workspace { direction:rtl; }
.sidebar {
    position:sticky; top:0; height:100dvh; min-height:570px; display:flex; flex-direction:column;
    padding:26px 16px 15px; overflow:auto; color:var(--ivory);
    background:radial-gradient(ellipse at 23% 91%,#526943 0%,transparent 61%),linear-gradient(155deg,#234b3a,#19382c 58%,#2b4835);
    isolation:isolate;
}
.sidebar::before {
    content:""; position:absolute; inset:auto 0 0; height:190px; pointer-events:none; z-index:-1;
    background:linear-gradient(#214d4000,#243e2e69),url("../images/campus.svg") center bottom / 335px auto no-repeat; opacity:.48;
}
.sidebar::after {
    content:""; position:absolute; left:0; bottom:100px; width:140px; height:175px; opacity:.24; pointer-events:none; z-index:-1;
    background:url("../images/canopy.svg") left top / 285px auto no-repeat; transform:rotate(-18deg);
}
.brand { display:grid; justify-items:center; gap:3px; margin:0 0 21px; padding:1px 7px 25px; border-bottom:1px solid #f6f4d731; }
.brand-mark { width:62px; height:auto; }
.brand .brand-mark { color:#f3e9c9; }
.brand strong { font-size:1.65rem; letter-spacing:-.03em; line-height:1.35; }
.brand span { font-size:.67rem; color:#e3ddc2; letter-spacing:.21em; }
.sidebar nav { display:grid; gap:4px; }
.nav-link,.sidebar-tree { min-height:45px; display:flex; align-items:center; gap:10px; padding:9px 10px; border:1px solid transparent; border-radius:9px; font-weight:600; font-size:.86rem; }
.nav-link svg { color:#e7e5ce; }
.nav-link:hover,.nav-link.current { background:#d9e6c82a; border-color:#e4ebd63c; }
.nav-link.current { box-shadow:inset -3px 0 #b8c69b; }
.sidebar-tree { margin-top:19px; border-color:#e5ebce51; color:#f2edd9; }
.sidebar-tree:hover { background:#d9e6c82a; }
.sidebar-tree svg:last-child { margin-inline-start:auto; width:15px; }
.sidebar-footer,.sidebar-foot { margin-top:auto; padding:26px 0 33px; display:grid; justify-items:center; text-align:center; color:#f9f3df; line-height:1.4; }
.sidebar-foot svg { margin-bottom:5px; height:25px; width:25px; }
.sidebar-foot span { font-size:.78rem; color:#f1ead4; }

.topbar { height:66px; display:flex; justify-content:space-between; align-items:center; gap:12px; background:#fffdf7; border-bottom:1px solid var(--line); padding:0 clamp(15px,2.7vw,39px); }
.topbar-name,.account { display:flex; align-items:center; gap:10px; }
.topbar-name { color:var(--forest); font-weight:600; }
.account { font-size:.89rem; }
.account strong,.account small { display:block; }
.account small { font-size:.72rem; }
.avatar { display:grid; place-items:center; width:37px; height:37px; border-radius:50%; background:var(--pale); color:var(--forest); }
.mobile-menu { display:none; }
.content { padding:22px clamp(14px,2.3vw,34px) 32px; min-height:calc(100dvh - 130px); max-width:1720px; margin-inline:auto; }
.footer { padding:13px clamp(14px,2.3vw,34px); border-top:1px solid var(--line); color:var(--muted); display:flex; justify-content:space-between; gap:12px; font-size:.8rem; }
.hero { position:relative; isolation:isolate; overflow:hidden; border:1px solid #e6e2d3; border-radius:var(--radius); background: radial-gradient(ellipse at 18% 33%, #f1eddc,transparent 67%),#faf8ef; box-shadow:var(--shadow); }
.hero::before,.hero::after { content:""; position:absolute; pointer-events:none; z-index:-1; }
.hero::before { inset:0 auto 0 0; width:74%; background:url("../images/campus.svg") 0 82% / min(91%,780px) auto no-repeat; opacity:.58; mask-image:linear-gradient(to right,#000 50%,transparent 100%); }
.hero::after { inset:0 auto 0 0; width:59%; background:url("../images/canopy.svg") left top / min(100%,620px) auto no-repeat; mask-image:linear-gradient(to right,#000 44%,transparent 100%); opacity:.86; }
.hero-copy { padding:clamp(20px,3vw,43px); max-width:750px; }
.hero-copy h1 { margin:7px 0 5px; }
.hero-copy > p:not(.eyebrow) { color:var(--muted); font-size:1.02rem; }
.hero-copy .btn { margin-top:19px; }
.dashboard-hero { min-height:228px; }
.page-hero { margin-bottom:19px; min-height:166px; }
.page-hero h1 { font-size:clamp(1.95rem,3.15vw,2.7rem); }
.eyebrow { display:flex; align-items:center; gap:7px; color:var(--forest); font-weight:600; font-size:.82rem; }
.eyebrow svg { height:17px; width:17px; }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-top:16px; }
.metric,.card { box-shadow:var(--shadow); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); min-width:0; }
.metric { display:flex; align-items:center; gap:13px; min-height:91px; padding:12px 15px; background:linear-gradient(135deg,#fffdf8,#f5f4eb); }
.metric-icon { border-radius:14px; height:47px; width:47px; flex:none; display:grid; place-items:center; color:var(--forest); background:#e4ecdf; }
.metric-icon svg { width:25px; height:25px; }
.metric-icon.olive { color:#596a36; background:#edf0da; }
.metric-icon.gold { color:#745f35; background:#f2ead6; }
.metric-icon.sage { color:#315946; background:#e3eee5; }
.metric p { color:var(--muted); font-size:.8rem; font-weight:600; }
.metric strong { color:var(--deep); font-size:1.78rem; font-variant-numeric:tabular-nums; line-height:1.02; }
.metric-note { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:.78rem; margin:9px 3px 14px; }
.metric-note svg { width:15px; height:15px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.67fr) minmax(0,1fr); gap:15px; margin-bottom:15px; }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px 17px; flex-wrap:wrap; }
.card-head h2 { display:flex; align-items:center; gap:8px; }
.card-head h2 svg { color:var(--forest); }
.card-head p { color:var(--muted); font-size:.82rem; margin-top:5px; }
.preview { overflow:hidden; background: radial-gradient(ellipse at 95% 104%,#eef0de 0%,transparent 46%),var(--surface); }
.preview-map { position:relative; display:grid; align-items:center; grid-template-columns:minmax(86px,112px) minmax(0,1fr); gap:34px; padding:12px 22px 22px; isolation:isolate; }
.preview-map::before { content:""; position:absolute; inset:4% 0 0 0; z-index:-1; opacity:.095; background:url("../images/canopy.svg") left bottom / 300px auto no-repeat; transform:scaleY(-1); }
.preview-root { z-index:1; display:grid; justify-items:center; gap:5px; text-align:center; color:var(--forest); border:1px solid #b8c4a5; padding:12px 7px; border-radius:45% 55% 49% 51% / 53% 41% 59% 47%; background:radial-gradient(circle at 45% 18%,#ffffee,#e7ecd7); box-shadow:0 0 0 5px #e8ecd47c,0 9px 22px #25332317; }
.preview-root .brand-mark { width:46px; }
.preview-root strong { font-size:.78rem; }
.preview-courses { display:grid; gap:9px; position:relative; }
.preview-courses::before { content:""; position:absolute; inset:23px auto 23px 100%; width:22px; border:1px solid #8b9b6f; border-left:0; border-radius:0 23px 23px 0; }
.preview-root::after { content:""; width:14px; height:1px; position:absolute; right:100%; top:50%; background:#8b9b6f; }
.preview-root { position:relative; }
.preview-course { min-height:55px; position:relative; display:flex; align-items:center; gap:8px; border:1px solid #e2e4d8; border-radius:12px; background:#fffdf8; padding:6px 8px; box-shadow:0 3px 8px #27321f08; }
.preview-course::before { content:""; position:absolute; top:50%; right:-21px; width:21px; height:1px; background:#8b9b6f; }
.preview-course::after { content:""; position:absolute; top:calc(50% - 3px); right:-4px; width:6px; height:6px; border-radius:50%; background:var(--olive); }
.preview-course:hover { background:#f3f6ec; border-color:var(--sage); }
.preview-course > svg { margin-inline-start:auto; width:15px; }
.preview-book,.row-icon { display:grid; place-items:center; flex:none; width:34px; height:34px; border-radius:10px; color:var(--forest); background:var(--pale); }
.preview-label { min-width:0; flex:1; }
.preview-label strong,.preview-label small { display:block; }
.preview-label strong { font-size:.84rem; }
.preview-label small { text-align:right; font-size:.7rem; }
.badge { display:inline-flex; align-items:center; gap:6px; border-radius:20px; background:var(--pale); padding:3px 8px; font-size:.76rem; font-weight:600; color:var(--forest); white-space:nowrap; }
.status { background:#f0eee8; color:#57584d; }
.status::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.status.is-active { background:#e5edda; color:#345536; }
.timeline { list-style:none; padding:0 22px 15px 15px; }
.timeline li { position:relative; border-inline-start:1px solid #dbe1ce; padding:0 13px 6px 0; }
.timeline li::before { content:""; border:2px solid var(--surface); position:absolute; right:-5px; top:18px; width:10px; height:10px; border-radius:50%; background:var(--olive); }
.timeline li:last-child { border-inline-start-color:transparent; }
.timeline a { display:flex; align-items:center; justify-content:space-between; gap:9px; min-height:44px; padding:3px 7px; border-radius:8px; }
.timeline a:hover { background:var(--pale); }
.timeline small { display:block; font-size:.77rem; }
.timeline.changes li { padding:5px 13px 10px 0; }
.timeline.changes li::before { top:12px; }

.table-wrap { overflow-x:auto; }
table { border-collapse:collapse; width:100%; text-align:start; }
td,th { padding:12px 13px; text-align:start; border-top:1px solid var(--line); vertical-align:middle; }
thead th { background:#f2f0e7; color:var(--deep); font-size:.81rem; font-weight:700; }
tbody th { font-weight:600; }
tbody td,tbody th { font-size:.88rem; }
tbody tr:hover { background:#f8f8ef; }
.row-name { display:flex; align-items:center; gap:8px; min-width:165px; }
.row-name small { display:block; width:fit-content; }
.row-actions { display:flex; gap:2px; align-items:center; }
.filter-bar { display:flex; align-items:center; gap:9px; flex-wrap:wrap; padding:3px 17px 17px; }
input:not([type=checkbox]), select, textarea {
    min-height:44px; border:1px solid #d9dcd0; background:#fffefa; border-radius:9px;
    padding:8px 10px; width:100%; min-width:0; outline-offset:2px;
}
input[type=checkbox] { width:17px; height:17px; accent-color:var(--forest); }
.filter-bar select { width:auto; max-width:100%; }
.search-field { position:relative; flex:1 1 230px; max-width:420px; }
.search-field svg { position:absolute; inset-inline-start:11px; top:12px; color:var(--muted); }
.search-field input { padding-inline-start:38px; }
.pagination { display:flex; align-items:center; gap:10px; padding:12px 16px; }
.empty { padding:28px 17px; display:grid; justify-items:center; gap:8px; text-align:center; color:var(--muted); }
.empty svg { width:32px; height:32px; color:var(--olive); }
.notice,.validation-summary-errors { padding:11px 13px; margin-bottom:13px; border:1px solid; border-radius:9px; }
.notice.success { color:#22513a; background:#e7f0e3; border-color:#b4cbb1; }
.notice.error,.validation-summary-errors { color:#813731; background:#fcefeb; border-color:#edc4bb; }
.validation ul { margin:0; padding-inline-start:20px; }
.validation-summary-valid { display:none; }
dialog { color:var(--ink); border:1px solid var(--line); background:var(--surface); }
dialog::backdrop { background:#172d25a0; }
.drawer { width:min(100%,500px); max-width:none; height:100dvh; max-height:none; inset:0 0 0 auto; margin:0; border-radius:18px 0 0 18px; padding:20px; box-shadow:-12px 0 40px #19281f27; }
.drawer[open] { animation:drawer-in .23s ease-out; }
@keyframes drawer-in { from { transform:translateX(100%); } }
.editor-head,.editor-head > div { display:flex; align-items:center; gap:11px; }
.editor-head { justify-content:space-between; margin-bottom:16px; padding-bottom:13px; border-bottom:1px solid var(--line); }
.editor-form { display:grid; gap:7px; }
.editor-form label { font-weight:600; }
.editor-group { min-width:0; margin:4px 0; padding:10px; border:1px solid var(--line); border-radius:9px; }
.editor-group legend { color:var(--deep); font-weight:600; padding-inline:4px; }
.editor-group > p,.editor-group > small { color:var(--muted); font-size:.82rem; margin:4px 0 8px; }
.editor-group > small:not(:empty) { display:block; }
.editor-group .fields-pair { margin-bottom:9px; }
.editor-form > input,.editor-form > select,.editor-form > textarea,.fields-pair { margin-bottom:7px; }
.fields-pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.fields-pair > div { min-width:0; display:grid; gap:6px; }
.days-pick { border:1px solid var(--line); padding:9px; margin:0 0 5px; border-radius:9px; display:flex; flex-wrap:wrap; gap:6px; }
.days-pick label,.active-field { display:flex; align-items:center; gap:4px; }
.days-pick label { font-size:.85rem; min-height:44px; min-width:93px; background:var(--pale); padding:4px; border-radius:5px; cursor:pointer; }
.active-field { min-height:44px; }
.editor-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:11px; }
.standalone-editor { padding:20px; max-width:650px; margin:auto; }
.confirm-dialog { border-radius:15px; padding:24px; width:min(430px,calc(100% - 22px)); }
.confirm-dialog p { margin:10px 0 22px; }
.confirm-dialog form { display:flex; gap:8px; }
.drawer-loading { display:grid; gap:15px; }
.drawer-loading div { background:linear-gradient(100deg,#eeeade,#f8f7f1,#eeeade); border-radius:9px; height:45px; animation:loading 1s ease-in-out infinite alternate; }
@keyframes loading { to { opacity:.55; } }
.week-controls { margin-bottom:16px; }
.week-grid { display:grid; grid-template-columns:repeat(var(--day-count),minmax(0,1fr)); gap:11px; align-items:start; }
.week-day { padding:10px; background:linear-gradient(#edf0e2,#fffdf8 185px); }
.week-day > header { min-height:76px; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:4px 6px; padding:3px; }
.week-day > header .metric-icon { width:29px; height:29px; border-radius:8px; }
.week-day > header svg { width:17px; height:17px; }
.week-day > header h2 { font-size:.98rem; }
.week-day > header .badge { grid-column:1 / -1; width:fit-content; }
.week-entry { background:var(--surface); border:1px solid var(--line); border-radius:12px; margin-top:8px; padding:9px; box-shadow:var(--shadow); overflow-wrap:anywhere; }
.week-entry h3 { font-size:.93rem; }
.week-entry p { margin-top:5px; font-size:.78rem; }
.week-entry p svg { width:14px; height:14px; color:var(--forest); }
.week-entry dl { display:grid; gap:2px 5px; border-top:1px solid var(--line); grid-template-columns:auto 1fr; font-size:.73rem; margin-top:8px; padding-top:6px; }
.week-entry dt { color:var(--muted); }
.report-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:16px; align-items:start; }
.report-totals ul { list-style:none; margin:0; padding:0 17px 16px; }
.report-totals li { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(42px,1fr) auto; gap:9px; align-items:center; min-height:34px; font-size:.83rem; }
.report-track { height:7px; border-radius:30px; background:#e7eadd; overflow:hidden; }
.report-track > span { width:var(--bar); height:100%; display:block; border-radius:inherit; background:linear-gradient(90deg,#a3b383,#5a7958); }
.report-totals li strong { min-width:3ch; color:var(--forest); text-align:end; font-variant-numeric:tabular-nums; }

.archive-tabs,.archive-tools,.archive-search,.archive-path,.attendance-filter {
    display:flex; align-items:center; flex-wrap:wrap; gap:8px;
}
.archive-tabs { padding:10px 16px 0; border-bottom:1px solid var(--line); }
.archive-tabs a { display:inline-flex; align-items:center; min-height:44px; gap:7px; padding-inline:13px; border-bottom:3px solid transparent; }
.archive-tabs a[aria-current] { color:var(--forest); border-color:var(--olive); font-weight:700; }
.archive-tools { justify-content:space-between; padding:13px 16px; }
.archive-path { min-width:0; color:var(--forest); }
.archive-path a { overflow-wrap:anywhere; }
.archive-path a:hover,.archive-entry-title:hover { text-decoration:underline; text-underline-offset:3px; }
.archive-path a[aria-current] { color:var(--deep); font-weight:700; }
.archive-path svg { width:14px; height:14px; }
.archive-search input,.attendance-filter input { width:auto; flex:1; min-width:min(100%,175px); }
.archive-forms { display:flex; align-items:flex-start; flex-wrap:wrap; gap:8px; padding:0 16px 13px; }
.archive-forms details { border:1px solid var(--line); border-radius:9px; min-width:0; }
.archive-forms details[open] { width:min(100%,320px); }
.archive-forms summary { display:flex; align-items:center; gap:8px; min-height:44px; padding-inline:11px; border-radius:9px; color:var(--forest); font-weight:600; }
.archive-forms summary::-webkit-details-marker { display:none; }
.archive-forms form { padding:9px 11px 11px; border-top:1px solid var(--line); }
.archive-list { padding:0; list-style:none; }
.archive-list li { display:flex; align-items:center; gap:9px; padding:9px 16px; min-height:58px; border-top:1px solid var(--line); }
.archive-list .archive-entry-title { flex:1; min-width:0; font-weight:600; overflow-wrap:anywhere; }
.archive-list div.archive-entry-title:hover { text-decoration:none; }
.archive-list .archive-entry-title small { display:block; font-weight:400; }
.attendance-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr)); gap:11px; }
.attendance-card { display:grid; gap:12px; align-content:start; justify-items:start; padding:14px; }
.attendance-card-heading { display:flex; align-items:center; gap:9px; }
.attendance-card-heading p { color:var(--muted); margin-top:2px; }
.attendance-card > p > span { display:inline-block; margin-inline-start:5px; }
.attendance-card .badge { white-space:normal; }
.attendance-check-status:empty { margin-top:-12px; }
.attendance-check-status.notice { margin:0; width:100%; overflow-wrap:anywhere; }
.location-map-dialog { direction:rtl; width:min(94vw,850px); max-width:none; max-height:94dvh; padding:16px; border-radius:var(--radius); }
.location-map-heading,.location-map-footer { display:flex; justify-content:space-between; align-items:center; gap:9px; }
.location-map-heading p,.location-map-footer p { color:var(--muted); font-size:.85rem; }
.location-map-search { display:flex; align-items:flex-end; gap:8px; margin-block:12px 4px; }
.location-map-search > div { flex:1; min-width:0; }
.location-map-search label { display:block; font-weight:600; margin-bottom:4px; }
.location-map-status:not(:empty) { margin-block:5px; color:var(--muted); font-size:.84rem; }
.location-map-results { list-style:none; padding:0; margin:4px 0 9px; max-height:150px; overflow:auto; border:1px solid var(--line); border-radius:9px; }
.location-map-results li + li { border-top:1px solid var(--line); }
.location-map-results button { display:block; width:100%; min-height:44px; padding:5px 9px; background:var(--surface); border:0; text-align:start; }
.location-map-results button:hover,.location-map-results button:focus-visible { background:var(--pale); }
.location-map-results button small { display:block; overflow-wrap:anywhere; }
.location-map-canvas { direction:ltr; height:clamp(265px,49dvh,520px); margin-block:8px; border:1px solid var(--line); border-radius:12px; background:#edf0e6; }
.location-map-canvas .leaflet-control-attribution a { text-decoration:underline; }
.location-map-marker span { display:block; width:26px; height:26px; margin:1px; background:var(--forest); border:2px solid white; border-radius:50% 50% 50% 0; transform:rotate(-45deg); box-shadow:0 2px 6px #142a22a0; }
.location-map-marker span::after { content:""; position:absolute; width:8px; height:8px; border-radius:50%; background:white; inset:7px; }
.location-map-marker.hospital span { background:#b73535; }
.location-map-device-marker span { display:block; width:16px; height:16px; background:#237548; border:2px solid white; border-radius:50%; box-shadow:0 1px 5px #142a22a0; }
.location-map-comparison { display:flex; align-items:center; justify-content:space-between; gap:6px 12px; flex-wrap:wrap; padding:8px 10px; border:1px solid var(--line); border-radius:9px; }
.location-map-comparison ul { display:flex; flex-wrap:wrap; gap:4px 12px; list-style:none; margin:0; padding:0; font-size:.85rem; }
.location-map-comparison li { display:flex; align-items:center; gap:6px; }
.location-map-key { width:11px; height:11px; border-radius:50%; }
.location-map-key.hospital { background:#b73535; }
.location-map-key.device { background:#237548; }
.location-map-comparison p { flex-basis:100%; min-height:1.5em; font-size:.89rem; }
.location-map-footer { flex-wrap:wrap; min-height:44px; margin-top:8px; }
.location-map-radius { display:grid; gap:4px; }
.location-map-radius label { font-size:.85rem; font-weight:600; }
.location-map-radius > div { display:flex; align-items:center; gap:3px; direction:ltr; }
.location-map-radius input { width:76px; }
.location-map-radius .icon-btn { border-color:var(--line); }
@media (max-width:500px) {
    .archive-search { width:100%; }
    .archive-list li { flex-wrap:wrap; }
    .archive-list li > .archive-entry-title { min-width:45%; }
    .location-map-dialog { padding:11px; }
    .location-map-canvas { height:clamp(240px,42dvh,340px); }
}

.login { background:#f8f6ed; }
.login-grid { min-height:100dvh; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.13fr); }
.login-panel { display:flex; flex-direction:column; justify-content:space-between; padding:clamp(23px,5.1vw,75px); gap:35px; }
.login-brand,.tree-brand { display:flex; align-items:center; gap:9px; color:var(--forest); }
.login-brand strong { font-size:1.55rem; }
.login-brand .brand-mark { width:40px; }
.login-form { width:100%; max-width:410px; margin:auto; }
.login-form h1 { margin:10px 0 4px; }
.login-form form { display:grid; gap:7px; margin-top:24px; }
.login-form input { margin-bottom:9px; }
.login-form form .btn { margin-top:10px; }
.login-art { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(18px,2.6vw,40px); padding:24px; min-height:100%; position:relative; overflow:hidden; isolation:isolate; color:#f0e4be; background:radial-gradient(circle at 45% 38%,#5f7859,#214d40 59%,#173c30); }
.login-art::before,.login-art::after { content:""; position:absolute; inset:0; z-index:-1; background-repeat:no-repeat; }
.login-art::before { background-image:url("../images/canopy.svg"); background-size:min(110%,740px) auto; background-position:top left; opacity:.75; }
.login-art::after { background-image:url("../images/campus.svg"); background-size:auto 71%; background-position:center bottom; opacity:.35; }
.login-art-title { margin:0; max-width:100%; text-align:center; text-wrap:balance; font-size:clamp(1.9rem,4.2vw,4.5rem); font-weight:700; line-height:1.1; text-shadow:0 2px 12px #142e27; }
.login-art-mark { display:grid; place-items:center; border:1px solid #d8d5a66e; background:#193b30a8; width:clamp(145px,23vw,310px); aspect-ratio:1; border-radius:49% 51% 46% 54%; box-shadow:0 0 0 14px #d9e0ad0f,0 18px 60px #142e2755; }
.login-art .brand-mark { width:57%; }

.tree-page { background:#f8f6ed; min-height:100dvh; position:relative; isolation:isolate; }
.tree-page::before { content:""; position:absolute; inset:0 0 auto; height:530px; z-index:-1; pointer-events:none; opacity:.55; background:url("../images/canopy.svg") left top / min(46vw,650px) auto no-repeat,url("../images/campus.svg") right -60px top -75px / min(50vw,660px) auto no-repeat; mask-image:linear-gradient(#000,transparent); }
.tree-top { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:68px; background:#fffdf8dc; border-bottom:1px solid #e6e2d5; padding:8px clamp(14px,3vw,46px); }
.tree-brand .brand-mark { width:37px; height:42px; }
.tree-brand strong,.tree-brand small { display:block; line-height:1.22; }
.tree-brand strong { font-size:1.16rem; }
.tree-brand small { font-size:.71rem; }
.tree-host { color:var(--forest); font-weight:600; }
.tree-main { width:min(100%,1600px); margin:auto; padding:13px clamp(12px,2.8vw,38px) 6px; }
.tree-intro { text-align:center; margin:8px auto 14px; padding:0 6px; }
.tree-intro .eyebrow { justify-content:center; }
.tree-intro h1 { margin:4px 0 6px; }
.tree-intro > p:last-child { color:var(--muted); font-size:.94rem; }
.tree-controls { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:5px 14px; margin-bottom:8px; }
.breadcrumb,.tree-tools,.zoom-tools { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.breadcrumb { min-height:38px; font-size:.82rem; color:var(--forest); }
.breadcrumb svg { width:13px; height:13px; }
.breadcrumb button { border:0; border-radius:6px; background:transparent; color:var(--forest); text-decoration:underline; text-underline-offset:4px; min-height:44px; padding:4px; }
.breadcrumb span { font-weight:700; }
.tree-tools .icon-btn,.zoom-tools { background:#fffdf8; border-color:#e0dfd2; }
.tree-tools .icon-btn:hover { background:var(--pale); }
.zoom-tools { border:1px solid #e0dfd2; border-radius:10px; }
.zoom-tools .icon-btn { border:0; }
#tree-scale { min-width:41px; font-size:.82rem; text-align:center; font-variant-numeric:tabular-nums; }
.export-menu { position:relative; }
.export-menu summary { list-style:none; }
.export-menu summary::-webkit-details-marker { display:none; }
.export-menu > div { position:absolute; z-index:6; inset-inline-end:0; top:calc(100% + 4px); width:158px; padding:4px; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); }
.export-menu button { display:block; text-align:start; min-height:44px; width:100%; background:none; border:0; border-radius:6px; padding:5px 8px; }
.export-menu button:hover { background:var(--pale); }
.tree-status { color:var(--muted); font-weight:600; font-size:.86rem; }
.tree-status:not(:empty) { margin:3px 0 6px; }
.tree-viewport {
    position:relative; overflow:hidden; height:clamp(430px, calc(100dvh - 269px),830px); border-radius:22px;
    border:1px solid #dce1cd; isolation:isolate; direction:ltr; cursor:grab; touch-action:none;
    background:radial-gradient(ellipse at 78% 53%,#f6f7e2 0%,transparent 44%),radial-gradient(ellipse at 27% 100%,#e8edda,transparent 53%),#fffcf3;
    box-shadow:var(--shadow),inset 0 0 65px #dcdcc24a;
}
.tree-viewport::before,.tree-viewport::after { content:""; position:absolute; inset:0; pointer-events:none; z-index:-1; }
.tree-viewport::before { background:url("../images/canopy.svg") center top / auto min(55%,355px) no-repeat,url("../images/campus.svg") right -50px bottom -35px / min(510px,65%) auto no-repeat; opacity:.23; }
.tree-viewport::after { background:radial-gradient(circle at 18% 71%,#fffdf3 1px,transparent 5px),radial-gradient(circle at 80% 70%,#e7daba 1px,transparent 6px),radial-gradient(circle at 32% 84%,#ffffff 1px,transparent 4px); background-size:171px 151px,197px 137px,101px 167px; animation:breathe 7s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity:.38; transform:translateY(4px); } to { opacity:.68; transform:translateY(-4px); } }
.tree-viewport.dragging,.tree-viewport.dragging * { cursor:grabbing; user-select:none; }
.tree-world { position:absolute; inset:0 auto auto 0; transform-origin:0 0; }
.tree-branches,.tree-nodes { position:absolute; inset:0; width:100%; height:100%; }
.branch { stroke:#8d9d71; stroke-width:2; fill:none; stroke-linecap:round; }
.branch.active { stroke:#657c3c; stroke-width:3.5; }
.branch.dim { opacity:.44; }
.bud { fill:#778b52; stroke:#ffffe7; stroke-width:1; }
.bud.active { fill:#a5ad62; }
.branch-leaf { fill:#9da96f; stroke:#778b52; stroke-width:.65; transform-origin:0 0; animation:leaf-sway 2.5s ease-in-out 2 alternate; }
.branch-spark { fill:#fffbe0; stroke:#e0c874; stroke-width:1.6; }
@keyframes leaf-sway { to { transform:rotate(6deg); } }
.tree-node {
    direction:rtl; position:absolute; display:flex; align-items:center; gap:8px; text-align:start;
    border:1px solid #dedfd0; border-radius:17px; color:var(--deep); background:linear-gradient(145deg,#fffef9,#f5f5e9);
    box-shadow:0 6px 13px #41463115; padding:6px 9px; transition:box-shadow var(--ease),border-color var(--ease),background var(--ease);
}
.tree-node .tree-node-icon { width:35px; height:35px; border-radius:12px; display:grid; place-items:center; flex:none; color:var(--forest); background:#eaf0e2; }
.tree-node .tree-node-icon svg { width:20px; height:20px; }
.tree-node .tree-node-label { flex:1; overflow-wrap:anywhere; }
.tree-node strong,.tree-node small { display:block; }
.tree-node strong { font-size:14px; line-height:1.18; }
.tree-node small { font-size:11px; line-height:1.24; margin-top:3px; }
.tree-node > svg { width:15px; height:15px; }
.tree-node.root { display:flex; flex-direction:column; align-items:center; text-align:center; justify-content:center; gap:4px; padding:13px; border-radius:52% 48% 50% 50% / 52% 49% 51% 48%; background:radial-gradient(circle at 35% 23%,#fffff3,#e6edcf 67%,#d9e3c2); border-color:#aebc91; box-shadow:0 0 0 7px #e5edcf99,0 0 0 13px #ececd651,0 10px 22px #6670412c; }
.tree-node.root .tree-node-icon { background:transparent; width:39px; height:37px; }
.tree-node.root .tree-node-icon svg { width:32px; height:32px; }
.tree-node.root .tree-node-label { flex:none; }
.tree-node.root strong { font-size:17px; }
.tree-node.course { background:#fffff5; border-radius:30px 13px 26px 18px; border-color:#d5dec3; }
.tree-node.course strong { font-size:15px; }
.tree-node.selected,button.tree-node:hover { border-color:#8da368; background:#f0f4de; box-shadow:0 0 0 4px #b7c48c53,0 7px 16px #4456321c; }
.tree-node.dim { background:#f4f2e9; color:#526050; }
.tree-node.detail { border-radius:26px; background:#eff3e5; box-shadow:none; }
.tree-node.detail strong { font-size:12px; }
.tree-node.detail small { font-size:13px; color:var(--deep); font-weight:600; }
.tree-node.detail small { text-align:right; }
.tree-node.empty-node { border-style:dashed; background:#f9f8f1; }
.tree-footer { display:flex; justify-content:space-between; gap:6px 14px; flex-wrap:wrap; padding:8px 3px; color:var(--muted); font-size:.76rem; }
.tree-footer svg { width:14px; height:14px; margin-inline-end:4px; }
.presenting .tree-admin { visibility:hidden; }
.presenting .tree-intro { margin-block:2px 5px; }
.presenting .tree-intro h1 { font-size:clamp(1.65rem,3vw,2.55rem); }
.presenting .tree-viewport { height:clamp(430px,calc(100dvh - 221px),1050px); }
.print-dialog { width:min(94vw,1160px); max-height:92dvh; border-radius:13px; padding:16px; }
.print-toolbar { display:flex; align-items:end; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.print-actions { display:flex; gap:8px; }
.print-orientation { display:flex; gap:8px; margin:0; padding:0; border:0; }
.print-orientation legend { font-size:.82rem; font-weight:600; margin-bottom:4px; }
.print-orientation label {
    display:flex; align-items:center; gap:6px; min-height:44px; padding:6px 10px;
    border:1px solid var(--line); border-radius:9px; cursor:pointer;
}
.print-orientation label:has(:checked) { border-color:var(--sage); background:var(--pale); }
.print-orientation input { accent-color:var(--forest); margin:0; }
.print-preview-content { overflow:auto; background:var(--ivory); border:1px solid var(--line); border-radius:10px; padding:12px; }
.print-preview-paper {
    width:277mm; min-height:190mm; margin-inline:auto; padding-block:8px;
    background:white; border:1px solid var(--line);
}
.print-dialog:has(#tree-print-portrait:checked) .print-preview-paper { width:190mm; min-height:277mm; }
.print-preview-paper th,.print-preview-paper td { font-size:10pt; }
.print-preview-paper .print-tree-hospital small { font-size:8.5pt; }
.tree-print-sheet { display:none; }
.print-tree-table {
    --print-branch: #7c8b67;
    table-layout:fixed; border-collapse:separate; border-spacing:0;
}
.print-tree-table th,.print-tree-table td { border:0; padding:0 4px; background:transparent; }
.print-tree-root { text-align:center; padding:6px 12px; }
.print-tree-root h1 { font-size:1.5rem; overflow-wrap:anywhere; }
.print-tree-root p { font-size:.84rem; color:var(--muted); margin-top:3px; }
.print-tree-table .print-tree-title { text-align:center; padding-bottom:14px; position:relative; }
.print-tree-title::after,.print-tree-day::after {
    content:""; position:absolute; inset-inline-start:50%; border-inline-start:1px solid var(--print-branch);
}
.print-tree-title::after { bottom:0; height:13px; }
.print-tree-table .print-tree-day { text-align:center; padding-top:11px; position:relative; }
.print-tree-day::before {
    content:""; position:absolute; inset-inline:0; top:0; border-top:1px solid var(--print-branch);
}
.print-tree-day:first-child::before { inset-inline-start:50%; }
.print-tree-day:last-child::before { inset-inline-end:50%; }
.print-tree-day::after { top:0; height:11px; }
.print-tree-day > span {
    display:block; padding:5px 3px; border:1px solid #aebc9d; border-radius:7px;
    background:var(--pale); color:var(--deep);
}
.print-tree-table td { vertical-align:top; padding-top:5px; font-size:.82rem; overflow-wrap:anywhere; position:relative; }
.print-tree-table tr:first-child td:has(.print-tree-hospital)::before {
    content:""; position:absolute; top:0; inset-inline-start:50%; height:5px; border-inline-start:1px solid var(--print-branch);
}
.print-tree-hospital { border:1px solid #cdd6c4; border-radius:6px; padding:5px 7px; }
.print-tree-hospital strong { line-height:1.35; display:block; color:var(--deep); }
.print-tree-hospital small { display:block; font-size:.73rem; margin-top:3px; }
.print-tree-hospital small span { display:block; }

@media (max-width:1190px) {
    .admin { grid-template-columns:195px minmax(0,1fr); }
    .sidebar { padding-inline:11px; }
    .week-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); }
    .metric { padding-inline:9px; gap:7px; }
    .metric .metric-icon { width:39px; height:39px; }
    .metric .metric-icon svg { width:22px; height:22px; }
}
@media (max-width:940px) {
    .admin { grid-template-columns:170px minmax(0,1fr); }
    .nav-link,.sidebar-tree { font-size:.8rem; gap:5px; padding-inline:6px; }
    .dashboard-grid { grid-template-columns:minmax(0,1fr); }
    .hero::before { opacity:.37; }
    .hero::after { opacity:.53; }
    .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:700px) {
    .admin { display:block; }
    .sidebar { display:none; position:fixed; z-index:8; inset:60px 0 auto auto; min-height:0; height:calc(100dvh - 60px); width:min(290px,90vw); box-shadow:var(--shadow); }
    .nav-open .sidebar { display:flex; }
    .nav-link,.sidebar-tree { font-size:.95rem; }
    .mobile-menu { display:inline-flex; }
    .topbar { height:60px; position:relative; z-index:9; padding-inline:9px; }
    .topbar-name > svg { display:none; }
    .topbar-name,.account { gap:4px; }
    .topbar-name span { font-size:.81rem; }
    .account small { display:none; }
    .account .avatar { width:30px; height:30px; }
    .content { padding-top:12px; }
    .dashboard-hero { min-height:196px; }
    .report-grid { grid-template-columns:1fr; }
    .hero::before { width:95%; opacity:.27; background-position:left bottom; }
    .hero::after { opacity:.37; }
    .hero-copy h1 { font-size:clamp(1.65rem,6vw,2.55rem); }
    .metrics { gap:8px; }
    .metric { min-height:76px; }
    .metric strong { font-size:1.5rem; }
    .metric p { font-size:.74rem; }
    .login-grid { display:flex; flex-direction:column-reverse; }
    .login-art { min-height:182px; gap:14px; padding:14px; }
    .login-art-mark { width:103px; }
    .login-panel { min-height:calc(100dvh - 182px); }
    .tree-top { min-height:59px; padding-inline:9px; }
    .tree-top .tree-host { display:none; }
    .tree-brand small,.tree-admin { font-size:.7rem; }
    .tree-admin { padding-inline:6px; }
    .tree-admin svg { display:none; }
    .tree-intro h1 { font-size:1.84rem; }
    .tree-intro > p:last-child { font-size:.82rem; }
    .tree-viewport { height:clamp(420px,calc(100dvh - 279px),650px); }
    .tree-controls { justify-content:center; }
    .breadcrumb { width:100%; justify-content:center; }
    .tree-tools { gap:4px; justify-content:center; }
    #tree-scale { min-width:34px; }
}
@media (max-width:380px) {
    .preview-map { padding-inline:9px; gap:24px; grid-template-columns:75px minmax(0,1fr); }
    .preview-courses::before,.preview-course::before { width:15px; }
    .preview-course .badge { display:none; }
    .fields-pair { grid-template-columns:1fr; }
    .account .avatar { display:none; }
}
@media (max-width:820px) and (max-height:500px) and (orientation:landscape) {
    .tree-viewport { min-height:340px; height:65dvh; }
    .login-grid { display:grid; grid-template-columns:1fr 1fr; }
}
@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after { animation-duration:.001ms !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}
@media print {
    @page { size:A4; margin:10mm; }
    @page trainingTree { size:A4 landscape; margin:10mm; }
    @page trainingTreePortrait { size:A4 portrait; margin:10mm; }
    :root { background:white; }
    body.admin { display:block; }
    .sidebar,.topbar,.footer,.filter-bar,.week-controls .actions,.skip,.tree-page > :not(.tree-print-sheet) { display:none !important; }
    .content { padding:0; }
    .hero { box-shadow:none; }
    .hero::before,.hero::after { display:none; }
    .week-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
    .week-day,.week-entry { break-inside:avoid; box-shadow:none; }
    .tree-page { background:white; min-height:0; }
    .tree-page::before,.print-dialog::backdrop { display:none; }
    .tree-print-sheet { display:block; page:trainingTree; }
    .tree-page:has(#tree-print-portrait:checked) .tree-print-sheet { page:trainingTreePortrait; }
    .print-tree-table thead { display:table-header-group; break-inside:avoid; }
    .print-tree-table tr { break-inside:avoid; }
    .print-tree-table th,.print-tree-table td { font-size:10pt; }
    .print-tree-hospital small { font-size:8.5pt; }
}
