/* =========================================================
   Başak Koleji – Kulüp Takvimi
   Düz renkler, gradyansız, ferah eğitim teması
   Marka: mavi #1f5fb4 · yeşil #2e9e4f · sarı #f5c518
   ========================================================= */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --border: #e6eaf0;
  --border-strong: #d5dbe4;
  --text: #17223b;
  --text-2: #5b6b82;
  --text-3: #93a0b4;
  --blue: #1f5fb4;
  --blue-soft: #e8f0fb;
  --green: #2e9e4f;
  --green-soft: #e8f6ec;
  --yellow: #f5c518;
  --yellow-soft: #fff6d6;
  --navy: #143a6b;
  --shadow-xs: 0 1px 2px rgba(23, 34, 59, .05);
  --shadow: 0 1px 3px rgba(23, 34, 59, .05), 0 6px 20px -8px rgba(23, 34, 59, .10);
  --shadow-md: 0 2px 6px rgba(23, 34, 59, .05), 0 14px 36px -12px rgba(23, 34, 59, .16);
  --shadow-lg: 0 24px 70px -18px rgba(23, 34, 59, .35);
  --r-xl: 20px; --r-lg: 16px; --r-md: 13px; --r-sm: 9px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }

.topline { height: 5px; background: var(--blue); }
.app { max-width: 1480px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 36px) 56px; }

