/* ═══════════════════════════════════════════════════════════════
   YILLIK PLAN — Ana CSS   (panel-tabanlı header)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg:           #f5f2eb;
  --surface:      #ffffff;
  --border:       #c8b89a;
  --border-light: #e0d5c5;
  --text:         #1a1410;
  --text-muted:   #6b5c47;
  --accent:       #2a4a7f;
  --accent-r:     #7f2a2a;
  --accent-g:     #2a7f4a;
  --accent-go:    #7f6a2a;
  --hdr-bg:       #1a1410;
  --hdr-text:     #f5f2eb;
  --hdr-border:   #2e2820;
  --panel-bg:     #232018;
  --panel-border: #3a3025;
  --row-odd:      #ffffff;
  --row-even:     #f9f6f1;
  --tatil-bg:     #f0e8d8;
  --shadow:       0 2px 12px rgba(26,20,16,.12);
  --r:            3px;
}

*    { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'IBM Plex Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ═══ HEADER ═══════════════════════════════════════════════════ */
.site-header {
  background: var(--hdr-bg);
  color: var(--hdr-text);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 3px 18px rgba(0,0,0,.4);
  border-bottom: 2px solid var(--accent);
}

/* ── Üst bant ── */
.hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--hdr-border);
  gap: 16px;
  flex-wrap: wrap;
}
.hdr-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6a5a4a;
  display: block;
  margin-bottom: 2px;
}
.hdr-title {
  font-family: 'Noto Serif TR', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--hdr-text);
}
.hdr-brand { line-height: 1; }
.hdr-ders  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ders-select {
  min-width: 230px;
  background: #0d0b09 !important;
  border-color: #4a3a28 !important;
  color: #f5f2eb !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
}
.ders-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  padding: 3px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .3px;
}
.badge {
  background: #3a5a20;
  color: #c8f0a0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .3px;
}

/* ── Panel grubu bant ── */
.hdr-panels {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}

/* ── Tek panel ── */
.panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hdr-border);
  min-width: 0;
  flex-shrink: 0;
}
.panel:last-child { border-right: none; flex: 1; }

.panel-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8a7a6a;
  padding: 5px 12px 4px;
  background: #1e1b16;
  border-bottom: 1px solid var(--hdr-border);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.panel-sub {
  font-size: 8px;
  color: #5a4a38;
  font-style: normal;
}

