/* Sara Farman platform: shared theme (off-white + olive green)
   Uses logical properties throughout so Arabic and Sorani (RTL) flip automatically. */

:root {
  --bg: #faf8f2;
  --surface: #fffefb;
  --surface-2: #f3f0e6;
  --ink: #2b2f22;
  --ink-soft: #666b58;
  --line: #e4e0d2;
  --olive: #6b7a3a;
  --olive-dark: #4d5a28;
  --olive-deep: #384220;
  --olive-tint: #e9edd9;
  --olive-tint-2: #f2f5e8;
  --accent: #b08d3c;           /* quiet gold for small highlights */
  --danger: #a24a3a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-bar: 0 4px 14px -6px rgba(56, 66, 32, .28), 0 1px 0 rgba(56, 66, 32, .06);
  --shadow-card: 0 1px 2px rgba(56, 66, 32, .05), 0 6px 18px -10px rgba(56, 66, 32, .18);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  /* faded sloped lines only, light gray: fine lines plus a wider accent line */
  background-image:
    repeating-linear-gradient(135deg, rgba(150, 150, 140, .20) 0, rgba(150, 150, 140, .20) 1px, transparent 1px, transparent 9px),
    repeating-linear-gradient(135deg, rgba(150, 150, 140, .13) 0, rgba(150, 150, 140, .13) 3px, transparent 3px, transparent 54px);
  font-family: 'Inter', 'Noto Sans Arabic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
html[lang="ar"] body, html[lang="ckb"] body {
  font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
  line-height: 1.85;
}

h1, h2, h3, .display {
  font-family: 'Cormorant Garamond', 'Noto Naskh Arabic', Georgia, serif;
  font-weight: 600;
  color: var(--olive-deep);
  letter-spacing: .1px;
  margin: 0 0 .4em;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .display,
html[lang="ckb"] h1, html[lang="ckb"] h2, html[lang="ckb"] h3, html[lang="ckb"] .display {
  font-family: 'Noto Naskh Arabic', 'Cormorant Garamond', serif;
  font-weight: 700;
}
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }

a { color: var(--olive-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--olive); background: var(--olive); color: #fff;
  font: inherit; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--olive-dark); border-color: var(--olive-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--olive-dark); }
.btn.ghost:hover { background: var(--olive-tint); }
.btn.small { padding: .3rem .8rem; font-size: .85rem; }

/* ---------- Form controls (flat, no gloss) ---------- */
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input, select, textarea { min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(107, 122, 58, .14);
}
/* Dropdown lists: flat, matte, custom arrow */
select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7a3a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  padding-inline-end: 2.2rem;
  background-color: var(--surface);
  background-size: 12px 8px;
  cursor: pointer;
}
html[dir="rtl"] select { background-position: left .8rem center; }
select option { background: var(--surface); color: var(--ink); }

/* Custom flat dropdown menu (used for language switcher etc.) */
.menu { position: relative; }
.menu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  min-width: 170px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px -12px rgba(56, 66, 32, .35);   /* soft, matte: no gradients, no glass */
  display: none; z-index: 60;
}
.menu.open .menu-panel { display: block; }
.menu-panel button {
  display: block; width: 100%; text-align: start;
  background: none; border: 0; padding: .5rem .7rem; border-radius: 6px;
  font: inherit; color: var(--ink); cursor: pointer;
}
.menu-panel button:hover { background: var(--olive-tint-2); }
.menu-panel button[aria-current="true"] { background: var(--olive-tint); color: var(--olive-deep); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem;
}
.card h3 { display: flex; align-items: center; gap: .5rem; }
.muted { color: var(--ink-soft); }
.tag {
  display: inline-block; padding: .05rem .6rem; border-radius: 999px;
  background: var(--olive-tint); color: var(--olive-deep); font-size: .78rem; font-weight: 500;
}

/* ---------- App layout ---------- */
.app { min-height: 100vh; }

