/* ===========================================================
   TakvimApp – Profesyonel tema
   =========================================================== */
:root {
    --brand: #4f46e5;
    --brand-2: #6366f1;
    --brand-700: #4338ca;
    --brand-soft: #eef2ff;
    --brand-soft-2: #e0e7ff;

    --ink: #111827;
    --ink-2: #374151;
    --ink-soft: #6b7280;
    --muted: #9ca3af;
    --line: #eceef2;
    --line-2: #e5e7eb;
    --bg: #f7f8fb;
    --card: #ffffff;

    --danger: #e11d48;
    --success: #059669;

    --radius: 14px;
    --radius-lg: 20px;
    --radius-sm: 10px;

    --shadow-xs: 0 1px 2px rgba(16,24,40,.06);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --shadow: 0 12px 28px -14px rgba(16,24,40,.22);
    --shadow-lg: 0 24px 48px -20px rgba(16,24,40,.28);

    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { position: relative; min-height: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    letter-spacing: -0.01em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }

::selection { background: var(--brand-soft-2); }

/* ---------- Navbar ---------- */
.app-nav {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line-2);
    padding-top: .55rem; padding-bottom: .55rem;
}
.app-nav .navbar-brand {
    color: var(--ink) !important;
    font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em;
    display: flex; align-items: center; gap: .55rem;
}
.app-nav .nav-link {
    color: var(--ink-soft) !important; font-weight: 500; font-size: .95rem;
    padding: .4rem .8rem !important; border-radius: 9px; transition: color .15s, background .15s;
}
.app-nav .nav-link:hover { color: var(--ink) !important; background: var(--brand-soft); }
.app-nav .nav-link.active { color: var(--brand) !important; }
.app-nav .btn-link { color: var(--ink-soft) !important; text-decoration: none; font-weight: 500; font-size: .95rem; }
.app-nav .btn-link:hover { color: var(--danger) !important; }
.app-nav .navbar-toggler { border-color: var(--line-2); }
.brand-badge {
    width: 34px; height: 34px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand-2), var(--brand-700));
    border-radius: 10px; font-size: 1.05rem; box-shadow: var(--shadow-sm);
    color: #fff;
}

/* ---------- Buttons ---------- */
.btn-brand {
    background: var(--brand); border: none; color: #fff; font-weight: 600;
    border-radius: var(--radius-sm); padding: .58rem 1.15rem; font-size: .92rem;
    box-shadow: 0 1px 2px rgba(79,70,229,.35), inset 0 1px 0 rgba(255,255,255,.12);
    transition: background .15s, transform .06s, box-shadow .15s;
}
.btn-brand:hover { background: var(--brand-700); color: #fff; box-shadow: 0 6px 16px -6px rgba(79,70,229,.55); }
.btn-brand:active { transform: translateY(1px); }
.btn-ghost {
    background: #fff; border: 1px solid var(--line-2); color: var(--ink-2);
    border-radius: var(--radius-sm); padding: .52rem 1rem; font-weight: 500; font-size: .92rem;
    transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: #f9fafb; border-color: var(--muted); color: var(--ink); }

/* ---------- Cards ---------- */
.card-soft {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}

/* ---------- Landing / hero ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    border-radius: 26px; padding: 4rem 3rem;
    background:
        radial-gradient(120% 120% at 100% 0%, #6366f1 0%, transparent 45%),
        radial-gradient(120% 140% at 0% 100%, #7c3aed 0%, transparent 50%),
        linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: var(--shadow);
}
.hero h1 { font-weight: 800; font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: .9rem; letter-spacing: -.03em; line-height: 1.1; }
.hero p { font-size: 1.12rem; color: rgba(255,255,255,.92); max-width: 640px; line-height: 1.6; }
.hero .btn-brand { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }
.hero .btn-brand:hover { background: #f1f5f9; color: var(--brand-700); }
.hero .btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.hero-emoji { position: absolute; right: 12px; bottom: -28px; font-size: 12rem; opacity: .12; transform: rotate(-8deg); pointer-events: none; }

.feature-icon {
    width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem;
    background: var(--brand-soft); color: var(--brand-700); box-shadow: var(--shadow-xs);
}
.card-soft h5 { letter-spacing: -.02em; }

/* ===========================================================
   Takvim
   =========================================================== */
.calendar-shell { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) {
    .calendar-shell { grid-template-columns: 1fr; }
    /* Mobilde takvim önce, kategoriler altta */
    .calendar-shell > section { order: 1; }
    .calendar-shell > aside { order: 2; }
}

.cal-panel { padding: 1.35rem; }
.cal-panel h6 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 0; }

/* Kategori listesi */
.cat-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .6rem; border-radius: 11px; cursor: pointer;
    transition: background .12s; user-select: none;
}
.cat-item:hover { background: var(--brand-soft); }
.cat-item .dot { width: 11px; height: 11px; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(0,0,0,.03); }
.cat-item .name { flex: 1; font-weight: 500; font-size: .92rem; }
.cat-item .count {
    font-size: .72rem; font-weight: 700; color: var(--ink-soft);
    background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 1px 8px; min-width: 22px; text-align: center;
}
.cat-item.active-row, .cat-item:hover .name { color: var(--brand-700); }
.cat-item .cat-actions { opacity: 0; display: flex; gap: .2rem; transition: opacity .12s; }
.cat-item:hover .cat-actions { opacity: 1; }
.cat-item:hover .count { display: none; }
.cat-item.off { opacity: .42; }
.cat-item.off .dot { background: var(--muted) !important; }
.icon-btn {
    border: none; background: transparent; color: var(--muted);
    width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: .82rem;
}
.icon-btn:hover { background: var(--card); color: var(--brand); box-shadow: var(--shadow-xs); }

.sep { height: 1px; background: var(--line); margin: 1.1rem 0; border: 0; }

