/* Flow – temel stil. Build adımı yok; düz CSS. */
:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --border: #e6e9ef;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #1e3a8a;
    --primary-soft: #e8edf8;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04);
    --blue: #2563eb;   --blue-bg: #eef3ff;
    --green: #16a34a;  --green-bg: #ecfdf3;
    --amber: #d97706;  --amber-bg: #fff7e6;
    --red: #dc2626;    --red-bg: #fef1f1;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }

/* Üst menü */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1440px; margin: 0 auto; height: 60px; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 15px; }
.mainnav { display: flex; gap: 4px; flex: 1; justify-content: center; min-width: 0; }
.mainnav.compact span { display: none; }
.nav-group summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 8px; font-weight: 500; color: #334155; white-space: nowrap; cursor: pointer; }
.nav-group summary:hover { background: var(--bg); }
.nav-group summary.active { background: var(--primary-soft); color: var(--primary); }
.nav-group .dropdown-menu { left: 0; right: auto; width: 210px; z-index: 40; }
.dropdown-menu > a.active { background: var(--primary-soft); color: var(--primary); }
.mainnav a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; font-weight: 500; color: #334155; white-space: nowrap; }
.mainnav a:hover { background: var(--bg); }
.mainnav a.active { background: var(--primary-soft); color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: #334155; }
.icon-btn:hover { background: var(--bg); }
.icon-btn-sm { width: 28px; height: 28px; margin-left: auto; color: var(--muted); }

/* Kullanıcı menüsü */
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.avatar-btn { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 6px; }
.dropdown-head { padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.dropdown-head span { color: var(--muted); font-size: 12px; }
.dropdown-menu > a, .dropdown-menu form > button[type=submit] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; color: #334155; text-align: left; }
.dropdown-menu > a:hover, .dropdown-menu form > button[type=submit]:hover { background: var(--bg); }

.lang-switch { display: flex; align-items: center; gap: 4px; padding: 6px 10px; color: var(--muted); }
.lang-switch .icon { margin-right: 6px; }
.lang-switch button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lang-switch button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.lang-switch-center { justify-content: center; margin-top: 18px; }
.auth-forgot { align-self: flex-end; font-size: 13px; margin-top: -6px; }
.auth-back { align-self: center; font-size: 13px; }
.auth-lead { margin: -8px 0 18px; }

/* Sayfa */
.page { max-width: 1440px; margin: 0 auto; padding: 28px 20px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }

.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1 { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .grid-4, .grid-3 { grid-template-columns: 1fr; } .mainnav span { display: none; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Sayaç kartları */
.stat { display: flex; align-items: center; gap: 14px; padding: 20px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.stat-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.stat-text strong { font-weight: 600; }
.stat-text span { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 28px; font-weight: 700; }
.tone-blue  { background: var(--blue-bg);  color: var(--blue); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-red   { background: var(--red-bg);   color: var(--red); }

/* Widget kartları */
.widget { min-height: 260px; display: flex; flex-direction: column; }
.widget-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.widget-head h2 { font-size: 15px; font-weight: 600; }
.widget-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.widget-icon .icon { width: 16px; height: 16px; }
.empty { flex: 1; display: grid; place-items: center; color: var(--muted); padding: 24px; }

/* Butonlar ve formlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-weight: 500; font-size: 13px; }
.field input, .field select, .field textarea {
    height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px;
    font: inherit; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: var(--green-bg); color: #166534; }
.alert-error { background: var(--red-bg); color: #991b1b; }

/* Giriş ekranı */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; margin-bottom: 22px; }
.auth-card h1 { font-size: 20px; margin-bottom: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.error-code { font-size: 56px; font-weight: 700; color: var(--primary); }

/* Ayarlar: yan menü */
.with-subnav { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .with-subnav { grid-template-columns: 1fr; } }
.subnav { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; }
.subnav-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #334155; font-weight: 500; }
.subnav a:hover { background: var(--bg); }
.subnav a.active { background: var(--primary-soft); color: var(--primary); }
.subnav .icon { width: 16px; height: 16px; }
.back-link { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.back-link:hover { color: var(--primary); }

/* Tablo */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.row-muted td { opacity: .55; }
.cell-main { display: flex; flex-direction: column; gap: 2px; }
.cell-main strong { font-weight: 600; }
.cell-main span { color: var(--muted); font-size: 12px; }
a.cell-main:hover strong { color: var(--primary); }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions form { display: inline; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-gray  { background: #f1f5f9; color: var(--muted); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red   { background: var(--red-bg); color: var(--red); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }

/* Form kartı */
.form-card { padding: 24px; }
.form-card fieldset { border: 0; padding: 0; margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.field-error { color: var(--red); font-size: 12px; }
.field small { font-size: 12px; }
.input-group { display: flex; }
.input-group input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group select { width: 90px; border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.field input[type=file] { height: auto; padding: 8px; }
.color-input { width: 80px; padding: 4px !important; cursor: pointer; }
.logo-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.logo-preview img { max-height: 48px; max-width: 160px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: #fff; }

.section-title { font-size: 15px; font-weight: 600; margin: 28px 0 14px; }
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .perm-grid { grid-template-columns: 1fr 1fr; } }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.alert-info { background: var(--primary-soft); color: var(--primary); }
.brand-logo { max-height: 32px; max-width: 140px; }

/* Liste araç çubuğu */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; background: var(--bg); border-radius: 9px; padding: 3px; }
.tabs a { padding: 6px 12px; border-radius: 7px; font-weight: 500; color: var(--muted); font-size: 13px; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toolbar-select { height: 36px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; font: inherit; background: var(--surface); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; height: 36px; width: 320px; max-width: 100%; color: var(--muted); }
.search input { border: 0; outline: 0; font: inherit; flex: 1; min-width: 0; background: transparent; color: var(--text); }
.search .icon { width: 16px; height: 16px; }
.empty-lg { padding: 56px 24px; }
.row-link { cursor: pointer; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 7px; border-radius: 6px; }
.code-lg { font-size: 13px; padding: 4px 9px; }
.badge-blue { background: var(--blue-bg); color: var(--blue); font-size: 11px; padding: 1px 7px; }
.badge-blue::before { display: none; }
.link { color: var(--primary); }
.small { font-size: 12px; }

/* Detay sayfası */
.title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.title-line h1 { margin-bottom: 0; }
.head-actions { display: flex; gap: 8px; }
.grid-3-1 { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 1000px) { .grid-3-1 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.widget-auto { min-height: 0; }
.widget-auto .empty { padding: 28px; }
.card-body { padding: 16px; line-height: 1.55; }
.dl { margin: 0; padding: 6px 16px 10px; }
.dl-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.dl-row:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; font-weight: 500; }

/* Çok bölümlü form */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; }
.subsection-title { font-size: 14px; font-weight: 600; margin: 24px 0 4px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .form-grid-3 { grid-template-columns: 1fr; } }
.field-wide { grid-column: 1 / -1; }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.input-addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: 0; border-radius: 0 9px 9px 0; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; }
.segmented { display: inline-flex; background: var(--bg); border-radius: 9px; padding: 3px; margin-bottom: 18px; }
.segmented input { display: none; }
.segmented span { display: block; padding: 7px 16px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
[hidden] { display: none !important; }

.repeater { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.repeater-head, .repeater-row { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1fr 56px 32px; gap: 8px; align-items: start; }
.repeater-head { font-size: 12px; color: var(--muted); font-weight: 600; }
.repeater-head span:nth-child(5) { text-align: center; }
.repeater-row input:not([type=radio]) { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.repeater-row .primary-radio { justify-self: center; margin-top: 11px; width: 16px; height: 16px; accent-color: var(--primary); }
@media (max-width: 800px) { .repeater-head { display: none; } .repeater-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--border); } }
.table-compact td, .table-compact th { padding: 8px 10px; }
.table-compact .input-group input { height: 36px; }

/* Projeler */
.head-right { margin-left: auto; }
.text-strong { color: var(--text); font-weight: 600; }
.align-right { align-items: flex-end; text-align: right; }
.text-warn { color: var(--amber); font-weight: 500; }
.check-input { width: 16px; height: 16px; accent-color: var(--primary); }
.dl dt.cell-main span { font-size: 12px; }

/* Bildirimler (toast) */
.toasts { position: fixed; top: 72px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 32px); }
.toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 16px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); animation: toast-in .25s ease-out; }
.toast-out { animation: toast-out .25s ease-in forwards; }
.toast-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.toast-success .toast-icon { background: var(--green); }
.toast-error .toast-icon { background: var(--red); }
.toast-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast-body strong { font-weight: 600; }
.toast-body span { color: var(--muted); font-size: 13px; }
.toast-close { border: 0; background: var(--bg); color: var(--muted); width: 26px; height: 26px; border-radius: 7px; font-size: 12px; flex-shrink: 0; }
.toast-close:hover { color: var(--text); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; animation: toast-bar 4s linear forwards; }
.toast-success .toast-bar { background: var(--green); }
.toast-error .toast-bar { background: var(--red); }
.toast-paused .toast-bar { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Grup içindeki alanlar (tutar + para birimi) standart alanlarla aynı görünür */
.input-group input, .input-group select {
    height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px;
    font: inherit; background: var(--surface); color: var(--text); outline: none;
}
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group input:focus, .input-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-addon { height: 40px; }
.table-compact .input-group input, .table-compact .input-addon { height: 40px; }

/* Zaman */
.time-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .time-layout { grid-template-columns: 1fr; } }
.time-layout > .stack:first-child { position: sticky; top: 80px; }
@media (max-width: 1000px) { .time-layout > .stack:first-child { position: static; } }
.time-form .form-grid { gap: 14px; }
.form-actions-tight { margin-top: 4px; padding-top: 0; border-top: 0; }
.week-nav { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.week-nav .icon-btn { font-size: 20px; border: 1px solid var(--border); background: var(--surface); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr) 1.4fr; overflow: hidden; }
.week-day, .week-total { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-right: 1px solid var(--border); }
.week-day span, .week-total span { font-size: 12px; color: var(--muted); }
.week-day strong { font-size: 16px; }
.week-day:hover { background: var(--bg); }
.week-day.today { box-shadow: inset 0 -3px 0 var(--primary); }
.week-day.empty-day strong { color: #cbd5e1; }
.week-total { border-right: 0; background: var(--primary-soft); }
.week-total strong { font-size: 20px; color: var(--primary); }
.week-total small { color: var(--muted); font-size: 11px; }
@media (max-width: 700px) { .week-strip { grid-template-columns: repeat(4, 1fr); } }
.day-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.day-total { margin-left: auto; font-weight: 700; }
.entry { display: flex; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.entry:last-child { border-bottom: 0; }
.entry-main { flex: 1; min-width: 0; }
.entry-project { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.entry-desc { margin: 6px 0 0; line-height: 1.5; }
.entry-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.entry-time { font-size: 16px; }
.entry-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.entry:hover .entry-actions { opacity: 1; }
@media (hover: none) { .entry-actions { opacity: 1; } }
.narrow { max-width: 640px; }
.timer-card .card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.timer-card .form { gap: 10px; }
.select-plain, .input-plain { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: var(--surface); width: 100%; }
.select-plain:focus, .input-plain:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.timer-card.running { border-color: var(--green); }
.timer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; flex-shrink: 0; }
.timer-clock { margin-left: auto; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; gap: 8px; }
.timer-actions .btn-primary { flex: 1; }
@keyframes pulse { 50% { opacity: .35; } }

/* Proje zaman özeti ve pano */
.totals-row { display: flex; gap: 28px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.totals-row > div { display: flex; flex-direction: column; gap: 2px; }
.totals-row span { font-size: 12px; color: var(--muted); }
.totals-row strong { font-size: 18px; }
.meter { display: block; width: 120px; height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.meter span { display: block; height: 100%; background: var(--green); }
.meter .meter-warn { background: var(--amber); }
.nowrap { white-space: nowrap; }
.widget-link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--primary); }
.widget-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.widget-row:last-child { border-bottom: 0; }
.widget-row:hover { background: #fafbfc; }

/* Izgara hücreleri içeriğe göre taşmasın; alanlar hücreyi doldursun */
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-grid > *, .field { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.input-group input { width: auto; flex: 1; }

/* Faturalama */
.num { text-align: right; white-space: nowrap; }
.badge-blue-dot { background: var(--blue-bg); color: var(--blue); }
.st-lines .group-row td { background: var(--bg); font-weight: 600; font-size: 13px; padding: 9px 16px; }
.st-lines .info-row td { color: var(--muted); }
.st-lines td { vertical-align: top; }
.cell-input { width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 6px 8px; font: inherit; background: transparent; color: inherit; resize: none; line-height: 1.45; }
.cell-input:hover { border-color: var(--border); }
.cell-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.cell-input.num { text-align: right; }
.cell-missing { border-color: var(--amber) !important; background: var(--amber-bg); }
.st-footer { display: grid; grid-template-columns: 1fr 340px; gap: 24px; padding: 18px 16px; border-top: 1px solid var(--border); }
@media (max-width: 800px) { .st-footer { grid-template-columns: 1fr; } }
.st-notes { display: flex; flex-direction: column; gap: 12px; }
.st-totals { width: 100%; border-collapse: collapse; align-self: start; }
.st-totals td { padding: 7px 0; }
.st-totals .grand td { border-top: 2px solid var(--text); font-size: 17px; font-weight: 700; padding-top: 10px; }
.st-totals .balance td { font-weight: 700; color: var(--primary); }
.pct-input { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; color: var(--muted); }
.pct-input input { width: 54px; height: 30px; border: 1px solid var(--border); border-radius: 7px; padding: 0 6px; font: inherit; text-align: right; }
.pct-input input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.st-actions { margin: 0; padding: 16px; justify-content: space-between; }
.add-line { display: grid; grid-template-columns: 130px 1fr 1.4fr 170px auto; gap: 8px; }
@media (max-width: 1100px) { .add-line { grid-template-columns: 1fr 1fr; } }
.invoice-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.payment-amount { display: flex; align-items: center; gap: 4px; }
.payment-amount form { display: inline; }
.payment-form { border-top: 1px solid var(--border); }
.steps { margin: 0; padding: 14px 16px 14px 34px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; color: #334155; }

/* Portal */
.page-narrow { max-width: 1100px; }
.portal-tag { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); padding: 4px 10px; border-radius: 99px; }
.portal-user strong { font-size: 13px; }
.portal-user span { font-size: 12px; color: var(--muted); }
.portal-balances { margin-bottom: 16px; }
.stat-money { font-size: 22px; white-space: nowrap; }
.text-danger { color: var(--red); }
.portal-summary { border-collapse: separate; border-spacing: 0; padding: 10px 22px 16px; }
.portal-summary td { padding: 9px 0; }
.bank-text { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.invite-box { background: var(--green-bg); border-bottom: 1px solid var(--border); }
.invite-box p { margin: 4px 0 10px; }
.copy-row { display: flex; gap: 8px; }
.portal-invite { border-top: 1px solid var(--border); }
.portal-invite-row { grid-template-columns: 1fr 1fr 1.3fr auto; }
.notice-card { border-color: var(--blue); }
.notice { border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.notice:last-of-type { border-bottom: 0; }
.notice-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.notice-actions { display: flex; gap: 8px; margin-top: 6px; }
.notice-actions .input-group { flex: 1; }
.reject-box summary { cursor: pointer; color: var(--red); }
.reject-box .form { margin-top: 8px; gap: 8px; }
.portal-project { align-items: center; }
.portal-project-side { display: flex; align-items: center; gap: 16px; }
.portal-project-side .cell-main span { font-size: 11px; }
.portal-meter .cell-main { align-items: flex-start; text-align: left; }
.portal-meter .meter { width: 100%; }

/* Raporlar */
.report-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.report-tabs a { padding: 10px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.report-tabs a:hover { color: var(--text); }
.report-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.custom-range { display: inline-flex; align-items: center; gap: 6px; }
.period-label { margin-left: 4px; }
.stat-wide { grid-column: span 2; }
@media (max-width: 1100px) { .stat-wide { grid-column: auto; } }
.stat-values { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 18px; }
.hbar { height: 10px; background: transparent; border-radius: 99px; }
.hbar-total { display: block; height: 100%; background: #dbe3ef; border-radius: 99px; overflow: hidden; min-width: 4px; }
.hbar-billable { display: block; height: 100%; background: var(--primary); }
.report-legend { display: flex; gap: 18px; padding: 12px 16px; border-top: 1px solid var(--border); }
.report-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-billable { background: var(--primary); }
.lg-total { background: #dbe3ef; }
td.strong { font-weight: 700; }
.aging-summary { padding: 18px 20px; margin-bottom: 16px; }
.aging-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.aging-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--bg); }
.aging-bar span { display: block; height: 100%; }
.aging-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.aging-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.aging-legend strong { color: var(--text); margin-left: 4px; }
.ab-current_amount { background: #22c55e; }
.ab-d30 { background: #facc15; }
.ab-d60 { background: #fb923c; }
.ab-d90 { background: #ef4444; }
.ab-d90plus { background: #991b1b; }

/* PWA / mobil */
.icon-preview { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.icon-preview-round { border-radius: 50%; }
.bottomnav { display: none; }
@media (max-width: 760px) {
    .mainnav { display: none; }
    .topbar-inner { gap: 12px; }
    .topbar-actions { margin-left: auto; }
    .topbar-actions .icon-btn[title] { display: none; }
    .page { padding: 18px 14px calc(84px + env(safe-area-inset-bottom)); }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-head h1 { font-size: 21px; }
    .head-actions { flex-wrap: wrap; }
    .bottomnav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: var(--surface); border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 500; }
    .bottomnav a.active { color: var(--primary); }
    .bottomnav .icon { width: 22px; height: 22px; }
    .bottomnav { align-items: center; }
    .bottomnav-menu { flex: 0 0 auto; width: 48px; height: 48px; margin: 0 6px; border: 0; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(15, 23, 42, .18); }
    .bottomnav-menu .icon { width: 24px; height: 24px; }
    /* Geniş tablolar kart içinde yatay kaysın */
    .card > .table, .card > form > .table, .st-lines { display: block; overflow-x: auto; white-space: nowrap; }
    .toolbar { gap: 8px; }
    .search { width: 100%; margin-left: 0; }
    .toasts { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; }
}
@media (display-mode: standalone) {
    body { -webkit-user-select: none; user-select: none; }
    input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
}

/* Belgeler: yükleme düğmesi aynı zamanda sürükle-bırak alanı */
.upload-zone { cursor: pointer; position: relative; }
.upload-zone.is-over { outline: 2px dashed var(--primary); outline-offset: 2px; }
.upload-zone.is-busy { pointer-events: none; opacity: .8; }
.upload-status { font-weight: 400; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-status:empty { display: none; }
.docs-body .cell-main .badge { vertical-align: middle; }

/* Takvim */
.month-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.month-nav strong { min-width: 120px; text-align: center; }
.agenda-day { display: flex; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.agenda-day:last-child { border-bottom: 0; }
.agenda-day.is-past { opacity: .65; }
.agenda-date { width: 44px; flex-shrink: 0; text-align: center; padding-top: 6px; }
.agenda-date strong { display: block; font-size: 20px; line-height: 1; }
.agenda-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.agenda-day.is-today .agenda-date strong { color: var(--primary); }
.agenda-events { flex: 1; min-width: 0; }
.agenda-events .event-row { border: 0; border-radius: 8px; padding: 8px 10px; }
.event-row { position: relative; align-items: center; }
.event-row .event-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--blue); flex-shrink: 0; }
.event-row .cell-main:first-of-type { flex: 1; min-width: 0; }
.event-hearing .event-bar { background: var(--red); }
.event-deadline .event-bar { background: var(--amber); }
.event-meeting .event-bar { background: var(--blue); }
.event-row.is-done { opacity: .55; }
.event-row.is-done strong { text-decoration: line-through; }
.event-row.is-overdue { background: var(--red-bg); }
.event-badge-hearing { background: var(--red-bg); color: var(--red); }
.event-badge-deadline { background: var(--amber-bg); color: var(--amber); }
.event-badge-meeting { background: var(--blue-bg); color: var(--blue); }
.widget-warn { border-color: var(--red); margin-bottom: 16px; }
.widget-warn .widget-icon { color: var(--red); }
.type-tabs { display: inline-flex; margin-bottom: 16px; }
.type-tabs label { padding: 6px 14px; border-radius: 7px; font-weight: 500; color: var(--muted); font-size: 13px; cursor: pointer; }
.type-tabs label.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
@media (max-width: 760px) { .month-nav { margin-left: 0; } .agenda-day { gap: 10px; padding: 10px 12px; } }

/* İzin */
.event-leave .event-bar { background: var(--green); }

/* Mobil menü penceresi (alttan açılır) */
.sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 80vh; padding: 0; border: 0; border-radius: 18px 18px 0 0; background: var(--surface); }
.sheet::backdrop { background: rgba(15, 23, 42, .4); }
.sheet[open] { animation: sheet-up .2s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-body { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 8px; }
.sheet-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 12px 4px 8px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; border-radius: 12px; font-size: 12px; font-weight: 500; color: #334155; text-align: center; }
.sheet-grid a.active { color: var(--primary); }
.sheet-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; }
.sheet-grid a.active .sheet-icon { background: var(--primary-soft); }
/* Genel kurul */
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title-row .card-title { margin: 0; }
.text-success { color: var(--green); }
.dl-compact .dl-row { padding: 5px 0; }
.dl-compact dd { font-weight: 400; }
.gk-body { background: var(--bg); }
.gk-wrap { max-width: 600px; margin: 0 auto; padding: 28px 16px 40px; }
.gk-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.gk-top .lang-switch a { padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.gk-top .lang-switch a.active { background: var(--primary-soft); color: var(--primary); }
.gk-card { overflow: hidden; }
.gk-head { background: var(--primary); color: #fff; padding: 22px 24px; }
.gk-head span { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; opacity: .8; }
.gk-head h1 { margin: 4px 0 8px; font-size: 21px; color: #fff; }
.gk-head p { margin: 0; display: flex; align-items: center; gap: 6px; opacity: .9; font-size: 13px; }
.gk-agenda { padding: 18px 24px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.6; }
.gk-agenda h2 { font-size: 14px; margin: 0 0 6px; }
.gk-form { padding: 20px 24px 24px; }
.gk-step { font-weight: 600; }
.gk-option { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; cursor: pointer; background: var(--surface); }
.gk-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.gk-option input { margin-top: 3px; accent-color: var(--primary); }
.gk-option span { display: flex; flex-direction: column; gap: 2px; }
.gk-option small { color: var(--muted); font-size: 12px; }
.gk-note { font-size: 12px; line-height: 1.55; color: #78350f; background: var(--amber-bg); border-radius: 10px; padding: 12px 14px; }
.gk-note ol { margin: 0; padding-left: 18px; }
.gk-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.gk-message { padding: 36px 28px; text-align: center; }
.gk-message h1 { font-size: 20px; margin: 0 0 8px; }
.gk-check { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green); margin-bottom: 14px; }
.gk-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }
.gk-body [hidden] { display: none !important; }

/* Dosya seçme kutusu (assets/filepick.js) */
.filepick { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--border); border-radius: 10px; background: var(--bg); transition: border-color .15s, background .15s; min-width: 0; }
.filepick:hover, .filepick.is-over { border-color: var(--primary); background: var(--primary-soft); }
.filepick.has-file { border-style: solid; background: var(--surface); }
.filepick > input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.filepick-icon { flex: 0 0 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--primary); border: 1px solid var(--border); }
.filepick-icon svg { width: 18px; height: 18px; }
.filepick-text { display: flex; flex-direction: column; min-width: 0; }
.filepick-text strong { font-weight: 600; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filepick.has-file .filepick-text strong { color: var(--text, #0f172a); }
.filepick-text small { color: var(--muted); font-size: 12px; }
.filepick-clear { position: relative; z-index: 1; margin-left: auto; border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; }
.filepick-clear:hover { background: var(--bg); color: var(--red); }

/* Görevler */
.task-row { align-items: center; gap: 12px; }
.task-row > form { flex: 0 0 auto; }
.task-row > a.cell-main { flex: 1; min-width: 0; }
.task-row .cell-main strong { display: flex; align-items: center; gap: 6px; }
.task-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; padding: 0; }
.task-check .icon { width: 14px; height: 14px; }
.task-check:hover { border-color: var(--green); color: var(--green); }
.task-row.is-done .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task-row.is-done .cell-main strong { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.task-row.is-overdue .task-check { border-color: var(--red); }

/* Form alanı içindeki onay kutuları tam genişlik almasın (.field input kuralını ezer) */
.field .check input, .field .check-input { width: 16px; height: 16px; min-width: 16px; flex: 0 0 auto; padding: 0; box-shadow: none; }
.field .check span { font-weight: 400; }
.field .check-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* Ofis durumu ve grafikler. Seri renkleri doğrulanmış kategorik paletin ilk iki sırası (mavi, turuncu). */
.office { margin-bottom: 8px; }
.office-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 12px; }
.office-head h2 { font-size: 15px; margin: 0; }
a.card.stat { color: inherit; }
a.card.stat:hover { border-color: var(--primary); }
.tabs-sm a { padding: 3px 9px; font-size: 12px; }
.widget-head .tabs-sm { margin-left: auto; }
.viz-body { padding: 4px 16px 14px; }
.viz { margin: 0; --series-1: #2a78d6; --series-2: #eb6834; }
.viz svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--border); stroke-width: 1; }
.viz-axis { stroke: #cbd5e1; stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.viz-hit { fill: transparent; }
.viz-col:hover .viz-hit { fill: rgba(15, 23, 42, .04); }
.viz-s1 { fill: var(--series-1, #2a78d6); background: var(--series-1, #2a78d6); }
.viz-s2 { fill: var(--series-2, #eb6834); background: var(--series-2, #eb6834); }
.viz-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.viz-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.viz-table { margin-left: auto; }
.viz-table summary { cursor: pointer; color: var(--primary); }
.viz-table[open] { flex-basis: 100%; margin-left: 0; }
.viz-table .table { margin-top: 8px; font-size: 12px; }
.viz-bars { display: flex; flex-direction: column; gap: 4px; }
.viz-bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; align-items: center; gap: 12px; padding: 5px 6px; border-radius: 6px; color: inherit; }
.viz-bar-row:hover { background: var(--bg); }
.viz-bar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.viz-bar-fill { height: 14px; border-radius: 0 4px 4px 0; flex: 0 0 auto; }
.viz-bar-value { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; background: #0f172a; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; box-shadow: 0 8px 24px rgba(15, 23, 42, .25); max-width: 260px; }
.viz-tip span { display: flex; align-items: center; gap: 6px; color: #e2e8f0; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
/* Panoda açılır-kapanır bölümler */
.fold { margin-bottom: 12px; }
.fold-head { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; user-select: none; }
.fold-head::-webkit-details-marker { display: none; }
.fold-head:hover { border-color: var(--primary); }
.fold-head h2 { font-size: 15px; margin: 0; }
.fold-head .widget-link { margin-left: auto; }
.fold-chevron { display: grid; place-items: center; color: var(--muted); transition: transform .15s; transform: rotate(-90deg); }
.fold[open] > .fold-head .fold-chevron { transform: none; }
@media (max-width: 760px) { .fold-hint { display: none; } }
/* Grafik kartları aynı yükseklikte; lejant kartın altına yaslanır */
.viz-row { align-items: stretch; }
.viz-row > .card { display: flex; flex-direction: column; }
.viz-row .viz-body { flex: 1; display: flex; }
.viz-row .viz { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
/* Açılır bölüm başlıkları kurum renginde; yazı rengi _theme.php'de kontrasta göre (--on-primary) */
.fold-head { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.fold-head:hover { border-color: var(--primary); filter: brightness(1.06); }
.fold-head h2, .fold-head .widget-link, .fold-head .fold-chevron { color: inherit; }
.fold-head .fold-hint { color: inherit; opacity: .78; }

/* Belgelerde klasör gezintisi */
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.docs-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.docs-folder strong { display: inline-flex; align-items: center; gap: 6px; }
.widget-head .head-right + .upload-zone { margin-left: 6px; }
.docs-newfolder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--primary-soft); }
.docs-newfolder > .icon { color: var(--primary); }
.docs-newfolder input { flex: 1; min-width: 160px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); }
.docs-newfolder input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.docs-newfolder .field-error:empty { display: none; }
.docs-newfolder .field-error { flex-basis: 100%; }

/* Profil: Microsoft 365 bağlantısı */
.ms-scopes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }

/* Uygulama içi pencere (dialog) */
.modal { width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 0; border-radius: 14px; background: var(--surface); box-shadow: 0 24px 64px rgba(15, 23, 42, .25); }
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(15, 23, 42, .4); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-search { display: flex; gap: 8px; padding: 12px 18px 0; }
.modal-search input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.modal-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.modal-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 18px 0; }
.chip { border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.modal-list { padding: 8px 10px; flex: 1; min-height: 200px; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.modal-foot [data-status] { margin-right: auto; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.pick-row:hover { background: var(--bg); }
.pick-row input { width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }
.pick-row .cell-main { flex: 1; min-width: 0; }
.pick-row .cell-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row.is-saved { opacity: .55; cursor: default; }
#emails .widget-row form { flex: 0 0 auto; }
/* OneDrive gezgini (Dosyalarım ve "OneDrive'dan ekle") */
.od-panel { overflow: hidden; }
.od-panel .modal-search { padding: 14px 16px 0; }
.od-crumbs { border-bottom: 1px solid var(--border); margin-top: 10px; }
.od-list { padding: 6px 8px; max-height: 60vh; overflow-y: auto; }
.od-modal { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.od-modal .od-list { flex: 1; min-height: 240px; }
button.pick-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; color: inherit; }
.od-icon { width: 16px; text-align: center; }
.dash-date { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.dash-date strong { font-size: 15px; font-weight: 600; }
.dash-date span { font-size: 13px; }
@media (max-width: 760px) { .dash-date { align-items: flex-start; } }
/* Giriş ekranı: solda marka bölmesi, sağda form */
.auth-body:has(.auth-split) { display: block; padding: 0; background: var(--surface); }
.auth-split { display: grid; grid-template-columns: 1.15fr 1fr; width: 100%; max-width: none; margin: 0; min-height: 100vh; }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 48px 56px; color: var(--on-primary); background-color: var(--primary); background-image: linear-gradient(145deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 72%, #000) 100%); background-size: cover; background-position: center; }
.auth-aside.has-image::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--primary) 90%, transparent) 0%, color-mix(in srgb, var(--primary) 45%, transparent) 55%, color-mix(in srgb, var(--primary) 70%, transparent) 100%); }
.auth-ring { position: absolute; border-radius: 50%; border: 1px solid currentColor; opacity: .14; }
.auth-ring-1 { width: 620px; height: 620px; right: -210px; top: -190px; }
.auth-ring-2 { width: 420px; height: 420px; right: -110px; top: -90px; opacity: .2; }
.auth-ring-3 { width: 260px; height: 260px; right: -30px; top: -10px; background: currentColor; opacity: .06; }
.auth-aside-top, .auth-aside-bottom { position: relative; }
.auth-aside-top { display: flex; flex-direction: column; gap: 4px; }
.auth-aside-top strong { font-size: 18px; font-weight: 600; }
.auth-aside-top span { font-size: 14px; opacity: .8; }
.auth-aside-bottom h2 { margin: 0; font-size: clamp(24px, 2.4vw, 34px); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; color: inherit; }
.auth-aside-bottom p { margin: 14px 0 0; font-size: 16px; line-height: 1.5; opacity: .85; max-width: 46ch; }
.auth-main { display: grid; place-items: center; padding: 32px 24px; }
.auth-split .auth-card { border: 0; box-shadow: none; background: transparent; padding: 0; max-width: 380px; animation: auth-in .5s ease-out both; }
.auth-split .auth-card h1 { font-size: 22px; font-weight: 500; text-align: center; }
.auth-split .auth-card h1 + .muted { text-align: center; }
.auth-split .auth-brand { justify-content: center; margin-bottom: 44px; }
.auth-split .brand-logo { max-height: 40px; max-width: 220px; }
.auth-pw { position: relative; display: block; }
.auth-pw input { width: 100%; padding-right: 44px; }
.auth-pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.auth-pw button:hover, .auth-pw button.active { color: var(--primary); background: var(--primary-soft); }
@keyframes auth-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-split .auth-card { animation: none; } }
@media (max-width: 760px) {
    .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: var(--primary); }
    .auth-aside { padding: 22px 20px 4px; gap: 0; background-image: none !important; }
    .auth-aside.has-image::before, .auth-ring, .auth-aside-bottom { display: none; }
    .auth-aside-top { text-align: center; }
    .auth-aside-top strong { font-size: 15px; }
    .auth-aside-top span { font-size: 12px; }
    .auth-main { place-items: start center; padding: 18px 16px 32px; }
    .auth-split .auth-card { background: var(--surface); border-radius: 16px; padding: 28px 22px; max-width: 420px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
    .auth-split .auth-brand { margin-bottom: 28px; }
}
/* Kurulum rehberi */
.guide { line-height: 1.6; overflow-wrap: anywhere; }
.guide h2 { font-size: 20px; margin: 0 0 12px; }
.guide h3 { font-size: 16px; margin: 24px 0 8px; }
.guide h4 { font-size: 14px; margin: 16px 0 6px; }
.guide li { margin-bottom: 6px; }
.guide ol, .guide ul, .guide-list { padding-left: 20px; }
.guide code, .guide-list code { font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
/* Dosya Transferi */
.tf-wrap [hidden] { display: none !important; }
.tf-table { overflow-x: auto; }
.tf-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 2px dashed var(--border); border-radius: 12px; transition: border-color .15s, background .15s; }
.tf-drop.is-over { border-color: var(--primary); background: var(--primary-soft); }
.tf-pick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.tf-pick label { cursor: pointer; }
.tf-list-head { margin-top: 18px; margin-bottom: 8px; }
.tf-list { border: 1px solid var(--border); border-radius: 10px; max-height: 320px; overflow-y: auto; }
.tf-row { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.tf-row:last-child { border-bottom: 0; }
.tf-row .filepick-clear { margin-left: 0; flex: none; }
.tf-path { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tf-row small { white-space: nowrap; }
.tf-progress-text { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin: 14px 0 6px; overflow-wrap: anywhere; }
.tf-bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.tf-bar div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.tf-error { font-size: 12px; line-height: 1.5; color: var(--red); background: var(--red-bg); border-radius: 9px; padding: 10px 12px; margin: 12px 0; }
.tf-link { display: flex; gap: 8px; }
.tf-link input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: var(--bg); }
.tf-done { max-width: 560px; margin: 0 auto; }
.tf-done .tf-link { margin: 16px 0; }
.tf-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 24px; margin: 20px 0 0; }
.tf-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tf-facts dd { margin: 0; overflow-wrap: anywhere; }
.tf-pre { white-space: pre-line; }
.tf-actions { align-items: center; flex-wrap: wrap; }
.tf-scroll { max-height: 420px; overflow-y: auto; }
.tf-all { margin-bottom: 14px; }
.tf-file { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; background: var(--surface); color: var(--text); }
.tf-file:hover { border-color: var(--primary); }
.tf-file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.od-send { position: sticky; top: 80px; }