.panel-body {
  padding: 6px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.panel-body--actions {
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px 8px;
}

/* ── Renkli panel aksan ── */
.panel--sinav  .panel-title { color: #c08080; }
.panel--imza   .panel-title { color: #80a0c0; }
.panel--actions .panel-title { color: #90c090; }

/* ── Field row: label + input(s) ── */
.field-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-row > label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: .5px;
  color: #7a6a58;
  white-space: nowrap;
  min-width: 50px;
  text-align: right;
}

/* ── Kontrol elemanları ── */
.ctrl-select {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--hdr-text);
  padding: 4px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  border-radius: var(--r);
  cursor: pointer;
  outline: none;
}
.ctrl-select--xs { width: 54px; font-size: 10px; padding: 3px 4px; }

.ctrl-date {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--hdr-text);
  padding: 4px 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  border-radius: var(--r);
  outline: none;
  cursor: pointer;
  width: 120px;
  transition: border-color .15s;
}
.ctrl-date:focus           { border-color: var(--accent); }
.ctrl-date--sinav          { border-color: #5a2020; color: #f0a0a0; }
.ctrl-date--sinav:focus    { border-color: #c04040; }

.ctrl-text {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--hdr-text);
  padding: 4px 7px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r);
  outline: none;
  width: 110px;
}
.ctrl-text--role {
  font-weight: 400;
  color: #a09080;
  font-size: 10px;
  width: 150px;
}
.ctrl-text:focus, .ctrl-text--role:focus { border-color: var(--accent); }

/* ── Aksiyon butonları ── */
.act-btn {
  display: block;
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
  cursor: pointer;
  background: #2a2520;
  color: #c0b090;
  text-align: left;
  transition: all .12s;
  white-space: nowrap;
}
.act-btn:hover          { background: #3a3020; color: #f0e0c0; border-color: #6a5a40; }
.act-btn--save          { background: #1a3a20; color: #80d080; border-color: #2a6a30; font-weight: 700; }
.act-btn--save:hover    { background: #2a5a30; color: #c0f0c0; }
.act-btn--multi         { color: #80b0e0; border-color: #2a4a6a; }
.act-btn--multi:hover   { background: #1a3050; color: #c0d8f0; }
.act-btn--danger        { color: #e07070; border-color: #6a2020; }
.act-btn--danger:hover  { background: #5a1818; color: #f0b0b0; }

/* ═══ DOĞRULAMA MESAJI ══════════════════════════════════════════ */
.validation-msg {
  background: #fdf0f0;
  border-left: 4px solid #c0392b;
  color: #7f2020;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 8px 16px;
  white-space: pre-line;
  line-height: 1.6;
}
.validation-msg.ok {
  background: #f0fdf4;
  border-color: #27ae60;
  color: #1a5c35;
}

/* ═══ ANA İÇERİK ════════════════════════════════════════════════ */
.main { padding: 10px 12px 60px; }

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  background: var(--surface);
  position: relative;
}

/* ═══ TABLO ═════════════════════════════════════════════════════ */
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1100px;
  font-size: 11.5px;
  table-layout: fixed;
}

thead th:nth-child(1)  { width: 90px;  }
thead th:nth-child(2)  { width: 58px;  }
thead th:nth-child(3)  { width: 140px; }
thead th:nth-child(4)  { width: 150px; }
thead th:nth-child(5)  { width: 180px; }
thead th:nth-child(6)  { width: 180px; }
thead th:nth-child(7)  { width: 140px; }
thead th:nth-child(8)  { width: 100px; }
thead th:nth-child(9)  { width: 80px;  }
thead th:nth-child(10) { width: 80px;  }
thead th:nth-child(11) { width: 110px; }

thead tr th {
  background: var(--hdr-bg);
  color: var(--hdr-text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 9px 8px;
  text-align: left;
  border-right: 1px solid #3a3025;
  white-space: normal;
  word-break: keep-all;
  position: sticky;
  top: 0;
  z-index: 10;
}
thead tr th:last-child { border-right: none; }

tbody tr { border-bottom: 1px solid var(--border-light); transition: background .12s; }
tbody tr:nth-child(odd)  { background: var(--row-odd); }
tbody tr:nth-child(even) { background: var(--row-even); }
tbody tr:hover           { background: #eee8d8 !important; }

td {
  padding: 8px 8px;
  vertical-align: top;
  border-right: 1px solid var(--border-light);
  line-height: 1.4;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
td:last-child { border-right: none; }

/* Hücre tipleri */
.col-hafta { font-family: 'IBM Plex Mono', monospace; }
.hafta-num  { font-size: 12px; font-weight: 600; color: var(--accent); display: block; margin-bottom: 2px; }
.hafta-date { font-size: 9px;  color: var(--text-muted); display: block; }
.col-saat   { text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; color: var(--accent-r); }
.col-unite  { font-size: 10.5px; font-weight: 600; }
.col-konu   { font-size: 10.5px; }
.col-cikti, .col-surec, .col-olcme { font-size: 10px; }
.col-sdb, .col-deger, .col-ob, .col-gun { font-size: 9.5px; color: var(--text-muted); }
.multi-line { white-space: pre-line; }

/* Ünite renk bantları */
.unite-1 { border-left: 3px solid #2a4a7f; }
.unite-2 { border-left: 3px solid #7f2a2a; }
.unite-3 { border-left: 3px solid #2a7f4a; }
.unite-4 { border-left: 3px solid #7f6a2a; }
.unite-5 { border-left: 3px solid #4a2a7f; }
.unite-6 { border-left: 3px solid #2a7f7f; }
.unite-7 { border-left: 3px solid #7f7f2a; }
.unite-8 { border-left: 3px solid #7f2a7f; }
.unite-x { border-left: 3px solid #5a5a5a; }

.tatil-row td {
  background: var(--tatil-bg) !important;
  border-left: 4px solid #c8a87a;
  font-family: 'Noto Serif TR', serif;
  font-style: italic;
  color: #7a5a30;
  text-align: center;
  font-size: 11.5px;
}
.sinav-badge {
  display: block;
  color: #c0392b;
  font-style: italic;
  font-weight: 700;
  font-size: 9.5px;
  margin-bottom: 3px;
}

/* ═══ SCROLL TOP ════════════════════════════════════════════════ */
#scroll-top {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--hdr-bg); color: var(--hdr-text);
  border: none; width: 38px; height: 38px;
  border-radius: 50%; font-size: 17px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  display: none; align-items: center; justify-content: center;
  z-index: 300;
}
#scroll-top.visible { display: flex; }
#scroll-top:hover   { opacity: .8; }

/* ═══ TOAST ═════════════════════════════════════════════════════ */
#saveToast {
  position: fixed; bottom: 68px; right: 20px;
  padding: 8px 16px; border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  z-index: 999; transition: opacity .4s;
  max-width: 360px; white-space: pre-line;
}

/* ═══ PRİNT BAŞLIK & İMZA ════════════════════════════════════════ */
.print-header    { display: none; }
.print-signature { display: none; }

/* ═══ YAZDIRMA ══════════════════════════════════════════════════ */
@media print {
  @page { size: A4 landscape; margin: 8mm 6mm; }
  html, body { width: 100%; }

  .site-header, .validation-msg, #scroll-top, #saveToast { display: none !important; }
  .main { padding: 0; }
  .table-wrap {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    box-shadow: none;
    border: none;
  }
  table { font-size: 6px; min-width: unset; width: 100%; table-layout: fixed; }
  th, td { padding: 2px 3px !important; word-break: break-word; }
  thead tr th {
    position: static !important;
    font-size: 5.5px !important;
    background: #1a1410 !important;
    color: #f5f2eb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  thead th:nth-child(1)  { width: 6% !important; }
  thead th:nth-child(2)  { width: 4% !important; }
  thead th:nth-child(3)  { width: 10% !important; }
  thead th:nth-child(4)  { width: 10% !important; }
  thead th:nth-child(5)  { width: 13% !important; }
  thead th:nth-child(6)  { width: 14% !important; }
  thead th:nth-child(7)  { width: 11% !important; }
  thead th:nth-child(8)  { width: 10% !important; }
  thead th:nth-child(9)  { width: 7% !important; }
  thead th:nth-child(10) { width: 6% !important; }
  thead th:nth-child(11) { width: 9% !important; }

  .hafta-num   { font-size: 6px !important; }
  .hafta-date  { font-size: 5.5px !important; }
  .col-saat    { font-size: 7px !important; }
  .sinav-badge { font-size: 6px !important; color: #c0392b !important; font-style: italic !important; font-weight: 700 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  tbody tr:nth-child(odd)  { background: #fff !important; }
  tbody tr:nth-child(even) { background: #f9f6f1 !important; }
  .tatil-row td { background: #f0e8d8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .unite-1,.unite-2,.unite-3,.unite-4,.unite-5,.unite-6,.unite-7,.unite-8,.unite-x {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 5px;
    border-bottom: 2px solid #1a1410;
    padding-bottom: 4px;
  }
  .ph-school { font-family: 'Noto Serif TR', serif; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
  .ph-sub    { font-size: 9px; margin-top: 1px; }
  .ph-year   { font-family: 'IBM Plex Mono', monospace; font-size: 8px; color: #555; margin-top: 1px; }

  .print-signature {
    display: block !important;
    margin-top: 10px;
    page-break-inside: avoid;
    border-top: 1px solid #bbb;
    padding-top: 6px;
  }
  .sig-date-row    { text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 7px; color: #333; margin-bottom: 6px; }
  .sig-date-label  { font-weight: 600; margin-right: 4px; }
  .sig-blocks-row  { display: flex !important; justify-content: space-around; align-items: flex-end; }
  .sig-spacer      { flex: 1; }
  .sig-block       { text-align: center; min-width: 160px; }
  .sig-name-top    { font-size: 8px; font-weight: 700; margin-bottom: 1px; }
  .sig-role-bottom { font-size: 7px; color: #444; margin-bottom: 5px; }
  .sig-line        { border-top: 1px solid #1a1410; width: 160px; margin: 0 auto; }
}