/* Takvim başlık çubuğu */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.cal-title { font-size: 1.5rem; font-weight: 700; text-transform: capitalize; letter-spacing: -.02em; line-height: 1.15; }
.cal-sub { font-size: .82rem; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* Tümünü göster/gizle */
.toggle-all {
    width: 100%; margin-top: .5rem; background: transparent; border: none;
    color: var(--ink-soft); font-size: .82rem; font-weight: 600; cursor: pointer;
    padding: .4rem; border-radius: 8px; transition: background .12s, color .12s;
}
.toggle-all:hover { background: var(--brand-soft); color: var(--brand); }
.cal-nav { display: inline-flex; align-items: center; gap: .35rem; background: var(--bg); padding: 5px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.cal-nav button {
    height: 36px; min-width: 36px; padding: 0 .55rem; border-radius: 10px; border: none;
    background: transparent; cursor: pointer; font-size: .95rem; font-weight: 700; color: var(--ink-2);
    display: grid; place-items: center; transition: background .12s, box-shadow .12s, color .12s;
}
.cal-nav button:hover { background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }

/* Ay ızgarası — modern: yumuşak çerçeve, ince ayraçlar, temaya duyarlı */
.cal-grid { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: 0 18px 40px -30px rgba(15,23,42,.35); }
.cal-week-head, .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week-head > div {
    padding: .8rem .6rem; text-align: center; font-size: .68rem; font-weight: 800;
    color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line);
    text-transform: uppercase; letter-spacing: .09em;
}
.cal-week-head > div:nth-child(6), .cal-week-head > div:nth-child(7) { color: var(--brand); opacity: .8; }
.cal-cell {
    min-height: 124px; min-width: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    padding: .45rem; position: relative; cursor: pointer; transition: background .15s, box-shadow .15s;
    display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-week:last-child .cal-cell { border-bottom: none; }
.cal-cell:hover { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand-soft-2); z-index: 1; }
.cal-cell.weekend { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.cal-cell.weekend:hover { background: var(--brand-soft); }
.cal-cell.other-month { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.cal-cell.other-month .cell-num { color: var(--muted); opacity: .7; }
.cal-cell.today { background: color-mix(in srgb, var(--brand-soft) 75%, transparent); box-shadow: inset 0 0 0 1.5px var(--brand-soft-2); }
.cell-num {
    font-size: .84rem; font-weight: 700; color: var(--ink-soft); align-self: flex-end;
    width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; transition: background .15s, color .15s;
}
.cal-cell.today .cell-num { background: linear-gradient(135deg, var(--brand-2), var(--brand-700)); color: #fff; box-shadow: 0 4px 10px -2px rgba(79,70,229,.55); }

/* Etkinlik pill'i — saatli: nokta + saat (tint zemin); tüm gün: dolu renk */
.evt {
    display: flex; align-items: center; gap: 5px;
    font-size: .74rem; line-height: 1.3; padding: 3px 8px; border-radius: 8px;
    background: var(--brand-soft); color: var(--ink);
    white-space: nowrap; overflow: hidden; cursor: pointer; font-weight: 600; min-width: 0; max-width: 100%;
    transition: filter .12s, transform .06s, box-shadow .12s; outline: none;
}
.evt:hover { filter: brightness(.97); transform: translateX(1px); box-shadow: 0 3px 8px -4px rgba(15,23,42,.35); }
.evt:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-2); }
.evt .evt-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.evt .evt-time { color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.evt .evt-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.evt.allday { color: #fff; font-weight: 600; }
.evt.allday .evt-title { text-shadow: 0 1px 1px rgba(0,0,0,.12); }

/* Teslim çipi — kesikli çerçeve, beyaz zemin (etkinlikten ayrı görünsün) */
.evt.deadline-chip { background: #fff; border: 1px dashed var(--line); font-weight: 600; text-decoration: none; color: var(--ink); }
.evt.deadline-chip:hover { filter: none; background: #fafbff; transform: none; }
.dl-flag-mini { font-size: .68rem; line-height: 1; margin-top: 2px; align-self: center; }

/* ===== Çok-günlü proje bantları (Outlook tarzı yatay şerit) ===== */
.span-band { display: flex; flex-direction: column; gap: 2px; margin: 1px -.4rem 3px; }
.span-seg {
    height: 20px; display: flex; align-items: center; gap: 5px; padding: 0 6px;
    font-size: .7rem; font-weight: 600; line-height: 20px; overflow: hidden; white-space: nowrap;
    color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
    border-left: 3px solid transparent;
}
.span-seg.empty { background: transparent !important; box-shadow: none; }
.span-seg.s-start { border-top-left-radius: 8px; border-bottom-left-radius: 8px; margin-left: 3px; border-left: 3px solid var(--sp-color); }
.span-seg.s-end { border-top-right-radius: 8px; border-bottom-right-radius: 8px; margin-right: 3px; }
.span-seg .sp-ico { flex: 0 0 auto; font-size: .72rem; }
.span-seg .sp-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.span-seg .sp-avs { display: inline-flex; margin-left: auto; padding-left: 4px; flex: 0 0 auto; }
.span-seg .sp-av {
    width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
    font-size: .58rem; color: #fff; font-weight: 800; border: 1.5px solid var(--card, #fff); margin-left: -6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.span-seg .sp-av.more { background: #64748b; }
a.span-seg:hover { filter: brightness(.96); }
/* Mobil ince şerit göstergesi */
.span-mini { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 2px; }
.span-mini > span { height: 3px; border-radius: 3px; }

:root[data-theme="dark"] .span-seg { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
:root[data-theme="dark"] .span-seg .sp-av { border-color: #1f242e; }

/* ===== Proje çalışma alanı (detay sayfası) ===== */
.cat-chip { font-size: .72rem; font-weight: 600; color: #fff; padding: 1px 9px; border-radius: 999px; }
.status-badge { font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.status-badge.s0 { background: #eef2ff; color: #4338ca; }
.status-badge.s1 { background: #ecfdf5; color: #047857; }
.status-badge.s2 { background: #fff7ed; color: #c2410c; }

.pd-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* Proje ilerleme çubuğu */
.pj-progress { display: flex; align-items: center; gap: .55rem; }
.pj-progress-bar { flex: 1; height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pj-progress-bar span { display: block; height: 100%; border-radius: 99px; transition: width .3s ease; }
.pj-progress-txt { font-size: .72rem; color: var(--muted); white-space: nowrap; font-weight: 600; }
.pd-tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.pd-tab { border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: .92rem; padding: .6rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.pd-tab:hover { color: var(--ink); }
.pd-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Kanban pano */
.board { display: flex; gap: .85rem; align-items: flex-start; overflow-x: auto; padding-bottom: 1rem; }
.bucket { flex: 0 0 290px; max-width: 290px; background: var(--brand-soft); border-radius: 14px; padding: .6rem; display: flex; flex-direction: column; max-height: 74vh; }
.bucket.drop-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: #e6e9ff; }
.bucket-head { display: flex; align-items: center; gap: .5rem; padding: .2rem .4rem .5rem; }
.bucket-name { font-weight: 700; color: var(--ink); cursor: pointer; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-name:hover { text-decoration: underline; }
.bucket-count { font-size: .74rem; font-weight: 700; color: var(--muted); background: #fff; border-radius: 999px; padding: 0 8px; }
.bucket-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; opacity: 0; transition: opacity .12s; }
.bucket:hover .bucket-del { opacity: 1; }
.bucket-del:hover { color: #dc2626; }
.bucket-body { overflow-y: auto; display: flex; flex-direction: column; gap: .45rem; min-height: 8px; }
.task-add-btn { margin-top: .5rem; border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: .84rem; padding: .35rem; border-radius: 8px; cursor: pointer; text-align: left; }
.task-add-btn:hover { background: #fff; color: var(--brand); }
.task-add-box { margin-top: .1rem; }

.task-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: .55rem .6rem; display: flex; gap: .5rem; align-items: flex-start; cursor: grab; box-shadow: 0 1px 3px -1px rgba(0,0,0,.08); transition: border-color .12s, transform .06s; }
.task-card:hover { border-color: var(--brand-2); }
.task-card.dragging { opacity: .45; }
.task-card.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check { flex: 0 0 auto; width: 18px; height: 18px; border: 2px solid #cbd0dc; border-radius: 6px; cursor: pointer; margin-top: 1px; }
.task-check.on { background: var(--brand); border-color: var(--brand); position: relative; }
.task-check.on::after { content: "✓"; color: #fff; font-size: .72rem; position: absolute; top: -3px; left: 2px; }
.task-body { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-size: .88rem; color: var(--ink); word-break: break-word; }
.task-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.task-due, .task-sub, .task-prio { font-size: .74rem; color: var(--muted); }
.task-sub { font-weight: 600; }
/* Öncelik: kartın sol kenarında renk şeridi */
.task-card.prio-1 { border-left: 3px solid #dc2626; }
.task-card.prio-2 { border-left: 3px solid #16a34a; }
.task-card.drop-before { box-shadow: 0 -2px 0 0 var(--brand); }
.bucket-add { flex: 0 0 240px; }
.bucket-add-btn { width: 100%; border: 2px dashed var(--line); background: transparent; color: var(--muted); font-weight: 600; padding: .6rem; border-radius: 14px; cursor: pointer; }
.bucket-add-btn:hover { border-color: var(--brand-2); color: var(--brand); }

/* Günlük iş defteri (zaman tüneli) */
.journal-day { display: flex; gap: .9rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.journal-day:last-child { border-bottom: none; }
.journal-date { flex: 0 0 52px; text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: .15rem; }
.journal-date .jd-num { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1; }
.journal-date .jd-mon, .journal-date .jd-dow { font-size: .72rem; color: var(--muted); }
.journal-entries { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.journal-entry { display: flex; gap: .5rem; align-items: flex-start; background: var(--brand-soft); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; }
.journal-entry .je-main { flex: 1; min-width: 0; }
.journal-entry .je-text { white-space: pre-wrap; color: var(--ink); font-size: .92rem; }
.journal-entry .je-actions { display: flex; gap: .1rem; flex: 0 0 auto; }
.journal-entry .je-edit, .journal-entry .je-del { border: none; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s; font-size: .95rem; line-height: 1; padding: 2px 4px; }
.journal-entry:hover .je-edit, .journal-entry:hover .je-del { opacity: 1; }
.journal-entry .je-edit:hover { color: var(--brand); }
.journal-entry .je-del:hover { color: #dc2626; }
/* Dokunmatik cihazlar: hover yok → düğmeler hep görünür */
@media (hover: none) { .journal-entry .je-edit, .journal-entry .je-del { opacity: .7; } }
.je-editbox { margin-bottom: .5rem; }
.je-editbox .je-ta { width: 100%; border-radius: 10px; font-size: .92rem; resize: vertical; }
.je-editbox .je-editbtns { display: flex; gap: .4rem; margin-top: .4rem; }
.je-images { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.je-images:empty { margin-top: 0; }
.je-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.je-thumb-ph { width: 100%; height: 100%; background: #f1f2f6; }
.je-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.je-img-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.je-thumb:hover .je-img-del { opacity: 1; }
.je-addimg { display: inline-block; margin-top: .5rem; font-size: .78rem; color: var(--muted); cursor: pointer; padding: .2rem .5rem; border: 1px dashed var(--line); border-radius: 8px; }
.je-addimg:hover { color: var(--brand); border-color: var(--brand-2); }

/* Görünüm araç çubuğu: Ay/Hafta/Ajanda anahtarı + arama */
.cal-tools { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.view-switch { display: inline-flex; background: var(--brand-soft); border-radius: 14px; padding: 4px; gap: 3px; }
.view-switch button { border: none; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: .86rem; padding: .42rem 1rem; border-radius: 10px; cursor: pointer; transition: background .12s, color .12s, transform .08s; }
.view-switch button:hover { color: var(--brand-700); }
.view-switch button.active { background: var(--card); color: var(--brand); box-shadow: 0 4px 10px -4px rgba(79,70,229,.4); }
/* Verimlilik çipleri (rutin gizle / yoğunluk) */
.cal-chips { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
.cal-chip {
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
    border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
    font-weight: 700; font-size: .84rem; padding: .44rem .85rem; border-radius: 12px; cursor: pointer;
    transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.cal-chip:hover { border-color: var(--brand-soft-2); color: var(--brand-700); box-shadow: var(--shadow-xs); }
.cal-chip.on { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand); }
.cal-chip.on::before { content: "✓ "; font-weight: 900; }

/* Yoğun mod: bir güne daha çok etkinlik sığar */
.cal-grid.dense .cal-cell { min-height: 96px; padding: .35rem; gap: 2px; }
.cal-grid.dense .evt { padding: 1px 6px; font-size: .7rem; border-radius: 6px; }
.cal-grid.dense .cell-num { width: 24px; height: 24px; font-size: .78rem; }
.cal-grid.dense .span-band { margin-bottom: 2px; }

.cal-search { flex: 1; min-width: 180px; max-width: 340px; }
.cal-search input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: .6rem .95rem; font-size: .9rem; background: var(--card); transition: border-color .12s, box-shadow .12s; }
.cal-search input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); }

/* Hafta görünümü: hücreler daha yüksek, tüm etkinlikler görünür */
.cal-week.week-view { min-height: 60vh; }
.cal-week.week-view .cal-cell { min-height: 60vh; overflow-y: auto; }

/* Ajanda görünümü: güne göre gruplu liste */
.agenda-view { padding: .25rem; }
.agenda-row { display: flex; gap: .9rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.agenda-row:last-child { border-bottom: none; }
.agenda-date { flex: 0 0 52px; text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: .15rem; }
.agenda-date .ad-num { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1; }
.agenda-date .ad-mon { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.agenda-date .ad-dow { font-size: .72rem; color: var(--muted); }
.agenda-date.is-today .ad-num { color: #fff; background: var(--brand); border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 2px; box-shadow: 0 2px 6px -1px rgba(79,70,229,.5); }
.agenda-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.agenda-evt { display: flex; align-items: center; gap: .6rem; background: var(--card-2, #fafbff); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; cursor: pointer; transition: border-color .12s, transform .06s; }
.agenda-evt:hover { border-color: var(--brand-2); transform: translateX(2px); }
.agenda-evt .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 auto; }
.agenda-evt .ag-body { flex: 1; min-width: 0; }
.agenda-evt .ag-t { font-weight: 600; color: var(--ink); font-size: .92rem; }
.agenda-evt .ag-meta { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); margin-top: .1rem; flex-wrap: wrap; }
.agenda-evt .ag-meta .chip { color: #fff; padding: 0 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.agenda-evt .go { color: var(--muted); font-size: 1.2rem; }

/* Tekrarlayan etkinlik düzenleme kapsamı kutusu */
.scope-box { background: var(--brand-soft); border: 1px solid var(--brand-2); border-radius: 12px; padding: .7rem .8rem; }
.scope-box .form-label { color: var(--brand); font-weight: 600; }

/* Sürükle-taşı: sürüklenen pill soluk; bırakma hedefi vurgulu */
.evt[draggable="true"] { cursor: grab; }
.evt.dragging { opacity: .45; cursor: grabbing; }
.cal-cell.drop-target { background: var(--brand-soft) !important; box-shadow: inset 0 0 0 2px var(--brand); }
.cal-cell.drop-target .cell-num { background: var(--brand); color: #fff; }

/* Hover detay popover'ı */
#evtPopover {
    position: fixed; display: none; z-index: 1090; width: 250px; max-width: 82vw;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-lg); padding: .85rem .95rem; pointer-events: none;
    animation: popIn .12s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#evtPopover .pop-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
#evtPopover .pop-bar { width: 4px; height: 18px; border-radius: 4px; flex: 0 0 auto; }
#evtPopover .pop-title { font-weight: 700; font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#evtPopover .pop-row { font-size: .82rem; color: var(--ink-soft); margin-top: .3rem; }
#evtPopover .pop-chip { display: inline-block; font-size: .72rem; font-weight: 600; color: #fff; padding: 1px 9px; border-radius: 999px; }
#evtPopover .pop-desc { font-size: .82rem; color: var(--ink-soft); margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 96px; overflow: hidden; }
.more-link { font-size: .7rem; color: var(--brand); font-weight: 600; padding-left: 5px; cursor: pointer; }
.more-link:hover { text-decoration: underline; }

/* Dar ekran nokta gösterimi */
.evt-dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 2px; padding: 0 2px; }
.evt-dots .edot { width: 7px; height: 7px; border-radius: 50%; }
.evt-dots .edot-more { font-size: .6rem; font-weight: 700; color: var(--muted); line-height: 1; }

/* Yüzen yeni etkinlik butonu (FAB) — sadece mobil */
.fab {
    display: none; position: fixed; right: 18px; bottom: 18px; z-index: 1050;
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--brand); color: #fff; font-size: 1.9rem; line-height: 1; font-weight: 400;
    box-shadow: 0 10px 24px -6px rgba(79,70,229,.6); transition: transform .1s, background .15s;
}
.fab:hover { background: var(--brand-700); }
.fab:active { transform: scale(.94); }

.empty-hint { color: var(--muted); font-size: .86rem; text-align: center; padding: 1.5rem 1rem; }

/* ---------- Modal / form ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm); border-color: var(--line-2); font-size: .93rem; padding: .5rem .7rem; color: var(--ink);
}
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99,102,241,.16); }
.form-control::placeholder { color: var(--muted); }
.modal-content { border: none; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--line); padding: 1.1rem 1.35rem; }
.modal-title { font-weight: 700; letter-spacing: -.02em; }
.modal-body { padding: 1.35rem; }
.modal-footer { border-top: 1px solid var(--line); padding: .9rem 1.35rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.16); border-color: var(--brand-2); }

/* Gün detay */
.day-sub { font-size: .82rem; color: var(--muted); font-weight: 500; text-transform: capitalize; margin-top: 2px; }
.day-evt {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px;
    margin-bottom: .55rem; cursor: pointer; background: #fff;
    transition: border-color .12s, box-shadow .12s, transform .06s;
}
.day-evt:last-child { margin-bottom: 0; }
.day-evt:hover { border-color: var(--brand-2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.day-evt .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 auto; }
.day-evt .body { flex: 1; min-width: 0; }
.day-evt .t { font-weight: 600; font-size: .95rem; color: var(--ink); display: flex; align-items: center; gap: .4rem; }
.day-evt .meta { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.day-evt .chip {
    font-size: .72rem; font-weight: 600; padding: 1px 9px; border-radius: 999px;
    color: #fff; white-space: nowrap;
}
.day-evt .desc { font-size: .84rem; color: var(--ink-soft); margin-top: .35rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.day-evt .go { color: var(--muted); font-size: 1.1rem; align-self: center; }
.day-empty { text-align: center; color: var(--muted); padding: 1.75rem 1rem; }
.day-empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; }

/* Tek tıkla tamamlandı kutucuğu (gün modalı + Günüm) */
.done-box {
    flex: 0 0 auto; align-self: center; background: none; border: 0; padding: 0 .1rem;
    font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--ink-soft);
    transition: transform .08s, color .12s;
}
.done-box:hover { transform: scale(1.15); color: var(--brand-2); }
.done-box.as-flag { cursor: default; }
.done-box.as-flag:hover { transform: none; color: inherit; }
.day-evt.is-done .t { text-decoration: line-through; color: var(--muted); }
.day-evt.is-done { opacity: .62; }
/* Takvim çipinde tamamlanan etkinlik */
.evt.is-done .evt-title { text-decoration: line-through; opacity: .6; }

/* Sürüklenebilir modal: başlıktan tutup taşı */
.modal-header.draggable { cursor: move; user-select: none; }
.modal-header.draggable .btn-close { cursor: pointer; }

.color-swatches { display: flex; gap: .45rem; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; box-shadow: var(--shadow-xs); transition: transform .08s; }
.swatch:hover { transform: scale(1.08); }
.swatch.sel { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,24,39,.12); }

/* Toast */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 1080; display: flex; flex-direction: column; gap: .55rem; }
.toastx {
    background: var(--ink); color: #fff; padding: .75rem 1.05rem; border-radius: 12px;
    box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 500;
    opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s;
    display: flex; align-items: center; gap: .5rem;
}
.toastx::before { content: "✓"; font-weight: 700; }
.toastx.show { opacity: 1; transform: translateY(0); }
.toastx.err { background: var(--danger); }
.toastx.err::before { content: "!"; }
.toastx.ok { background: var(--success); }

/* ---------- Checklist (liste) ---------- */
.chk-item {
    display: flex; align-items: center; gap: .6rem; padding: .4rem .1rem; border-bottom: 1px solid var(--line);
}
.chk-item:last-child { border-bottom: none; }
.chk-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex: 0 0 auto; }
.chk-item .chk-text { flex: 1; font-size: .92rem; color: var(--ink); }
.chk-item.done .chk-text { text-decoration: line-through; color: var(--muted); }
.chk-item .chk-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .95rem; padding: 2px 6px; border-radius: 6px; }
.chk-item .chk-del:hover { background: #fef2f2; color: var(--danger); }
.chk-empty { color: var(--muted); font-size: .85rem; padding: .3rem 0; }

/* ---------- Ekler (attachments) ---------- */
.attach-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.attach-item {
    position: relative; width: 84px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
    background: #fff; box-shadow: var(--shadow-xs);
}
.attach-item img { width: 84px; height: 70px; object-fit: cover; display: block; }
.attach-item .att-pdf {
    width: 84px; height: 70px; display: grid; place-items: center; font-size: 1.6rem; background: #fef2f2; color: var(--danger);
}
.attach-item .att-name { font-size: .62rem; padding: 3px 5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-item .att-del {
    position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: none;
    background: rgba(17,24,39,.65); color: #fff; font-size: .7rem; cursor: pointer; display: grid; place-items: center; line-height: 1;
}
.attach-item .att-del:hover { background: var(--danger); }
.attach-item a { text-decoration: none; }
/* Ek dosya aksiyon çubuğu: Aç / Kaydet / Yazdır / Sil */
.attach-item .att-actions { display: flex; gap: 2px; padding: 3px 4px 4px; border-top: 1px solid var(--line); }
.attach-item .att-actions .att-act {
    flex: 1; border: none; background: var(--brand-soft); color: var(--ink-soft);
    border-radius: 6px; font-size: .72rem; padding: 3px 0; cursor: pointer; line-height: 1;
}
.attach-item .att-actions .att-act:hover { background: var(--brand); color: #fff; }
/* Sil butonu artık aksiyon çubuğunda — üstteki absolute konumu iptal et */
.attach-item .att-actions .att-del { position: static; top: auto; right: auto; width: auto; height: auto; border-radius: 6px; background: var(--brand-soft); color: var(--ink-soft); }
.attach-item .att-actions .att-del:hover { background: var(--danger); color: #fff; }

/* ---------- Rutin: haftalık gün seçimi ---------- */
.rday-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.rday {
    width: 38px; height: 34px; border: 1px solid var(--line-2); background: #fff; border-radius: 9px;
    font-size: .78rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: all .12s;
}
.rday:hover { border-color: var(--brand-2); }
.rday.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.recur-badge { font-size: .68rem; }

/* ---------- Footer ---------- */
.app-footer { color: var(--muted); padding: 1.4rem 0; border-top: 1px solid var(--line); margin-top: 2.5rem; font-size: .86rem; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.5rem; padding: 1.4rem 0 1rem; }
@media (max-width: 640px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-brand { font-weight: 800; font-size: 1.1rem; color: var(--ink); display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.footer-brand .brand-badge { width: 28px; height: 28px; font-size: .9rem; }
.footer-tag { color: var(--ink-soft); font-size: .88rem; max-width: 320px; line-height: 1.5; }
.footer-h { font-weight: 700; color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .55rem; }
.footer-cols a { display: block; color: var(--ink-soft); padding: .2rem 0; font-size: .9rem; }
.footer-cols a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); }

/* ---------- Auth (Identity) sayfaları ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 72vh; padding: 1.5rem 0; }
.auth-card {
    width: 100%; max-width: 430px; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 2.25rem 2rem 1.75rem; position: relative; overflow: hidden;
}
.auth-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--brand-2), var(--brand-700));
}
.auth-head { text-align: center; margin-bottom: 1.6rem; }
.auth-badge {
    position: relative;
    width: 58px; height: 58px; margin: 0 auto .9rem; display: grid; place-items: center;
    font-size: 0; border-radius: 18px; color: #fff;
    background: linear-gradient(135deg, var(--brand-2), var(--brand-700));
    box-shadow: 0 8px 20px -8px rgba(79,70,229,.6);
}
/* Anka Ritim logosu (beyaz Anka kuşu) — giriş/kayıt/şifre kartlarındaki rozette */
.auth-badge::after {
    content: ""; position: absolute; inset: 0;
    background: url("../icon-bird.svg") center / 58% no-repeat;
}
.auth-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; color: var(--ink); }
.auth-sub { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.auth-form { margin-bottom: .25rem; }
.auth-form .form-control { padding: .62rem .8rem; }
.auth-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
    border-radius: 10px; padding: .6rem .8rem; font-size: .86rem; margin-bottom: 1rem;
}
.auth-error.validation-summary-valid { display: none; }
.auth-error ul { margin: 0; padding-left: 1.1rem; }
.auth-error ul:empty { display: none; }
.auth-hint { font-size: .78rem; color: var(--muted); margin-top: .4rem; }
.auth-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--ink-2); cursor: pointer; margin: 0; }
.auth-check .form-check-input { margin: 0; }
.auth-link { font-size: .88rem; font-weight: 600; color: var(--brand); }
.auth-foot {
    text-align: center; margin-top: 1.4rem; padding-top: 1.2rem;
    border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-soft);
}
.auth-foot a { font-weight: 600; }

/* ---------- Hesap ayarları (profil / şifre) ---------- */
.settings-head { margin-bottom: 1.5rem; }
.settings-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .2rem; }
.settings-sub { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.settings-shell { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 700px) { .settings-shell { grid-template-columns: 1fr; } }
.settings-nav { padding: .7rem; }
.settings-links { display: flex; flex-direction: column; gap: .25rem; }
.settings-link {
    display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 10px;
    color: var(--ink-2); font-weight: 500; font-size: .93rem; text-decoration: none; transition: background .12s, color .12s;
}
.settings-link .ico { font-size: 1rem; }
.settings-link:hover { background: var(--brand-soft); color: var(--brand-700); }
.settings-link.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.settings-content { padding: 1.6rem 1.75rem; }
.settings-content-head { margin-bottom: 1.25rem; }
.settings-h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: .15rem; }
.settings-desc { color: var(--ink-soft); font-size: .88rem; margin: 0; }
.settings-form { max-width: 440px; }
.settings-form .btn-brand { padding-left: 1.6rem; padding-right: 1.6rem; }

.status-msg {
    display: flex; align-items: center; gap: .55rem; padding: .7rem .9rem; border-radius: 12px;
    font-size: .9rem; font-weight: 500; margin-bottom: 1.25rem;
}
.status-msg .status-ic { font-size: 1rem; }
.status-msg.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.status-msg.danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* ---------- Erişilebilirlik: klavye odağı ---------- */
.cal-nav button:focus-visible,
.icon-btn:focus-visible,
.cell-num:focus-visible,
.toggle-all:focus-visible,
.btn-brand:focus-visible,
.btn-ghost:focus-visible,
.swatch:focus-visible {
    outline: 2px solid var(--brand-2); outline-offset: 2px;
}
.cat-item:focus-visible { outline: 2px solid var(--brand-2); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    .hero { padding: 2.5rem 1.5rem; border-radius: 20px; }
    .cal-panel { padding: 1rem; }
    .cal-title { font-size: 1.25rem; }
    .cal-toolbar { margin-bottom: .9rem; }
    /* Nokta gösterimi için hücreler daha kompakt */
    .cal-cell { min-height: 62px; padding: .3rem .25rem; align-items: center; }
    .cell-num { width: 26px; height: 26px; font-size: .82rem; align-self: center; }
    .cal-week-head > div { padding: .5rem .2rem; font-size: .62rem; }
    #evtPopover { display: none !important; }        /* dokunmatik: hover popover kapalı */
    .fab { display: grid; place-items: center; }     /* yüzen + butonu görünür */
    /* Kategori paneli mobilde biraz daha sıkı */
    .cat-item { padding: .6rem .55rem; }
    .app-footer { margin-top: 1.5rem; }
}

/* ===========================================================
   Koyu tema (dark mode) — html[data-theme="dark"]
   =========================================================== */
:root[data-theme="dark"] {
    --brand-soft: #1e2333;
    --brand-soft-2: #242a44;
    --ink: #e5e7eb;
    --ink-2: #cbd5e1;
    --ink-soft: #9aa4b2;
    --muted: #7b8494;
    --line: #262b35;
    --line-2: #333a46;
    --bg: #0f1116;
    --card: #171a21;
    --shadow: 0 12px 28px -14px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 48px -20px rgba(0,0,0,.7);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
}
/* Bootstrap ve sabit renkli yüzeyleri koyulaştır */
:root[data-theme="dark"] .card-soft,
:root[data-theme="dark"] .modal-content,
:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .chart-card,
:root[data-theme="dark"] .guide-sec,
:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .agenda-evt,
:root[data-theme="dark"] .note-item,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .attach-item,
:root[data-theme="dark"] .step-card,
:root[data-theme="dark"] .bucket-count { background: var(--card); border-color: var(--line); color: var(--ink); }
/* İndirme sayfası: kurulum adımları metni + uyarı kutusu koyu temada okunur olsun */
:root[data-theme="dark"] .step .tx { color: var(--ink); }
:root[data-theme="dark"] .warn { background: #2a2115; border-color: #4a3a20; color: #fcd9a8; }
:root[data-theme="dark"] .app-nav { background: rgba(23,26,33,.85); border-color: var(--line); }
:root[data-theme="dark"] .cal-cell:hover,
:root[data-theme="dark"] .cal-cell.weekend,
:root[data-theme="dark"] .cal-cell.other-month { background: #12151b; }
:root[data-theme="dark"] .cal-cell.other-month .cell-num { color: var(--muted); }
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] .rday,
:root[data-theme="dark"] .cal-search input,
:root[data-theme="dark"] .view-switch { background: #1f242e; border-color: var(--line-2); color: var(--ink); }
:root[data-theme="dark"] .form-control::placeholder { color: var(--muted); }
:root[data-theme="dark"] .view-switch button.active { background: #2b3242; color: #c7d2fe; }
:root[data-theme="dark"] .evt.deadline-chip { background: #1f242e; color: var(--ink); }
:root[data-theme="dark"] .je-thumb, :root[data-theme="dark"] .je-thumb-ph,
:root[data-theme="dark"] .att-thumb { background: #232833; }
:root[data-theme="dark"] .pj-progress-bar, :root[data-theme="dark"] .hbar-track { background: #262b35; }
:root[data-theme="dark"] .status-msg.success { background: #0e2a20; border-color: #14503c; color: #6ee7b7; }
:root[data-theme="dark"] .auth-error { background: #2a1416; border-color: #5b1f24; color: #fca5a5; }
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
:root[data-theme="dark"] .task-add-btn:hover, :root[data-theme="dark"] .bucket-count { background: #232833; }
:root[data-theme="dark"] .modal-content input.form-control,
:root[data-theme="dark"] textarea.form-control { background: #1f242e; }
/* Tema düğmesi */
.theme-toggle { background: transparent; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; padding: .2rem .4rem; border-radius: 8px; }
.theme-toggle:hover { background: var(--brand-soft); }

/* ===========================================================
   MODERN REFRESH (2026-07-20) — sade, ferah, profesyonel
   Sona eklenmiştir; üstteki kuralları bilinçli olarak geçersiz kılar.
   =========================================================== */
:root {
    --bg: #f5f6f9;
    --card: #ffffff;
    --line: #edeef2;
    --line-2: #e5e7ec;
    --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 2px 6px rgba(16,24,40,.05);
    --shadow: 0 12px 32px -14px rgba(16,24,40,.20);
    --shadow-lg: 0 28px 60px -24px rgba(16,24,40,.30);
}

/* Ferah, hafif renkli arka plan */
body {
    background:
        radial-gradient(1100px 520px at 100% -8%, rgba(99,102,241,.07), transparent 60%),
        radial-gradient(900px 500px at -5% 110%, rgba(124,58,237,.05), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------- Navbar: sade ve ferah ---------- */
.app-nav {
    padding-top: .5rem; padding-bottom: .5rem;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.app-nav .navbar-nav { align-items: center; gap: .12rem; }
.app-nav .navbar-brand { font-size: 1.16rem; font-weight: 800; letter-spacing: -.03em; }
.app-nav .nav-link {
    font-size: .9rem; font-weight: 500;
    padding: .4rem .68rem !important; border-radius: 10px;
    color: var(--ink-soft) !important;
    transition: background .15s, color .15s;
}
.app-nav .nav-link:hover { background: var(--brand-soft); color: var(--brand-700) !important; }
.app-nav .nav-link.active { background: var(--brand-soft); color: var(--brand) !important; font-weight: 600; }
.brand-badge { border-radius: 11px; box-shadow: 0 8px 16px -7px rgba(79,70,229,.65); }

/* Hesap çipi + çıkış */
#profileLink {
    background: var(--brand-soft); color: var(--brand-700) !important;
    border-radius: 999px; padding: .34rem .82rem !important; font-weight: 600;
}
#profileLink:hover { background: var(--brand-soft-2); color: var(--brand-700) !important; }
#logoutLink { color: var(--muted) !important; }
#logoutLink:hover { background: #fef2f2; color: var(--danger) !important; }

/* Zil + tema düğmeleri navbar içinde hizalı ve yumuşak */
.app-nav .notif-btn, .app-nav .theme-toggle { border-radius: 10px !important; padding: .28rem .42rem !important; }
.app-nav .notif-btn:hover, .app-nav .theme-toggle:hover { background: var(--brand-soft); }

/* ---------- Kartlar ---------- */
.card-soft {
    border-radius: 18px; border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

/* ---------- Butonlar ---------- */
.btn-brand {
    border-radius: 12px; padding: .6rem 1.2rem;
    box-shadow: 0 10px 20px -10px rgba(79,70,229,.65), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-brand:hover { box-shadow: 0 14px 26px -10px rgba(79,70,229,.7); }
.btn-ghost { border-radius: 12px; }

/* ---------- Proje detay sekmeleri: segment (pill) ---------- */
.pd-tabs {
    display: inline-flex; gap: .25rem; border-bottom: none;
    background: var(--brand-soft); padding: .3rem; border-radius: 14px;
    max-width: 100%; overflow-x: auto;
}
.pd-tab {
    border-bottom: none !important; margin-bottom: 0;
    border-radius: 10px; padding: .5rem .95rem; color: var(--ink-soft);
    transition: background .15s, color .15s, box-shadow .15s;
}
.pd-tab:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.pd-tab.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-xs); }

/* ---------- Rozet / boş durum / form ---------- */
.status-badge { padding: 3px 11px; font-size: .7rem; }
.empty-hint { color: var(--muted); font-size: .88rem; padding: 2rem 1rem; }
.form-control, .form-select { border-radius: 12px; padding: .55rem .8rem; }
.settings-title { letter-spacing: -.03em; }

/* ---------- Koyu tema uyumları (yeni öğeler) ---------- */
:root[data-theme="dark"] body {
    background:
        radial-gradient(1100px 520px at 100% -8%, rgba(99,102,241,.10), transparent 60%),
        var(--bg);
}
:root[data-theme="dark"] .app-nav .nav-link:hover,
:root[data-theme="dark"] .app-nav .nav-link.active,
:root[data-theme="dark"] #profileLink { background: rgba(99,102,241,.20); color: #c7d2fe !important; }
:root[data-theme="dark"] #profileLink:hover { background: rgba(99,102,241,.30); color: #dbe1ff !important; }
:root[data-theme="dark"] #logoutLink:hover { background: rgba(225,29,72,.16); color: #fca5a5 !important; }
:root[data-theme="dark"] .app-nav .notif-btn:hover,
:root[data-theme="dark"] .app-nav .theme-toggle:hover { background: rgba(99,102,241,.20); }
:root[data-theme="dark"] .pd-tabs { background: #1b1f27; }
:root[data-theme="dark"] .pd-tab:hover { background: rgba(255,255,255,.05); }
:root[data-theme="dark"] .pd-tab.active { background: #2b3242; color: #c7d2fe; }

/* ===========================================================
   ETKİLEŞİM CİLASI (2026-07-20) — dinamik & erişilebilir his
   =========================================================== */
/* Tıklanabilir kartlar: imleç + hover kalkışı + yumuşak geçiş */
.project-card, .goal-card, .agenda-evt, .note-item, .task-card {
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.project-card:hover, .goal-card:hover, .agenda-evt:hover, .note-item:hover, .task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--brand-soft-2);
}
:root[data-theme="dark"] .project-card:hover,
:root[data-theme="dark"] .goal-card:hover,
:root[data-theme="dark"] .agenda-evt:hover,
:root[data-theme="dark"] .note-item:hover,
:root[data-theme="dark"] .task-card:hover { border-color: rgba(99,102,241,.4); }

/* İstatistik/sayı kartları hafif canlansın (tıklanmıyorsa imleç yok) */
.stat-card { transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Yumuşak sayfa girişi — ana içerik hafifçe belirir (navbar hariç) */
@keyframes ankaRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.container.mt-4, .container.my-4, .container.mt-3, .container.py-4, .container.py-5, main.container {
    animation: ankaRise .4s ease both;
}
@media (prefers-reduced-motion: reduce) {
    .container.mt-4, .container.my-4, .container.mt-3, .container.py-4, .container.py-5, main.container { animation: none; }
}

/* Birincil aksiyon butonu tam-genişlik olduğunda daha davetkâr */
.btn-brand:active { transform: translateY(1px); }

/* Boş durumları biraz daha yumuşak ortala */
.empty-hint { line-height: 1.6; }

/* ---------- Marka rozeti: Anka kuşu ikonu (📅 emojisi yerine) ---------- */
.brand-badge { position: relative; font-size: 0 !important; }
.brand-badge::after {
    content: ""; position: absolute; inset: 0;
    background: url("../icon-bird.svg") center / 64% no-repeat;
}

/* ---------- Profil sayfası ---------- */
.profile-hero-row { display: flex; align-items: center; gap: 1.1rem; }
.avatar-wrap { position: relative; flex: 0 0 auto; }
.avatar-lg {
    width: 84px; height: 84px; border-radius: 50%;
    display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand-2), var(--brand-700));
    box-shadow: var(--shadow-sm); overflow: hidden; user-select: none;
}
.avatar-img { object-fit: cover; }
.avatar-edit {
    position: absolute; right: -2px; bottom: -2px;
    width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card);
    background: var(--brand); color: #fff; font-size: .85rem; cursor: pointer;
    display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.avatar-edit:hover { background: var(--brand-700); }
.profile-name-line { font-size: 1.25rem; letter-spacing: -.02em; }
.profile-bio-line { color: var(--ink-soft); margin-top: 2px; }
.btn-sm.btn-ghost, .btn-ghost.btn-sm { padding: .32rem .7rem; font-size: .84rem; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.swatch {
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer; border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s, border-color .12s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.swatch.custom { display: grid; place-items: center; font-size: 1rem; background: var(--card); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line-2); position: relative; }
.swatch.custom input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Hukuki belgeler ---------- */
.legal-doc { padding-bottom: 3rem; line-height: 1.7; color: var(--ink-2); }
.legal-doc h1 { margin-bottom: .3rem; }
.legal-doc h2 { font-size: 1.12rem; font-weight: 700; margin: 1.6rem 0 .5rem; letter-spacing: -.01em; color: var(--ink); }
.legal-doc ul { padding-left: 1.2rem; }
.legal-doc li { margin-bottom: .35rem; }
.legal-note {
    background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
    border-radius: 12px; padding: .7rem 1rem; font-size: .9rem; margin: 1rem 0 1.4rem;
}
.legal-links { font-size: .92rem; }
.legal-links a { color: var(--ink-soft); }
.legal-links a:hover { color: var(--brand); }
:root[data-theme="dark"] .legal-note { background: #2a1c0e; border-color: #7c3d12; color: #fdba74; }

/* Navbar hesap avatarı */
.nav-avatar {
    width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
    font-size: .72rem; font-weight: 700; color: #fff; overflow: hidden; vertical-align: middle;
    background: linear-gradient(135deg, var(--brand-2), var(--brand-700)); margin-right: 6px;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

:root[data-theme="dark"] .swatch.active { border-color: #fff; }

/* ===========================================================
   PREMIUM KATMAN (2026-07-21) — akıcılık, cila, mikro-etkileşim
   Tüm sayfalarda ortak; en sona eklenmiştir.
   =========================================================== */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: transparent; }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); color: var(--brand-700); }
:root[data-theme="dark"] ::selection { color: #e9e5ff; }

/* İnce, temaya duyarlı kaydırma çubuğu */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Premium odak halkası (yalnız klavye) */
a:focus-visible, button:focus-visible, .cal-cell:focus-visible, [role="button"]:focus-visible, [tabindex]:focus-visible {
    outline: none; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brand-2); border-radius: 12px;
}

/* Yumuşak tema geçişi (üst yüzeyler) */
body, .card-soft, .dcard, .app-nav, .dash-sidebar, .modal-content, .cal-grid,
.hb-card, .hb-sum-card, .nf-item, .motiv-hero {
    transition: background-color .35s ease, border-color .35s ease, color .25s ease, box-shadow .25s ease;
}

/* Buton mikro-etkileşim + parıltı süpürmesi */
.btn-brand, .btn-ghost, .plan-btn, .mh-btn, .ui-btn, .cal-chip, .dash-icon-btn, .pd-tab, .view-switch button, .seg button {
    transition: transform .14s cubic-bezier(.2,.8,.3,1.3), box-shadow .2s ease, filter .18s, background .18s, color .18s, border-color .18s;
}
.btn-brand:active, .btn-ghost:active, .plan-btn:active, .ui-btn:active, .cal-chip:active, .dash-icon-btn:active { transform: translateY(1px) scale(.985); }
.dash-icon-btn:hover { transform: translateY(-1px); }
.btn-brand, .plan-btn { position: relative; overflow: hidden; }
.btn-brand::after, .plan-btn::after {
    content: ""; position: absolute; top: 0; left: -130%; width: 55%; height: 100%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-18deg); transition: left .65s ease;
}
.btn-brand:hover::after, .plan-btn:hover::after { left: 150%; }

/* Kart yükselme cilası (genel — daha akıcı yay) */
.dcard, .hb-card, .hb-sum-card, .nf-item, .stat-card, .chart-card, .guide-sec {
    transition: transform .18s cubic-bezier(.2,.8,.3,1.25), box-shadow .22s ease, border-color .18s ease;
}
.dcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cal-grid { transition: box-shadow .3s ease; }

/* Giriş animasyonları KALDIRILDI.
   Neden: transform/opacity + `both` dolgusu, sayfa arka plan sekmesinde
   yüklenip animasyon duraklayınca başlangıç (kaymış/gizli) durumunda takılıp
   DÜZENİ BOZUYORDU (ör. sol menü 14px sola kayıyordu). Premium his; hover,
   buton, modal ve tema geçişleriyle korunuyor. */
.dash-main > *, .dash-sidebar, .hb-list-grid > *, .nf-list > *,
.container.mt-4, .container.my-4, .container.mt-3, .container.py-4, .container.py-5, main.container {
    animation: none !important;
}

/* Premium modallar (Bootstrap) — yumuşak yay + bulanık arka plan */
.modal-content { border: none !important; border-radius: 22px; box-shadow: 0 44px 90px -34px rgba(16,24,40,.6); overflow: hidden; }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-backdrop.show { opacity: .5; }
@supports (backdrop-filter: blur(4px)) { .modal-backdrop.show { backdrop-filter: blur(4px); } }
.modal.fade .modal-dialog { transform: translateY(26px) scale(.965); transition: transform .34s cubic-bezier(.2,.9,.3,1.28), opacity .3s; }
.modal.show .modal-dialog { transform: none; }

/* Sidebar aktif öğe — hafif premium ışıma */
.side-nav a.active { box-shadow: inset 0 0 0 1px var(--brand-soft-2), 0 6px 18px -10px rgba(79,70,229,.55); }

/* Yükleniyor durumu — nazik nabız */
.empty-hint.loading, .empty-hint[data-loading] { animation: premPulse 1.5s ease-in-out infinite; }
@keyframes premPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* Giriş/link imleç akıcılığı */
a { transition: color .15s ease; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn-brand::after, .plan-btn::after { display: none; }
}
