:root {
  --bg: #fff;
  --bg-alt: #f7f8fa;
  --panel: #fff;
  --panel-2: #f0f1f3;
  --line: #e0e0e0;
  --text: #1a1a1a;
  --muted: #555;
  --subtle: #6b7280;
  --accent: #059669;
  --accent-dark: #047857;
  --accent-deep: #065f46;
  --accent-light: #d1fae5;
  --blue: #059669;
  --blue-br: #047857;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --sidebar-w: 260px;
  --header-h: 50px;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  max-width: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

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

.skip-link {
  position: fixed;
  top: 6px;
  left: 8px;
  z-index: 10001;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.wrap { width: 100%; margin: 0; padding: 0; }

.guide-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 300;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

.status-badge {
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
}

.status-badge.ok { color: var(--accent-dark); }
.status-badge.ok .status-dot { background: var(--accent); }
.status-badge.err { color: var(--red); }
.status-badge.err .status-dot { background: var(--red); }

.header-actions {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions form { margin: 0; }

.account-name {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-logout {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.account-logout:hover { border-color: #cbd5e1; color: var(--text); }

.organization-name {
  max-width: 180px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organization-switch { display: flex; align-items: center; gap: 4px; }
.organization-switch select {
  width: min(180px, 22vw);
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}
.organization-switch button {
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.organization-switch button:hover { border-color: #cbd5e1; color: var(--text); }

.auth-main {
  width: min(100% - 32px, 480px);
  margin: 90px auto 40px;
}

.auth-main-login { max-width: 440px; }

.sidebar-toggle {
  display: none;
  width: 34px;
  height: 34px;
  padding: 7px;
  flex: 0 0 34px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.sidebar-toggle:hover { background: var(--bg-alt); }

.sidebar-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.guide-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  z-index: 200;
  width: var(--sidebar-w);
  padding: 12px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-alt);
  border-right: 1px solid var(--line);
}

.nav-group { margin-bottom: 4px; }

.nav-group-title {
  padding: 10px 16px 4px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 17px;
  text-transform: uppercase;
}

.nav-link {
  min-height: 32px;
  padding: 5px 16px;
  display: flex;
  align-items: center;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 22px;
}

.nav-link:hover {
  background: #eef1f5;
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  border-left-color: var(--accent);
  background: #eef1f5;
  color: var(--accent-dark);
  font-weight: 500;
}

.sidebar-backdrop { display: none; }

.guide-content {
  width: calc(100% - var(--sidebar-w));
  max-width: 920px;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: calc(var(--header-h) + 24px) 32px 60px;
}

.guide-content > * { max-width: 100%; }

.guide-footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 12px;
  text-align: center;
}

.hero {
  padding: 24px 0 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.hero .eyebrow {
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.okul-hero { padding-top: 0; }
.okul-hero .back { display: inline-block; margin-bottom: 8px; }

.section-title {
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.7;
  text-transform: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.card {
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }

.note {
  margin: 12px 0;
  padding: 9px 12px;
  border: 1px solid #a7f3d0;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 12.5px;
}

.note b { color: var(--text); }
.note-error { border-color: #fecaca; border-left-color: var(--red); background: #fef2f2; color: #991b1b; }
.note-warning { border-color: #fde68a; border-left-color: var(--amber); background: #fffbeb; color: #92400e; }
.text-error { color: var(--red); }
.note code {
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .7);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.btn {
  min-height: 36px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--accent-dark);
  border-radius: 4px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); text-decoration: none; }
.btn:focus-visible { outline: 2px solid #6ee7b7; outline-offset: 2px; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }

.btn-ghost-danger {
  border-color: #fecaca;
  background: #fff;
  color: var(--red);
}

.btn-ghost-danger:hover { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }

.form { display: flex; flex-direction: column; gap: 10px; }

.form label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.form input, .form select, .form textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.form input[type="color"] { padding: 3px; }

.form input:focus, .form select:focus, .form textarea:focus,
.mus-pick select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
}

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card-form { background: var(--bg-alt); }
.card-form h3 { color: var(--text); }

.card-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.card-actions form { margin: 0; }

.flash {
  margin: 12px 0;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line);
}

.flash.ok { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
.flash.err { color: #991b1b; border-color: #fecaca; background: #fef2f2; }

.back { color: var(--muted); font-size: 14px; font-weight: 600; }
.back:hover { color: var(--text); text-decoration: none; }

.mgmt { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mgmt-form { width: 100%; max-width: 420px; position: static; }
.mgmt-list { min-width: 0; overflow-x: auto; }
.opt { color: var(--muted); font-weight: 400; font-size: 11px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.btn-ghost { border-color: var(--line); background: #fff; color: var(--muted); }
.btn-ghost:hover { border-color: #cbd5e1; background: var(--bg-alt); color: var(--text); }

.member-management { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 12px; align-items: start; }
.member-add { position: static; }
.member-list { padding: 0; gap: 0; overflow: hidden; }
.member-list > .section-title { margin: 0; padding: 12px 14px 8px; font-size: 16px; }
.member-list > .empty { margin: 12px 14px 14px; }
.member-row {
  min-width: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 1.4fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: 0; }
.member-identity { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.member-identity strong { overflow-wrap: anywhere; font-size: 13px; }
.member-identity span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.member-identity .member-warning { color: var(--red); font-weight: 600; }
.member-form { min-width: 0; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(110px, 1fr) auto; gap: 8px; align-items: end; }
.member-form label { min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.member-form select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}
.member-state { min-height: 30px; display: flex; align-items: center; color: var(--text); font-size: 12px; }
.member-readonly { display: flex; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 12px; }

.tbl {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-align: left;
  text-transform: uppercase;
}

.tbl td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.tbl tr:hover td { background: var(--bg-alt); }

.swatch {
  width: 12px;
  height: 12px;
  margin-right: 7px;
  display: inline-block;
  border-radius: 3px;
  vertical-align: middle;
}

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.lnk {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.lnk:hover { text-decoration: underline; }
.lnk-danger { color: var(--red); }

.empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.workflow { margin-top: 32px; }
.workflow .section-title { margin-bottom: 4px; }
.section-desc { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.feature-card {
  min-width: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.feature-card strong { font-size: 13px; }
.feature-card p { grid-column: 2; margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.card-index {
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.generate-form { margin: 18px 0 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.availability-actions { margin-top: 16px; }
.action-note { display: inline-block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checks { max-height: 220px; padding: 4px 2px; display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.chk { flex-direction: row !important; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 500; }
.chk input { width: auto; min-height: 0; accent-color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-alt);
  text-align: center;
}

.stat-n { color: var(--accent-dark); font-size: 22px; font-weight: 700; line-height: 1.35; }
.stat-l { margin-top: 2px; color: var(--subtle); font-size: 10px; letter-spacing: .3px; text-transform: uppercase; }

.check-list { display: flex; flex-wrap: wrap; gap: 8px; }

.check {
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.check:hover { border-color: #a7f3d0; color: var(--text); text-decoration: none; }

.check .tick {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
}

.check.done { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.check.done .tick { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; font-weight: 700; }

.mus-pick { max-width: 360px; margin-bottom: 12px; }

.mus-pick label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mus-pick select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.mus-legend { margin: 6px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.mus-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mus-legend em { color: var(--accent-dark); font-style: normal; }

.mus-legend .sw {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
}

.sw.st0 { background: var(--panel-2); }
.sw.st1 { border-color: #fca5a5; background: #fee2e2; color: var(--red); }
.sw.st2 { border-color: #a7f3d0; background: var(--accent-light); color: var(--accent-dark); }

.mus-grid-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

.mus-grid { width: 100%; min-width: 560px; border-collapse: collapse; }

.mus-grid th {
  padding: 7px 6px;
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
}

.mus-grid th.corner, .mus-grid th.saat { background: var(--panel-2); }
.mus-grid th.saat { width: 46px; color: var(--text); font-size: 12px; }
.mus-grid td { padding: 3px; border: 1px solid var(--line); text-align: center; }

.mus-cell {
  width: 100%;
  min-width: 52px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--panel-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background .08s, box-shadow .08s;
}

.mus-cell:hover { box-shadow: inset 0 0 0 2px #cbd5e1; }
.mus-cell.is-readonly { cursor: default; user-select: auto; }
.mus-cell.is-readonly:hover { box-shadow: none; }
.mus-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mus-cell[data-state="0"] { background: var(--panel-2); color: transparent; }
.mus-cell[data-state="1"] { background: #fee2e2; color: var(--red); }
.mus-cell[data-state="2"] { background: var(--accent-light); color: var(--accent-dark); }

.feas {
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12.5px;
}

.feas ul { margin: 6px 0 0; padding-left: 18px; }
.feas li { margin: 3px 0; }
.feas.ok { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.feas.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.feas.err b { color: var(--red); }
.feas.warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.btn-lg { min-height: 42px; padding: 9px 16px; font-size: 14px; }

.prog-top { margin-bottom: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prog-name { font-size: 17px; font-weight: 700; }
.prog-top .back { margin-right: 4px; }
.prog-top .btn { margin-left: auto; }
.sinif-tabs { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }

.sinif-tab {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sinif-tab:hover { border-color: #a7f3d0; color: var(--text); text-decoration: none; }
.sinif-tab.active { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; }

.res-grid td { height: 46px; padding: 2px; }

.res-cell {
  min-height: 44px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-left: 3px solid var(--c);
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 14%, #fff);
  text-align: center;
}

.rc-ders { color: var(--text); font-size: 13px; font-weight: 700; }
.rc-ogr { color: var(--muted); font-size: 11px; }
.edit-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.res-grid .res-cell { position: relative; cursor: grab; user-select: none; -webkit-user-select: none; }
.res-grid .res-block:not(.locked) { touch-action: none; }
.res-grid .res-cell.locked { cursor: default; box-shadow: inset 0 0 0 2px #fbbf24; }
.res-grid .program-readonly-cell { cursor: default; user-select: text; -webkit-user-select: text; }
.res-cell.dragging { opacity: .35; }

.drag-ghost {
  padding: 5px 6px;
  border-left: 3px solid var(--c);
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 22%, #fff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}

td.drop-ok { outline: 2px dashed var(--accent); outline-offset: -3px; background: #ecfdf5; }
td.drop-swap { outline: 2px dashed #2563eb; outline-offset: -3px; background: #eff6ff; }
td.drop-bad { outline: 2px dashed var(--red); outline-offset: -3px; background: #fef2f2; }

.res-block { height: 100%; box-sizing: border-box; }
.blk-n { font-size: 10px; font-weight: 700; opacity: .65; }
.lock-form { position: absolute; top: 2px; right: 3px; margin: 0; line-height: 1; }
.lock-btn {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  opacity: .45;
  cursor: pointer;
}

.lock-btn::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 8px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.lock-btn::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 11px;
  width: 5px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.lock-btn.is-locked { color: var(--amber); }
.lock-btn.is-locked::after { left: 13.5px; }
.res-cell:hover .lock-btn, .res-cell.locked .lock-btn { opacity: 1; }

.dp-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 10000;
  max-width: min(90vw, 520px);
  padding: 10px 16px;
  transform: translateX(-50%);
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  transition: opacity .35s;
}

.dp-toast.out { opacity: 0; }

@media (max-width: 960px) {
  body.sidebar-open { overflow: hidden; }
  .guide-header { padding: 0 12px; gap: 8px; }
  .sidebar-toggle { display: flex; }

  .guide-sidebar {
    z-index: 400;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
    box-shadow: 8px 0 20px rgba(15, 23, 42, .08);
  }

  .guide-sidebar.open,
  body.sidebar-open .guide-sidebar { transform: translateX(0); visibility: visible; transition-delay: 0s; }

  .sidebar-backdrop {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 350;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, .32);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
  }

  .sidebar-backdrop.open,
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .guide-content {
    width: 100%;
    max-width: none;
    margin-left: 0;
    padding: calc(var(--header-h) + 16px) 16px 40px;
  }

  .hero { padding-top: 16px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .tbl { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .row-actions { justify-content: flex-start; }
  .prog-top .btn { margin-left: 0; }
  .member-management { grid-template-columns: minmax(0, 1fr); }
  .member-add { max-width: none; }
}

@media (max-width: 480px) {
  .brand { font-size: 15px; }
  .account-name { display: none; }
  .organization-name { max-width: 110px; }
  .organization-switch select { width: 110px; }
  .status-badge { padding: 4px 6px; font-size: 0; }
  .status-dot { width: 7px; height: 7px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .member-row { grid-template-columns: minmax(0, 1fr); }
  .member-form { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .member-readonly { justify-content: flex-start; }
}

@media print {
  .guide-header, .guide-sidebar, .sidebar-toggle, .sidebar-backdrop,
  .okul-hero, .prog-top .back, .prog-top .btn, .sinif-tabs, .edit-hint,
  .lock-form, .guide-footer, .flash { display: none !important; }
  html, body { max-width: none; overflow: visible; background: #fff; color: #000; }
  .guide-content { width: 100%; max-width: none; margin: 0; padding: 0; }
  .mus-grid-wrap { overflow: visible; border: 0; }
  .mus-grid { min-width: 0; }
  .res-cell { background: #f2f2f2 !important; border-left-color: #888 !important; }
  .rc-ders, .rc-ogr { color: #000 !important; }
  .mus-grid th { background: #eee !important; color: #000 !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.program-print-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.program-sheet-context { display: none; }
.prog-top .program-print-actions .btn { margin-left: 0; }
.program-view-tabs,
.program-entity-tabs {
  margin-bottom: 14px;
  padding-bottom: 2px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.program-view-tabs .sinif-tab,
.program-entity-tabs .sinif-tab { flex: 0 0 auto; }
.program-view-tabs .sinif-tab:focus-visible,
.program-entity-tabs .sinif-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.program-print-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.program-sheet { margin-bottom: 24px; }
.program-sheet-title { margin: 0 0 8px; font-size: 16px; line-height: 1.4; }
.program-single-title { display: none; }
.program-output-grid .res-grid td { height: 46px; padding: 2px; vertical-align: top; }
.program-output-grid .program-output-cell {
  min-height: 40px;
  height: auto;
  position: static;
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
}
.program-output-cell + .program-output-cell { margin-top: 3px; }
.program-output-cell .rc-meta { display: block; line-height: 1.35; }

@media (max-width: 960px) {
  .program-print-actions { width: 100%; margin-left: 0; }
}

@media print {
  .program-view-tabs, .program-entity-tabs, .program-print-actions, .program-print-note { display: none !important; }
  .prog-top { display: none !important; }
  .program-sheet-context { display: flex; justify-content: space-between; gap: 8mm; margin: 0 0 3mm; color: #000; font-size: 12pt; }
  .program-sheet { margin: 0; }
  .program-sheet-title { margin: 0 0 5mm; color: #000; font-size: 15pt; }
  .program-single-title { display: block; }
  .program-output-grid .res-grid td { height: auto; }
  .program-output-cell { min-height: 0; padding: 2mm; break-inside: avoid; }
  .program-output-all .program-sheet { break-after: page; page-break-after: always; }
  .program-output-all .program-sheet:last-child { break-after: auto; page-break-after: auto; }
}
.program-public{margin-left:0;max-width:1180px;margin-right:auto}
.daily-change-form{display:grid;gap:6px;min-width:240px}.daily-change-form label{font-size:12px}.daily-change-form select,.daily-change-form input[type="text"]{width:100%}.program-output-cell.is-cancelled{border-left-color:#b42318;background:#fff1f0}.program-output-cell.is-cancelled .rc-ders{color:#b42318}
