:root {
    --bg: #F2F5F3;
    --surface: #FFFFFF;
    --ink: #17201D;
    --muted: #5B6A64;
    --line: #D6DFDA;
    --band: #21443C;
    --on-band: #F2F6F4;
    --brand-t: #21443C;
    --accent: #C98A12;
    --danger: #AE3528;
    --ok: #2E7A4E;
    --chip: #E5EDE9;
    --late-bg: #FBEDEA;
    --serif: "Bitter", Georgia, "Times New Roman", serif;
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --bs-body-font-family: var(--sans);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-primary: #21443C;
    --bs-primary-rgb: 33, 68, 60;
    --bs-link-color: #21443C;
    --bs-link-hover-color: #142b25;
}

body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; }

.btn-primary { --bs-btn-bg: #21443C; --bs-btn-border-color: #21443C; --bs-btn-hover-bg: #183329; --bs-btn-hover-border-color: #183329; --bs-btn-active-bg: #142b25; --bs-btn-disabled-bg: #21443C; }
.btn-outline-primary { --bs-btn-color: #21443C; --bs-btn-border-color: #21443C; --bs-btn-hover-bg: #21443C; --bs-btn-hover-border-color: #21443C; --bs-btn-active-bg: #21443C; }
.form-control:focus, .form-select:focus { border-color: #5f8f82; box-shadow: 0 0 0 .2rem rgba(33, 68, 60, .18); }

/* Üst bant */
.topbar { background: var(--band); color: var(--on-band); }
.topbar-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; padding-top: 20px; }
.brand { font: 700 26px/1.15 var(--serif); color: var(--on-band); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand-sub { opacity: .78; font-size: 14px; margin-top: 2px; }
.user-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-tools .who { font-size: 14px; opacity: .85; margin-right: 4px; }
.btn-ghost { color: var(--on-band); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; }
.tab { color: var(--on-band); opacity: .82; text-decoration: none; padding: 11px 16px 12px; border-radius: 10px 10px 0 0; font: 600 15px/1 var(--serif); white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tab:hover { color: #fff; opacity: 1; }
.tab.active { background: var(--bg); color: var(--ink); opacity: 1; }
.count { font: 600 12px/1 var(--sans); background: rgba(255, 255, 255, .16); padding: 3px 7px; border-radius: 999px; }
.tab.active .count, .count-soft { background: var(--chip); color: var(--ink); }
.count-late { background: var(--danger) !important; color: #fff !important; }
.count-new { background: var(--accent) !important; color: #1a1300 !important; }

.page { padding-top: 24px; padding-bottom: 60px; }
.narrow { max-width: 760px; }
.page-h { font: 700 24px/1.2 var(--serif); margin: 0 0 14px; }
.section-h { font: 600 19px/1.3 var(--serif); margin: 30px 0 12px; display: flex; gap: 8px; align-items: center; }
.section-h:first-child { margin-top: 0; }
.sec-h { font: 600 16px/1.3 var(--serif); color: var(--brand-t); margin: 22px 0 6px; }
.group-h { font: 600 16px/1.3 var(--serif); color: var(--brand-t); margin: 24px 0 8px; display: flex; gap: 8px; align-items: center; }
.muted { color: var(--muted); }
.lead-text { color: var(--muted); max-width: 72ch; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; }
.back-link::before { content: "‹ "; }
.back-link:hover { color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar input[type=search] { min-width: 220px; flex: 1 1 260px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 14px; color: var(--ink); text-decoration: none; }
.pill.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.note { background: var(--chip); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.note-accent { background: #FBF1DC; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.empty.slim { padding: 18px 16px; }

/* Çipler */
.chip { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); }
.chip-sakarya { background: #DCEBE5; color: #1F4A3F; }
.chip-izmit { background: #E2E6F3; color: #2C3A66; }
.chip-ortak { background: #EFE8F5; color: #4A3266; }
.chip-new { background: var(--accent); color: #1a1300; }
.chip-prog { background: transparent; border: 1px solid var(--accent); color: #8a5e0a; }

/* Toplantı kartı */
.mtg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.mtg-head { display: flex; color: inherit; text-decoration: none; }
.mtg-head:hover { background: #fafcfb; color: inherit; }
.cal { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 6px; border-right: 1px solid var(--line); }
.cal-d { font: 700 28px/1 var(--serif); color: var(--brand-t); }
.cal-m { font-size: 12.5px; color: var(--muted); margin-top: 4px; text-transform: capitalize; }
.mtg-main { padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.mtg-title { font: 600 17px/1.3 var(--serif); }
.mtg-sub { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13.5px; color: var(--muted); }
.mtg-body { border-top: 1px solid var(--line); padding: 16px 20px 20px 96px; }
.mtg-body h4 { font: 600 14px/1.3 var(--serif); margin: 16px 0 6px; color: var(--brand-t); }
.mtg-body h4:first-child { margin-top: 0; }
.txt { white-space: pre-wrap; margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

/* Görevler */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks.boxed { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.mtg-body .task { padding: 9px 0; }
.task.late { background: var(--late-bg); }
.mtg-body .task.late { background: none; }
.task-main { flex: 1; min-width: 0; }
.task-text { display: block; overflow-wrap: anywhere; }
.task.done .task-text { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: 3px; align-items: center; }
.late-t { color: var(--danger); font-weight: 600; }
.src { font-style: italic; color: var(--muted); }
.task-act { display: flex; gap: 6px; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.task-act select { width: auto; }
.last-reply { display: block; margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--brand-t); background: var(--bg); border-radius: 0 6px 6px 0; font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Cevaplar */
.reply { border-left: 3px solid var(--brand-t); background: var(--bg); border-radius: 0 8px 8px 0; padding: 8px 12px 10px; margin: 8px 0; }
.reply.is-new { border-left-color: var(--accent); }
.reply-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13.5px; color: var(--muted); }
.reply-h strong { color: var(--ink); }
.reply-h .grow { flex: 1; }
.reply .txt { margin-top: 4px; }
.reply-form { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.card-box .reply-form { margin-top: 0; padding-top: 0; border-top: 0; }

/* Toplantı formu */
.people-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.pchk { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--surface); cursor: pointer; font-size: 14px; }
.pchk:has(input:checked) { background: #DCEBE5; border-color: #9cc3b6; }
.drows { display: flex; flex-direction: column; gap: 8px; }
.drow, .drows-head { display: grid; grid-template-columns: 1fr 200px 160px 72px; gap: 8px; align-items: center; }
.drows-head { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

/* E-posta */
.mlist { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.mrow { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mrow:last-child { border-bottom: 0; }
.mrow-main { display: flex; flex-direction: column; min-width: 0; }
.mrow-main small { color: var(--muted); }
.mrow-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mail-preview { font-size: 13.5px; background: #fafcfb; }

/* Çalışma düzeni */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 8px; }
.day.today { border-color: var(--brand-t); box-shadow: inset 0 3px 0 var(--brand-t); }
.day h3 { font: 600 16px/1.2 var(--serif); margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.day h3 small { font: 500 12px var(--sans); color: var(--brand-t); }
.day ul { list-style: none; margin: 0; padding: 0; }
.day li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.day time { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 44px; color: var(--brand-t); }
.day .r-main { flex: 1; min-width: 0; }
.day .r-main small { display: block; color: var(--muted); font-size: 13px; }
.day .none { color: var(--muted); font-size: 13.5px; }

/* Giriş */
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 100%; max-width: 420px; }
.brand-dark { font: 700 26px/1.2 var(--serif); color: var(--brand-t); margin: 0 0 6px; }

@media (max-width: 720px) {
    .brand { font-size: 22px; }
    .cal { width: 62px; }
    .mtg-body { padding: 14px; }
    .task { flex-wrap: wrap; }
    .task-act { width: 100%; }
    .drow { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
    .drow input[name$=".Text"] { grid-column: 1 / -1; }
}