/* ---------- Header ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 64px; width: auto; display: block; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--navy); }
.brand p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; font-weight: 500; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats { display: flex; gap: 8px; }
.stats span { display: inline-flex; align-items: baseline; gap: 5px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.stats b { color: var(--navy); font-weight: 800; font-size: 15px; }

/* ---------- Segmented ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { padding: 8px 18px; border-radius: 999px; font-weight: 600; color: var(--text-2); transition: all .18s; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button.on { background: var(--blue); color: #fff; }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav .title { font-size: 18px; font-weight: 800; min-width: 220px; letter-spacing: -.3px; padding-left: 6px; color: var(--navy); }
.icon-btn { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); transition: all .15s; }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 13px; transition: all .15s; text-decoration: none; color: inherit; }
.btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* ---------- Filters ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; padding: 0 2px; }
.cats { display: inline-flex; gap: 6px; }
.cat { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text-2); transition: all .18s; }
.cat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-3)); }
.cat:hover { border-color: var(--border-strong); color: var(--text); }
.cat.on { color: #fff; background: var(--c, var(--navy)); border-color: var(--c, var(--navy)); }
.cat.on .dot { background: #fff; }
.divider { width: 1px; height: 22px; background: var(--border-strong); margin: 0 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-3); transition: all .18s; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); opacity: .3; }
.chip.on { color: var(--text); border-color: color-mix(in srgb, var(--c) 35%, var(--border)); background: color-mix(in srgb, var(--c) 8%, #fff); }
.chip.on .dot { opacity: 1; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.link { color: var(--blue); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Week view ---------- */
.week { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 14px; }
.day-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); display: flex; flex-direction: column; min-height: 340px; overflow: hidden; }
.day-col.today { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; cursor: pointer; transition: background .15s; border-bottom: 1px solid var(--border); }
.day-head:hover { background: var(--surface-2); }
.day-head .dow { font-weight: 800; font-size: 14px; color: var(--navy); }
.day-head .cnt { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.day-head .dnum { font-size: 12.5px; color: var(--text-2); font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); }
.day-col.today .dnum { background: var(--yellow); color: var(--navy); }
.day-body { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.slot { display: flex; flex-direction: column; gap: 8px; }
.slot-time { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; color: var(--text-3); letter-spacing: .6px; margin: 8px 2px 0; }
.slot-time::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.empty { flex: 1; display: grid; place-items: center; color: var(--text-3); font-size: 12.5px; padding: 30px 10px; text-align: center; line-height: 1.5; }

.card {
  --c: var(--text-3);
  position: relative; text-align: left; width: 100%; display: grid; grid-template-columns: 32px 1fr; gap: 9px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 10px 10px 9px;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.card .badge { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 11%, #fff); }
.card .badge .ic { width: 18px; height: 18px; }
.card .top { font-weight: 800; font-size: 12.5px; line-height: 1.3; color: var(--text); }
.card .time { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; }
.card .grp { margin-top: 3px; font-size: 11.5px; color: var(--text-2); line-height: 1.4; }
.card .tag { display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }

/* ---------- Month view ---------- */
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.month-head div { padding: 12px 14px; font-size: 11.5px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: .8px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cell { min-height: 126px; padding: 10px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; text-align: left; transition: background .15s; background: var(--surface); }
.cell:nth-child(7n) { border-right: 0; }
.cell:nth-last-child(-n+7) { border-bottom: 0; }
.cell:hover { background: var(--blue-soft); }
.cell.other { background: #fafbfc; }
.cell.other .num { color: var(--text-3); }
.cell.other .mchip, .cell.other .more { opacity: .4; }
.cell .num { font-size: 12.5px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin: 0 0 4px 2px; color: var(--text-2); }
.cell.today .num { background: var(--yellow); color: var(--navy); font-weight: 800; }
.mchip { --c: var(--text-3); display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; line-height: 1.2; padding: 4px 7px; border-radius: 7px; background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mchip .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.mchip .t { color: var(--c); font-weight: 800; font-variant-numeric: tabular-nums; }
.mchip .n { overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 11px; color: var(--blue); font-weight: 700; padding: 2px 7px; }

/* ---------- Drawer ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(20, 58, 107, .28); z-index: 40; opacity: 0; transition: opacity .2s; }
.drawer-bg.open { opacity: 1; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100% - 24px)); background: var(--surface); z-index: 41; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); transform: translateX(calc(100% + 24px)); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; overflow: hidden; }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 800; color: var(--navy); }
.drawer-head p { margin: 4px 0 0; color: var(--text-2); font-size: 12.5px; }
.drawer-body { padding: 12px 18px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); flex: 1; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 58, 107, .4); z-index: 50; display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-bg.open { opacity: 1; }
.modal { --c: var(--text-3); width: min(440px, 100%); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(10px); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.modal-bg.open .modal { transform: none; }
.modal-hero { position: relative; padding: 26px 24px 20px; background: color-mix(in srgb, var(--c) 10%, #fff); border-bottom: 1px solid color-mix(in srgb, var(--c) 18%, #fff); }
.modal-hero .ico { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: var(--c); background: #fff; border: 1px solid color-mix(in srgb, var(--c) 25%, #fff); }
.modal-hero .ico .ic { width: 28px; height: 28px; }
.modal-hero h3 { margin: 14px 0 3px; font-size: 22px; font-weight: 800; letter-spacing: -.4px; color: var(--text); }
.modal-hero .sub { color: var(--c); font-size: 12.5px; font-weight: 700; }
.modal-body { padding: 20px 24px 8px; display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 100px 1fr; gap: 10px; font-size: 13.5px; align-items: baseline; }
.row .k { color: var(--text-3); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; display: inline-flex; align-items: center; gap: 6px; }
.row .k .ic { width: 14px; height: 14px; }
.row .v { font-weight: 600; }
.note { display: flex; gap: 8px; align-items: flex-start; background: var(--yellow-soft); border: 1px solid #f3dd8a; color: #6b5300; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }
.note .ic { margin-top: 1px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px 22px; gap: 10px; }
.contact { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.contact b { color: var(--text); }
.close { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); transition: all .15s; }
.close .ic { width: 16px; height: 16px; }
.close:hover { background: var(--border); color: var(--text); }
.modal-hero .close { position: absolute; top: 14px; right: 14px; background: #fff; }

/* ---------- Footer ---------- */
.footer { margin-top: 28px; padding: 18px 4px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; }
.legend { display: flex; gap: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.foot-contact { display: inline-flex; align-items: center; gap: 6px; }
.foot-contact b { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .week { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .app { padding-top: 16px; }
  .brand-logo { height: 52px; }
  .brand h1 { font-size: 19px; }
  .week { grid-template-columns: 1fr; }
  .day-col { min-height: 0; }
  .toolbar { top: 8px; }
  .nav .title { min-width: 0; font-size: 15px; }
  .cell { min-height: 84px; padding: 6px 4px; }
  .mchip .n { display: none; }
  .mchip { padding: 3px 5px; }
  .month-head div { padding: 8px 4px; font-size: 10px; letter-spacing: .3px; }
  .stats { display: none; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; }
}
@media print {
  .toolbar .nav .icon-btn, .btn, .filters, .footer, .drawer, .drawer-bg, .modal-bg, .topline { display: none !important; }
  .toolbar { position: static; box-shadow: none; }
}