.topbar {
  position: fixed; inset-block-start: 0; inset-inline: 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding-inline: 1rem 1.25rem;
}
/* Upper bar: olive green with drop shadow (app top bar and landing site bar) */
.topbar, .site-bar {
  background-color: var(--olive);
  /* sloped-line pattern on the bar: fine light lines plus a few darker accent lines */
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .11) 0, rgba(255, 255, 255, .11) 1px, transparent 1px, transparent 8px),
    repeating-linear-gradient(135deg, rgba(0, 0, 0, .09) 0, rgba(0, 0, 0, .09) 3px, transparent 3px, transparent 46px);
  box-shadow: var(--shadow-bar);
  border-bottom: 1px solid var(--olive-dark);
}
.topbar .brand, .site-bar .brand, .site-bar nav a { color: #fff; }
.topbar .brand .mark, .site-bar .brand .mark { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); }
.topbar .pill-btn, .site-bar .pill-btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .32); }
.topbar .pill-btn:hover, .site-bar .pill-btn:hover { background: rgba(255, 255, 255, .22); }
.topbar .tag { background: rgba(255, 255, 255, .18); color: #fff; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: 'Cormorant Garamond', 'Noto Naskh Arabic', serif;
  font-size: 1.35rem; font-weight: 700; color: var(--olive-deep); }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--olive); color: #fff;
  display: grid; place-items: center; font-size: 1.05rem; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--olive-dark);
}
.icon-btn:hover { background: var(--olive-tint-2); border-color: var(--line); }
.pill-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  cursor: pointer; font: inherit; font-size: .9rem; }
.pill-btn:hover { background: var(--olive-tint-2); }

.sidebar {
  position: fixed; inset-block: var(--topbar-h) 0; inset-inline-start: 0; z-index: 40;
  width: var(--sidebar-w);
  background: var(--surface-2);
  border-inline-end: 1px solid var(--line);
  padding: .9rem .6rem;
  overflow-y: auto; overflow-x: hidden;
  transition: width .2s ease;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: .9rem .6rem .3rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem .75rem; border-radius: 10px;
  color: var(--ink); cursor: pointer; white-space: nowrap;
  border: 0; background: none; font: inherit; width: 100%; text-align: start;
}
.nav-item:hover { background: rgba(255, 255, 255, .7); text-decoration: none; }
.nav-item.active { background: var(--olive); color: #fff; box-shadow: 0 6px 14px -8px rgba(56, 66, 32, .6); }
.nav-item .ico { width: 22px; flex: none; display: grid; place-items: center; font-size: 1.05rem; }

.main {
  margin-inline-start: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 1.5rem) 1.75rem 3rem;
  transition: margin .2s ease;
}

/* collapsed state */
.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.collapsed .main { margin-inline-start: var(--sidebar-w-collapsed); }
.collapsed .nav-item .label, .collapsed .nav-group { display: none; }
.collapsed .nav-item { justify-content: center; padding-inline: 0; }

/* ---------- Home: calendar + reminders ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.cal-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.cal-head h2 { margin: 0; flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 170px; padding: .5rem; display: flex; flex-direction: column; gap: 5px; }
.cal-day.today { border-color: var(--olive); box-shadow: 0 0 0 2px var(--olive-tint); }
.cal-day.weekend { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, #f6f3ea 6px, #f6f3ea 12px); }
.cal-day .dname { font-size: .75rem; color: var(--ink-soft); display: flex; justify-content: space-between; gap: .3rem; }
.cal-day .dname span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reminders form > *, .reminders form input, .reminders form select { min-width: 0; }
.reminders form input[type="date"] { width: 100%; }
.home-grid > * { min-width: 0; }
.cal-day .dnum { font-weight: 600; color: var(--olive-deep); }
.slot { border-radius: 7px; padding: .25rem .45rem; font-size: .78rem; line-height: 1.35;
  background: var(--olive-tint); border-inline-start: 3px solid var(--olive); cursor: pointer; }
.slot:hover { background: #dfe6c8; }
.slot .t { color: var(--ink-soft); font-size: .7rem; }
.slot.event { background: #f6ecd2; border-inline-start-color: var(--accent); }
.slot.exam { background: #f3dcd5; border-inline-start-color: var(--danger); }

.reminders .rem { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.reminders .rem:last-child { border-bottom: 0; }
.rem .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .55rem; background: var(--olive); flex: none; }
.rem.overdue .dot { background: var(--danger); }
.rem .due { font-size: .78rem; color: var(--ink-soft); }
.rem.overdue .due { color: var(--danger); }

table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: start; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
table.data td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
table.data td.muted { white-space: nowrap; }
table.data tr:hover td { background: var(--olive-tint-2); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.stat { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; color: var(--olive-deep); line-height: 1; }

@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .sidebar { width: var(--sidebar-w-collapsed); }
  .main { margin-inline-start: var(--sidebar-w-collapsed); padding-inline: 1rem; }
  .nav-item .label, .nav-group { display: none; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
}

/* ---------- Phase 2: segmented controls, forms, plan, PTM sheet ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: .28rem .8rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink-soft); white-space: nowrap; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button:hover { background: var(--olive-tint-2); }
.seg button.on { color: #fff; background: var(--olive); }
.seg button.on[data-v="present"], .seg button.on[data-v="done"], .seg button.on[data-v="3"] { background: var(--olive); }
.seg button.on[data-v="absent"], .seg button.on[data-v="1"] { background: var(--danger); }
.seg button.on[data-v="late"], .seg button.on[data-v="in_progress"], .seg button.on[data-v="2"] { background: var(--accent); }
.seg button.on[data-v="excused"], .seg button.on[data-v="not_started"] { background: #8a8f7c; }
.seg button.on[data-v="4"] { background: var(--olive-deep); }
.fld { display: grid; gap: .25rem; margin-bottom: .8rem; font-size: .85rem; color: var(--ink-soft); }
.fld textarea, .fld input, .fld select { width: 100%; color: var(--ink); font-size: .95rem; }
.lesson-btn { display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; text-align: start;
  background: none; border: 0; border-radius: 8px; padding: .4rem .6rem; font: inherit; color: var(--ink); cursor: pointer; }
.lesson-btn:hover { background: var(--olive-tint-2); }
.lesson-btn.active { background: var(--olive-tint); color: var(--olive-deep); font-weight: 600; }
.unit-h { font-weight: 600; color: var(--olive-deep); margin: .9rem 0 .2rem; font-size: .9rem; }
.tag.draft { background: #eee9d8; color: #7a6a30; } .tag.ready { background: var(--olive-tint); } .tag.taught { background: var(--olive); color: #fff; }
.tag.positive { background: var(--olive-tint); } .tag.behavior { background: #f3dcd5; color: var(--danger); }
.tag.academic { background: #f6ecd2; color: #7a6a30; } .tag.other { background: var(--surface-2); color: var(--ink-soft); }
.act { display: grid; grid-template-columns: 130px 80px minmax(0, 1fr) 34px; gap: .4rem; margin-bottom: .4rem; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--olive-tint); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: var(--olive); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } .act { grid-template-columns: 1fr 70px 34px; } .act .a-desc { grid-column: 1 / -1; } }
.ptm h2 { margin-bottom: .2rem; }
.ptm .meta { color: var(--ink-soft); margin-bottom: 1rem; }
.ptm .counts { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.ptm .counts div { background: var(--olive-tint-2); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .9rem; min-width: 84px; }
.ptm .counts b { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: var(--olive-deep); display: block; line-height: 1.1; }
.ptm .comment { min-height: 90px; border: 1px dashed var(--line); border-radius: 8px; padding: .6rem; background: var(--surface); }

/* ---------- Phase 3: charts, question bank, paper quiz ---------- */
.viz { position: relative; --series-1: #728f12; --series-2: #2a78d6; --series-3: #c93f6a; --grid: #e8e5d8; }
.viz svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.viz .viz-t { font-size: 11px; fill: var(--ink-soft); font-family: inherit; }
.viz .viz-v { fill: var(--ink); font-weight: 600; }
.viz-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; margin-bottom: .4rem; color: var(--ink); }
.viz-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-inline-end: .4rem; vertical-align: middle; }
.viz-tip { position: absolute; display: none; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 22px -12px rgba(56, 66, 32, .35); padding: .4rem .65rem; font-size: .82rem; z-index: 5; white-space: nowrap; color: var(--ink); }
.viz-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: .4rem; }
.viz-table summary { cursor: pointer; color: var(--ink-soft); font-size: .82rem; margin-top: .5rem; }
.chart-card { margin-bottom: 1.25rem; }
.chart-card h3 { margin-bottom: .6rem; }
.q-item { padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.q-item .q-opts { color: var(--ink-soft); font-size: .88rem; margin-top: .2rem; }
.opt-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .4rem; align-items: center; margin-bottom: .35rem; }
.paper { background: #fff; color: #111; padding: 1.6rem 1.8rem; border: 1px solid var(--line); border-radius: var(--radius); }
.paper h2 { color: #111; text-align: center; margin-bottom: .2rem; }
.paper .pq { margin: 1rem 0; break-inside: avoid; }
.paper .line { border-bottom: 1px solid #999; height: 1.7rem; }
.paper .key { margin-top: 2rem; border-top: 2px solid #111; padding-top: .8rem; }
.pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .3rem .6rem; background: var(--surface); }
.pick-list label { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.pick-list input { width: auto; margin-top: .3rem; }
.score-in { width: 90px; text-align: center; }

/* ---------- Print: used for PDFs (reports, PTM sheets, lesson plans) ---------- */
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
  .seg button:not(.on) { display: none; }
  .toolbar, button.btn, .act button { display: none !important; }
}

/* ---------- phase 4: management report, student of the month, certificate ---------- */
.fld.inline { white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
.report h2 { margin-bottom: .2rem; }
.report .meta { color: var(--ink-soft); margin-bottom: 1rem; }
.report .comment { min-height: 90px; border: 1px dashed var(--line); border-radius: 8px; padding: .6rem; background: var(--surface); }
.report .viz-wrap { margin-top: 1rem; max-width: 560px; }
ul.plain { list-style: none; margin: 0 0 .4rem; padding: 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.som-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.som-grid > * { min-width: 0; }
.som .som-win { min-height: 1.8rem; }
.som select, .som input { width: 100%; margin-top: .5rem; }
ol.sug { margin: 0; padding-inline-start: 1.2rem; }
ol.sug li { padding: .15rem 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--olive-dark); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cert-print { display: none; }
.cert { width: 297mm; height: 210mm; box-sizing: border-box; padding: 12mm; background: #fffefb; color: #2b2f1e; }
.cert-in { height: 100%; box-sizing: border-box; border: 2px solid var(--olive); outline: 1px solid var(--olive); outline-offset: -8px; text-align: center; padding: 16mm 22mm; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4mm; }
.cert-mark { width: 18mm; height: 18mm; border-radius: 50%; background: var(--olive); color: #fff; display: grid; place-items: center; font-size: 11mm; }
.cert-sub { letter-spacing: .12em; color: var(--olive-dark); font-size: 4.2mm; }
.cert h1 { font-family: 'Cormorant Garamond', 'Noto Naskh Arabic', serif; font-size: 15mm; margin: 2mm 0; color: var(--olive-deep); }
.cert-name { font-family: 'Cormorant Garamond', 'Noto Naskh Arabic', serif; font-size: 20mm; color: var(--olive-dark); border-bottom: 1px solid var(--olive); padding: 0 14mm 2mm; }
.cert-line { font-size: 5mm; } .cert-line.strong { font-weight: 600; }
.cert-msg { font-size: 4.6mm; max-width: 180mm; color: #555; margin: 3mm 0; }
.cert-sig { margin-top: 8mm; font-size: 4mm; } .cert-sig span { display: block; width: 60mm; border-top: 1px solid #555; margin: 0 auto 2mm; }
@media print {
  body.printing-cert > *:not(#certPrint) { display: none !important; }
  body.printing-cert { background: #fff; }
  body.printing-cert #certPrint { display: block; }
  .report { border: 0; }
}

/* ---------- phase 6: weekly timetable ---------- */
.tt-card { overflow-x: auto; padding: .8rem; }
table.tt { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 560px; }
table.tt th { font-weight: 600; color: var(--olive-deep); font-size: .85rem; padding: .3rem; text-align: center; }
table.tt thead th.tt-today { color: #fff; background: var(--olive); border-radius: 8px; }
table.tt tbody th { width: 84px; text-align: start; }
table.tt tbody th small { display: block; color: var(--ink-soft); font-weight: 400; font-size: .72rem; }
table.tt td { padding: 0; }
tr.tt-break td { text-align: center; color: var(--ink-soft); font-size: .78rem; letter-spacing: .08em; background: repeating-linear-gradient(135deg, rgba(150,150,140,.14) 0 1px, transparent 1px 8px); border-radius: 8px; padding: .3rem; }
.tt-cell { width: 100%; height: 58px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; color: var(--ink); }
.tt-cell:hover { border-color: var(--olive); background: var(--olive-tint-2); }
.tt-cell .tt-plus { color: var(--line); font-size: 1.3rem; }
.tt-cell small { font-size: .7rem; color: var(--ink-soft); }
.tt-cell.filled { border-style: solid; border-width: 1px; }
.tt-cell.g1, .tag.g1 { background: #e7edd2; border-color: #c9d6a0; }
.tt-cell.g2, .tag.g2 { background: #dde8f3; border-color: #b4cde6; }
.tt-cell.g3, .tag.g3 { background: #f3e3d6; border-color: #e3c4a8; }
.tt-cell.on { outline: 2px solid var(--olive-dark); outline-offset: 1px; }
.tt-cell.dim { opacity: .3; }
@media print { .tt-cell:not(.filled) .tt-plus { display: none; } .tt-cell:not(.filled) { border-color: transparent; } .tt-cell.on { outline: 0; } }

/* ---------- phase 9: student cards ---------- */
.st-row { cursor: pointer; }
.st-row:hover td, .st-row.sel td { background: var(--olive-tint-2); }
.stc-head { display: flex; gap: 1rem; align-items: center; }
.stc-ava { width: 54px; height: 54px; border-radius: 50%; background: var(--olive); color: #fff; display: grid; place-items: center; font-family: 'Cormorant Garamond', 'Noto Naskh Arabic', serif; font-size: 1.8rem; flex: none; }
.stc-snap { display: flex; gap: .6rem; flex-wrap: wrap; margin: .8rem 0 1rem; }
.stc-snap div { background: var(--olive-tint-2); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .9rem; min-width: 92px; }
.stc-snap b { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: var(--olive-deep); display: block; line-height: 1.1; }
.stc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.stc-grid > * { min-width: 0; }
.stcard .fld { display: block; margin-bottom: .7rem; font-size: .85rem; color: var(--ink-soft); }
.stcard .fld input, .stcard .fld select, .stcard .fld textarea { display: block; width: 100%; margin-top: .25rem; }
.stc-print-only { display: none; }
@media print { .stc-print-only { display: block; } .two-col { display: block; } }

/* ---------- phase 10: calendar, attendance sheet, pacing ---------- */
.slot.holiday { background: #f6e3e0; border-inline-start-color: var(--danger); color: #7a3328; }
.cal-day.off { background: repeating-linear-gradient(135deg, rgba(162, 74, 58, .07) 0 1px, transparent 1px 7px), var(--surface); }
.cal-day.outside { opacity: .55; }
.dl-row { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.dl-time { min-width: 108px; font-variant-numeric: tabular-nums; color: var(--olive-deep); font-weight: 600; }
.dl-time small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .72rem; }
.dl-main { flex: 1; min-width: 0; }
.am-card { padding: .8rem; }
.am-scroll { overflow-x: auto; }
table.am { border-collapse: collapse; font-size: .82rem; min-width: 100%; }
table.am th, table.am td { border: 1px solid var(--line); text-align: center; padding: 0; }
table.am th { background: var(--olive-tint-2); color: var(--olive-deep); font-weight: 600; padding: .25rem .2rem; }
table.am th small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .62rem; }
table.am th.today { background: var(--olive); color: #fff; } table.am th.today small { color: #fff; }
table.am .am-n { width: 30px; color: var(--ink-soft); }
table.am .am-name { text-align: start; padding: .2rem .5rem; min-width: 150px; white-space: nowrap; background: var(--surface); position: sticky; inset-inline-start: 0; }
table.am th.am-name { background: var(--olive-tint-2); }
table.am .am-t { min-width: 44px; padding: .2rem .3rem; font-weight: 600; background: var(--olive-tint-2); }
table.am tfoot td { background: var(--olive-tint-2); color: var(--olive-deep); font-weight: 600; padding: .25rem; }
.am-cell { width: 100%; min-width: 26px; height: 28px; border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 700; color: var(--olive-dark); }
.am-cell:hover { background: var(--olive-tint-2); }
.am-cell.absent { background: #f3dcd5; color: var(--danger); }
.am-cell.late { background: #f6ecd2; color: #8a6a1f; }
.am-cell.excused { background: #dde8f3; color: #2a5f96; }
.am-legend b { color: var(--olive-deep); margin-inline-start: .5rem; }
.print-only { display: none; }
.am-head h2 { margin-bottom: .1rem; }
.att-line { padding: .35rem 0; } .att-line > div { margin-top: .25rem; display: flex; flex-wrap: wrap; gap: .3rem; }
table.pace td, table.pace th { white-space: nowrap; font-size: .88rem; }
.pace-bar { position: relative; height: 6px; border-radius: 3px; background: var(--olive-tint); margin-top: .35rem; }
.pace-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--olive); }
.pace-bar b { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--olive-deep); }
@media print {
  .print-only { display: block; }
  table.am { font-size: 9pt; } table.am .am-name { position: static; }
  .am-cell.absent, .am-cell.late, .am-cell.excused, table.am th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.stcard .fld .seg { display: flex; width: max-content; max-width: 100%; margin-top: .25rem; }

/* ---------- phase 10b: monthly calendar and birthdays ---------- */
.mgrid { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.mhead, .mbody { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mhead div { padding: .4rem .3rem; text-align: center; font-size: .78rem; font-weight: 600; color: var(--olive-deep); background: var(--olive-tint-2); border-bottom: 1px solid var(--line); }
.mhead .weekend, .mc.weekend .mc-n { color: var(--ink-soft); }
.mc { min-height: 92px; padding: .3rem .35rem; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; font-size: .72rem; min-width: 0; overflow: hidden; }
.mc:nth-child(7n) { border-inline-end: 0; }
.mc:hover { background: var(--olive-tint-2); }
.mc.other { opacity: .45; }
.mc.weekend { background: rgba(150, 150, 140, .07); }
.mc.outside { opacity: .35; }
.mc.today { outline: 2px solid var(--olive); outline-offset: -2px; }
.mc.today .mc-n { color: #fff; background: var(--olive); }
.mc-n { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .8rem; min-width: 22px; justify-content: center; border-radius: 11px; padding: 0 .35rem; }
.mc-bd { color: #c9923f; font-size: .55rem; }
.mc.off { background: repeating-linear-gradient(135deg, rgba(162, 74, 58, .09) 0 1px, transparent 1px 7px), #f9ecea; }
.mc-hol { margin-top: .2rem; padding: .1rem .3rem; border-radius: 5px; background: #f1d4cf; color: #7a3328; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-ev { margin-top: .2rem; padding: .1rem .3rem; border-radius: 5px; background: #f6ecd2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-ev.exam { background: #f3dcd5; }
.mc-ls { display: flex; flex-wrap: wrap; gap: .15rem; margin-top: .25rem; }
.mc-ls span { background: var(--olive-tint); border-radius: 5px; padding: 0 .3rem; font-weight: 600; color: var(--olive-deep); }
.mlegend { margin: .7rem 0 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .8rem; }
.mlegend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-inline-start: .6rem; }
.mlegend .sw.hol { background: #f1d4cf; } .mlegend .sw.today { background: var(--olive); }
.bday { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; }
.bday-ico { width: 30px; height: 30px; border-radius: 50%; background: #f6ecd2; color: #8a6a1f; display: grid; place-items: center; flex: none; }
.bday.soon { padding: .15rem 0; font-size: .88rem; }
@media (max-width: 700px) { .mc { min-height: 64px; } .mc-ls, .mc-hol, .mc-ev { display: none; } }
