/* =============================================================================
 * İYİ CRM — arayüz katmanı (FAZ M12). app.css'ten SONRA, theme.css ile birlikte yüklenir.
 * Emoji yok, gradyan dalgası / cam efekti yok. Animasyonlar yalnız transform/opacity
 * (Core Web Vitals: yerleşim kaymaz) ve "hareketi azalt" tercihinde kapalı.
 * ========================================================================== */

:root {
    --ico-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235a6482' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
    --ico-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111831' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
    --ico-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239aa7c6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
    --ico-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e8edf8' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ico-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239aa7c6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
        --ico-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e8edf8' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
    }
}

/* ------------------------------------------------------------ form alanları */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="url"],
input[type="datetime-local"], input[type="date"], input[type="time"], input[type="tel"], select, textarea {
    background-color: var(--field); border-color: var(--border); border-radius: 12px; min-height: 44px; box-sizing: border-box;
}
textarea { min-height: 0; }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }

/* Arama: site genelindeki tüm arama kutuları — büyüteç, temizle (×), aynı yükseklik */
input[type="search"] {
    width: 100%; margin-top: 5px; font-size: 14.5px; font-weight: 500; color: var(--text);
    padding: 10px 12px 10px 40px; border: 1px solid var(--border);
    background-image: var(--ico-search); background-repeat: no-repeat; background-position: 13px 50%; background-size: 18px;
    transition: border-color var(--tr), box-shadow var(--tr), background-color var(--tr);
    -webkit-appearance: none; appearance: none;
}
input[type="search"]::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
input[type="search"]:not(:placeholder-shown) { font-weight: 600; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-left: 6px; cursor: pointer;
    border-radius: 99px; background: var(--border) var(--ico-clear) no-repeat 50% 50% / 12px;
}
.filter-grow { flex: 1 1 280px; min-width: 200px; }
form input[type="search"] { margin-top: 0; }

/* -------------------------------------------------------------- butonlar */
.btn { border-radius: 12px; min-height: 40px; font-weight: 700; transition: transform var(--tr), background-color var(--tr), border-color var(--tr), box-shadow var(--tr); }
.btn-sm { min-height: 34px; border-radius: 10px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 48, .12); }
.btn-primary:hover { background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; }
:root[data-theme="dark"] .btn-primary { background: #3f63f0; border-color: #3f63f0; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.seg .btn.is-on, .btn.is-on { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }

/* ---------------------------------------------------------------- kartlar */
.card { border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--card); }
.card-head h2 { font-weight: 800; letter-spacing: -.01em; }
.alert { border-radius: 14px; }
.alert-success { border-color: transparent; }
.alert-error { border-color: transparent; }
.badge { border-radius: 99px; font-weight: 700; }

/* --------------------------------------------------------------- tablolar */
.table th { background: var(--surface-2); color: var(--muted); font-weight: 800; }
.table tbody tr, .table tr { transition: background-color var(--tr); }
.table tr:hover td { background: var(--surface-2); }

/* Telefonda tablo -> kart listesi (td'lerde data-label) */
@media (max-width: 640px) {
    .table-cards, .table-cards tbody { display: block; }
    .table-cards tr:first-child:has(th) { display: none; }
    .table-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; margin-bottom: 10px;
        background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
    .table-cards td { display: block; border: 0; padding: 0; background: transparent !important; font-size: 13px; color: var(--muted); }
    .table-cards td { grid-column: 1 / -1; }
    .table-cards td:first-child { grid-column: 1; grid-row: 1; font-size: 15px; color: var(--text); min-width: 0; }
    .table-cards td.tc-end { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
    .table-cards td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; font-weight: 700; color: var(--text-2); }
    .table-cards td.num { text-align: left; }
}

/* ------------------------------------------------- kabuk: üst / alt / kenar */
.topbar { background: color-mix(in srgb, var(--card) 92%, transparent); transition: box-shadow var(--tr); }
body.is-scrolled .topbar { box-shadow: 0 6px 18px rgba(16, 24, 48, .08); }
.theme-btn { width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color var(--tr); }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 18px; height: 18px; display: none; }
:root[data-theme-pref="auto"] .theme-btn .t-auto, :root:not([data-theme-pref]) .theme-btn .t-auto,
:root[data-theme-pref="light"] .theme-btn .t-light, :root[data-theme-pref="dark"] .theme-btn .t-dark { display: block; }
.sb-link { border-radius: 12px; }
.sb-link.is-active { background: rgba(111, 140, 255, .18); font-weight: 700; }
@media (max-width: 900px) {
    .bottombar { background: var(--card); backdrop-filter: none; box-shadow: none; }
    .bb-item .ico { width: 20px; height: 20px; }
    .bb-item::before { content: ''; display: block; width: 44px; height: 26px; margin-bottom: -26px; border-radius: 99px; background: transparent; transition: background-color var(--tr); }
    .bb-item.is-active::before { background: var(--primary-soft); }
    .bb-item.is-active { color: var(--primary-ink); font-weight: 800; }
    .bb-item .ico, .bb-item span { position: relative; }
    .card { border-radius: 18px; }
    .card-head h2 { font-size: 17px; }
}

/* ------------------------------------------------------------- animasyon */
@keyframes ui-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
.content > .card, .content > .grid-2 > .card, .content > .dash-grid > *, .content > .kpi-row > * { animation: ui-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.content > :nth-child(2) { animation-delay: .04s; } .content > :nth-child(3) { animation-delay: .08s; }
.content > :nth-child(4) { animation-delay: .12s; } .content > :nth-child(5) { animation-delay: .16s; }
.content > :nth-child(n+6) { animation-delay: .2s; }
.alert { animation: ui-fade .3s both; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------ koyu tema ince ayarları */
:root[data-theme="dark"] img:not([src$=".svg"]) { filter: brightness(.94); }
:root[data-theme="dark"] .alert-success { color: var(--ok); }
:root[data-theme="dark"] .alert-error { color: var(--danger); }

/* ------------------------------------------- rozetler: koyu tema karşılıkları */
:root[data-theme="dark"] .badge-ch-form      { background: #1a2550; color: #9fb3ff; }
:root[data-theme="dark"] .badge-ch-messenger { background: #2a1f4d; color: #c4b2ff; }
:root[data-theme="dark"] .badge-ch-instagram { background: #3a1730; color: #ff9bd2; }
:root[data-theme="dark"] .badge-ch-whatsapp  { background: #0f3325; color: #6fdca5; }
:root[data-theme="dark"] .badge-mod-studio, :root[data-theme="dark"] .badge-override { background: #2a1f4d; color: #c4b2ff; }
:root[data-theme="dark"] .badge-job-scheduled { background: #0d2c3f; color: #7cc8f2; }
:root[data-theme="dark"] .badge-src, :root[data-theme="dark"] .badge-job-draft { background: #1e2a44; color: var(--text-2); }

/* ------------------------------------------- telefonda üst çubuk: yer açma */
.sb-theme { width: 100%; background: transparent; border: 0; font: inherit; cursor: pointer; text-align: left; }
@media (min-width: 901px) { .sb-theme { display: none; } }
@media (max-width: 900px) {
    .topbar .theme-btn { display: none; }
    .topbar-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar .branch-pill { max-width: 128px; }
}

/* =============================================================== PANEL (M12) */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 2px 0 18px; }
.dash-head h1 { margin: 2px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.dash-date { font-size: 13px; font-weight: 700; color: var(--muted); }
.dash-period { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.dash-period .btn { border: 0; background: transparent; color: var(--muted); min-height: 34px; }
.dash-period .btn.is-on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.dash-section { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border);
    box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform var(--tr), border-color var(--tr); animation: ui-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.kpi:nth-child(2) { animation-delay: .05s; } .kpi:nth-child(3) { animation-delay: .1s; } .kpi:nth-child(4) { animation-delay: .15s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi:active { transform: scale(.99); }
.kpi-lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.kpi-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-val.is-neg { color: var(--danger); }
.kpi-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-tag { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.kpi-tag.is-up { background: var(--ok-soft); color: var(--ok); }
.kpi-tag.is-down { background: var(--danger-soft); color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-grid > .card { margin: 0; animation: ui-rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .12s; }
.dash-span2 { grid-column: span 2; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .dash-grid { grid-template-columns: 1fr; } .dash-span2 { grid-column: auto; } .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; } .kpi-val { font-size: 23px; } .dash-head h1 { font-size: 24px; } }

.chart-legend { display: flex; gap: 14px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-s { background: var(--primary); } .lg-p { background: #d08a1c; }
.bar-chart { height: 180px; display: flex; align-items: flex-end; gap: 5px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.bc-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.bc-col span { display: block; border-radius: 4px; transform-origin: bottom; animation: bc-grow .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d) * 18ms); }
.bc-s { background: var(--primary); } .bc-p { background: #d08a1c; }
.bc-col:hover span { filter: brightness(1.12); }
@keyframes bc-grow { from { transform: scaleY(0); } to { transform: none; } }
.bc-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; transition: background-color var(--tr); }
.todo-item:hover { background: var(--primary-soft); }
.todo-item.is-zero { opacity: .55; }
.todo-item .ico { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
.todo-n { min-width: 34px; height: 34px; border-radius: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.tone-danger { background: var(--danger-soft); color: var(--danger); } .tone-warn { background: var(--warn-soft); color: var(--warn); } .tone-info { background: var(--primary-soft); color: var(--primary-ink); }
.todo-txt { display: flex; flex-direction: column; font-size: 14px; } .todo-txt .muted { font-size: 12px; }

.flow { list-style: none; margin: 0; padding: 0; }
.flow li + li { border-top: 1px solid var(--border); }
.flow a { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: var(--text); text-decoration: none; }
.flow a:hover .flow-main strong { color: var(--primary); }
.flow-time { width: 50px; flex-shrink: 0; display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); }
.flow-time strong { font-size: 15px; color: var(--text); }
.flow-bar { width: 4px; align-self: stretch; min-height: 30px; border-radius: 4px; flex-shrink: 0; }
.flow-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; font-size: 14px; }
.flow-main .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.week-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wb { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text); padding: 6px 0; border-radius: 12px; transition: background-color var(--tr); }
.wb:hover { background: var(--surface-2); }
.wb-n { font-weight: 800; font-size: 14px; }
.wb-track { width: 16px; height: 90px; border-radius: 99px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.wb-fill { width: 100%; background: var(--primary); border-radius: 99px; transform-origin: bottom; animation: bc-grow .6s cubic-bezier(.2, .8, .2, 1) both; }
.wb-d { font-size: 12px; font-weight: 700; color: var(--muted); }
.wb.is-today .wb-d { color: var(--primary); }

.artist-list, .funnel { display: flex; flex-direction: column; gap: 12px; }
.artist-row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 99px; color: #fff; background: var(--primary); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; background: var(--primary-soft); color: var(--primary-ink); }
.artist-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.artist-top, .funnel-top { display: flex; justify-content: space-between; font-size: 13.5px; }
.funnel-row { display: flex; flex-direction: column; gap: 6px; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
.meter span { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: meter-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes meter-grow { from { transform: scaleX(0); } to { transform: none; } }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dash-license .card-head { margin: 0; }
.dash-license-state { margin: 0; }
/* kart başlığındaki dikey vurgu çizgisi kaldırıldı (şablon görünümü vermesin) */
.card-head h2 { padding-left: 0; }
.card-head h2::before { display: none; }

/* ========================================================= TAKVİM: AY / YIL (M12) */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cm-dow { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; padding: 4px 0; letter-spacing: .04em; }
.cm-day { min-height: 118px; display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: 12px; background: var(--card);
    border: 1px solid var(--border); color: var(--text); text-decoration: none; overflow: hidden; transition: border-color var(--tr), background-color var(--tr); }
.cm-day:hover { border-color: var(--primary); }
.cm-day.is-out { background: var(--surface-2); opacity: .6; }
.cm-day.is-today { border-color: var(--primary); box-shadow: var(--ring); }
.cm-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.cm-num { font-weight: 800; font-size: 14px; }
.cm-day.is-today .cm-num { background: var(--primary); color: #fff; border-radius: 99px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.cm-count { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-ink); }
.cm-item { display: block; font-size: 12px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; border-left: 3px solid var(--c);
    background: color-mix(in srgb, var(--c) 12%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-item b { font-weight: 800; }
.cm-more, .cm-crm { font-size: 11.5px; font-weight: 700; color: var(--muted); padding-left: 2px; }
.cm-crm { color: var(--primary-ink); }
@media (max-width: 760px) {
    .cal-month { gap: 3px; }
    .cm-day { min-height: 56px; padding: 5px; align-items: center; }
    .cm-item, .cm-more, .cm-crm { display: none; }
    .cm-top { flex-direction: column; gap: 3px; }
    .cm-num { font-size: 13px; }
}

.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 22px; }
.cy-month { display: flex; flex-direction: column; gap: 8px; }
.cy-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--text); text-decoration: none; }
.cy-head:hover strong { color: var(--primary); }
.cy-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cy-dow { font-size: 10.5px; font-weight: 800; color: var(--muted); text-align: center; }
.cy-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border-radius: 6px;
    color: var(--text); text-decoration: none; transition: transform var(--tr); }
.cy-day:hover { transform: scale(1.12); }
.cy-day.lv-0 { background: var(--surface-2); color: var(--muted); }
.cy-day.lv-1 { background: color-mix(in srgb, var(--primary) 22%, var(--card)); }
.cy-day.lv-2 { background: color-mix(in srgb, var(--primary) 45%, var(--card)); }
.cy-day.lv-3 { background: color-mix(in srgb, var(--primary) 70%, var(--card)); color: #fff; }
.cy-day.lv-4 { background: var(--primary); color: #fff; }
.cy-day.is-today { outline: 2px solid var(--text); outline-offset: 1px; }
.cy-legend { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.cy-legend i { width: 14px; height: 14px; aspect-ratio: auto; display: inline-block; }

/* ------------------------------------------------ M5b: logo + iyiapp geçmişi */
.brand-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand-preview { width: 120px; height: 64px; border: 1px dashed var(--border-strong); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface-2); font-size: 12px; }
.brand-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tenant-logo { display: flex; margin: 10px 2px 0; }
.tenant-logo img { max-height: 34px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px 8px; }
.portal-brand { display: flex; align-items: center; gap: 10px; }
.portal-brand img { max-height: 40px; max-width: 120px; object-fit: contain; }
.legacy-history summary { cursor: pointer; list-style: none; }
.legacy-history summary::-webkit-details-marker { display: none; }
.legacy-history summary h2::after { content: ' +'; color: var(--muted); }
.legacy-history[open] summary h2::after { content: ' −'; }
.lh-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 8px 0; font-size: 13.5px; }
@media (max-width: 640px) { .lh-row { grid-template-columns: 1fr; gap: 2px; } }

/* ------------------------------------------------ Mail marketing (M13) */
.mk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 8px; vertical-align: middle; }
.mk-step { font-weight: 800; min-width: 64px; }
.mk-consent, .mk-mode { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
.mk-consent legend, .mk-mode legend { font-weight: 800; padding: 0 6px; }
.mk-warn { margin: 8px 0 0; }
.mk-active { align-self: end; }
.mk-pick { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.mk-pick li .check { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--ok); margin-left: 6px; vertical-align: middle; }
.mk-chip { display: inline-flex; }
.mk-x { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; margin-left: 6px; cursor: pointer; padding: 0 2px; }
.mk-x:hover { color: var(--danger); }

/* Takvim: tamamlanan seans (geçmiş) — görünür ama taşınamaz */
.cal-ev.is-done { opacity: .72; border-left-style: dashed; cursor: pointer; }
.cal-ev.is-done:hover { opacity: 1; }
.cw-list li.is-done { opacity: .72; }
.kb-branch-tabs { margin: 0 0 12px; }
.conn-branch { background: var(--primary-soft); color: var(--primary-ink); border: 0; }
.conn-others { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }

/* ============================================ Şube seçici (M14 tasarım yenilemesi) */
.bsw { position: relative; }
.bsw > summary { list-style: none; }
.bsw > summary::-webkit-details-marker { display: none; }
.bsw-trigger { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 5px; border-radius: 14px; cursor: pointer;
    background: var(--card); border: 1px solid var(--border); color: var(--text); user-select: none;
    transition: border-color var(--tr), box-shadow var(--tr), background-color var(--tr); }
.bsw-trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.bsw[open] .bsw-trigger, .bsw-trigger:focus-visible { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.bsw-mark { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11.5px; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--c, var(--primary)); }
.bsw-mark .ico { width: 17px; height: 17px; }
.bsw-mark-all { background: var(--primary-soft); color: var(--primary-ink); }
.bsw-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; text-align: left; }
.bsw-cap { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bsw-name { font-size: 14px; font-weight: 800; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsw-chev { width: 16px; height: 16px; color: var(--muted); transition: transform var(--tr); }
.bsw[open] .bsw-chev { transform: rotate(180deg); }

.bsw-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 300px; max-width: calc(100vw - 24px); margin: 0;
    background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px;
    animation: bsw-in .16s cubic-bezier(.2, .8, .2, 1); transform-origin: top right; }
@keyframes bsw-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.bsw-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; font-size: 12px; font-weight: 800;
    letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bsw-count { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); letter-spacing: 0; }
.bsw-list { max-height: 320px; overflow-y: auto; }
.bsw-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px; border: 0; border-radius: 12px; background: transparent;
    color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--tr); }
.bsw-item:hover, .bsw-item:focus-visible { background: var(--surface-2); outline: none; }
.bsw-item.is-current { background: var(--primary-soft); }
.bsw-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bsw-item-text strong { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsw-item-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsw-tick { color: var(--primary); display: inline-flex; }
.bsw-tick .ico { width: 18px; height: 18px; }
.bsw-sep { height: 1px; background: var(--border); margin: 6px 8px; }
.bsw-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 10px; border-top: 1px solid var(--border);
    font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 0 0 10px 10px; }
.bsw-foot:hover { color: var(--primary); }
.bsw-foot .ico { width: 16px; height: 16px; }
.bsw-backdrop { display: none; }

/* tek şube: sabit etiket aynı görsel dilde */
.branch-pill.is-static { height: 44px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); padding: 0 12px; gap: 8px; font-weight: 700; }

@media (max-width: 900px) {
    .bsw-trigger { height: 40px; padding: 0 8px 0 4px; gap: 8px; }
    .bsw-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 10.5px; }
    .bsw-cap { display: none; }
    .bsw-name { font-size: 13px; max-width: 96px; }
    /* telefonda alttan açılan panel */
    .bsw[open] .bsw-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(8, 12, 28, .45); animation: ui-fade .16s both; }
    .bsw-menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: 22px 22px 0 0;
        padding: 8px 10px calc(14px + env(safe-area-inset-bottom, 0px)); animation: bsw-up .22s cubic-bezier(.2, .8, .2, 1); }
    .bsw-menu::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 2px auto 8px; }
    .bsw-list { max-height: 55vh; }
    .bsw-item { padding: 11px 8px; }
    .bsw-mark { width: 36px; height: 36px; }
    .topbar .bsw-item .bsw-mark { width: 38px; height: 38px; font-size: 12px; }
}
@keyframes bsw-up { from { transform: translateY(100%); } to { transform: none; } }
/* Panel açıkken üst çubuğun bulanıklığı kapanır: backdrop-filter, içindeki position:fixed öğeleri üst çubuğa hapseder */
.topbar:has(.bsw[open]) { -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 80; }
@media (max-width: 900px) {
    .bsw[open] .bsw-backdrop { z-index: 89; }
    .bsw-menu { z-index: 90; }
}

/* =============================================== M15: Admin onayı bekleyen bilet (gri, taralı) */
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 8px; vertical-align: middle; }
.st-pending { background: #8a94ad; box-shadow: 0 0 0 3px rgba(138, 148, 173, .22); }
.approval-card { border-left: 4px solid #8a94ad; }
.cal-ev.is-pending, .cw-list li.is-pending { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(138, 148, 173, .22) 6px 12px) !important;
    border-left-color: #8a94ad !important; filter: saturate(.35); }
.badge-pending { background: #eceff5; color: #4b5570; }
:root[data-theme="dark"] .badge-pending { background: #252e44; color: #b6c0d8; }

/* ============================================== M15: tek bilet formu */
.sr-only-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.type-chip { height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; transition: background-color var(--tr), border-color var(--tr); }
.type-chip:hover { border-color: var(--border-strong); }
.type-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.type-chip.is-link { border-style: dashed; color: var(--muted); }
.type-chip.is-link:hover { color: var(--primary); border-color: var(--primary); }
.type-sep { width: 1px; background: var(--border); margin: 4px 4px; }
.cust-pick { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px 14px; margin: 12px 0 8px; background: var(--surface-2); }
.cust-pick .form-sub { margin-top: 0; }
.cust-card-main { display: flex; align-items: center; gap: 12px; }
.cust-card-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cust-card-text .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-history { margin-top: 10px; }
.cust-search { position: relative; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.cust-search input[type="search"] { flex: 1 1 260px; margin: 0; }
.cust-results { position: absolute; top: 50px; left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 6px; background: var(--card);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.cust-results button { width: 100%; display: flex; gap: 10px; align-items: center; padding: 8px; border: 0; border-radius: 10px; background: transparent;
    color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.cust-results button span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cust-results button .muted { font-size: 12px; }
.cust-results button:hover, .cust-results button.is-active { background: var(--primary-soft); }
.cust-none { padding: 10px; font-size: 13px; }
.cust-new { margin-top: 8px; }
.cust-new-actions { align-self: end; }
.rest-line { display: flex; justify-content: flex-end; gap: 8px; font-size: 15px; margin: 4px 0 0; }
.rest-line strong { font-size: 18px; }
.uploader-draft .up-list img.up-preview { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; margin-right: 8px; vertical-align: middle; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
.cust-history .flow-time { width: 86px; } .cust-history .flow a { padding: 8px 2px; }

/* ============================================== M15: Rezervasyonlar */
.res-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 280px)); }
.res-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.res-date input { width: auto; min-width: 150px; }
.res-thumb { width: 56px; }
.res-thumb img, .res-thumb-empty { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: block; background: var(--surface-2); }
.res-dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 7px; vertical-align: middle; }
.res-dot.st-pending { background: #8a94ad; } .res-dot.st-approved { background: #0e9f6e; } .res-dot.st-progress { background: #d08a1c; }
.res-dot.st-done { background: #fff; box-shadow: inset 0 0 0 2px #0e9f6e; position: relative; }
.res-dot.st-done::after { content: ''; position: absolute; left: 3px; top: 1px; width: 3px; height: 6px; border: solid #0e9f6e; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.res-row.st-pending td { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(138, 148, 173, .10) 6px 12px); }
.res-row.st-done td { opacity: .78; }
.res-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.res-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.is-neg { color: var(--danger); }
@media (max-width: 640px) {
    .res-table .res-thumb { grid-row: 1 / span 2; }
    .res-actions { grid-column: 1 / -1; justify-content: flex-start; margin-top: 6px; }
}
/* M15 — lead'den Project, kanban geçiş ayarı */
.lead-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); margin: 8px 0; }
.lead-banner .btn { margin-left: auto; }
.stage-map { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; margin-top: 10px; }

/* ============================================== M17: gider belgeleri (GoBD) */
.exp-docs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.badge-doc { background: var(--primary-soft); color: var(--primary-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.badge-doc:hover { text-decoration: underline; }
.badge-nodoc { background: #fdecec; color: #b42318; }
:root[data-theme="dark"] .badge-nodoc { background: #3a1d1f; color: #f5a3a3; }
.exp-adddoc .uploader { margin-top: 8px; min-width: 260px; }
.uploader-doc .up-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* M17 — kasa açılış ekranı */
.cash-range { margin: 4px 0 12px; }
.cash-boxes { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.cash-boxes .kpi.is-pos .kpi-val { color: var(--success, #0e9f6e); }
.cash-boxes .kpi.is-neg .kpi-val { color: var(--danger); }
.badge-in { background: #e6f6ef; color: #0b7a55; } .badge-out { background: #fdecec; color: #b42318; }
:root[data-theme="dark"] .badge-in { background: #173a2d; color: #7fd6b0; } :root[data-theme="dark"] .badge-out { background: #3a1d1f; color: #f5a3a3; }
@media (max-width: 900px) { .cash-boxes { grid-template-columns: 1fr 1fr; } }
.cash-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cash-period input[type="date"] { width: auto; min-width: 148px; margin: 0; }
@media (max-width: 640px) { .cash-period { justify-content: flex-start; } .cash-period input[type="date"] { flex: 1 1 130px; min-width: 0; } }
.month-table tr.is-empty td { color: var(--muted); } .month-table tr.is-total td { border-top: 2px solid var(--border-strong); font-weight: 800; }
/* M17 — muhasebe sekmesi */
.acc-setup { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; }
.acc-setup .kv { margin: 0; gap: 10px; }
.acc-create { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.acc-create input[type="month"] { width: auto; }
.acc-sup { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* M19 — personel belgeleri */
.fdoc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.badge-warn { background: #fff4e0; color: #9a5b00; } :root[data-theme="dark"] .badge-warn { background: #3a2c12; color: #f3c27a; }
.sdoc-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sdoc-form select, .sdoc-form input[type="date"] { width: auto; margin: 0; height: 34px; font-size: 13px; }
.ads-box { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); } .ads-roas { margin: 6px 0 0; font-weight: 700; color: var(--primary-ink); }
/* M19 — iki adımlı doğrulama */
.tfa-card { max-width: 640px; }
.tfa-steps { padding-left: 20px; display: grid; gap: 14px; }
.tfa-qr { display: inline-block; margin: 10px 0 4px; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.tfa-qr svg { display: block; }
.tfa-secret { font-size: 13px; letter-spacing: .06em; user-select: all; }
.tfa-code { font-size: 20px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; max-width: 190px; }
.tfa-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.tfa-inline .tfa-code { margin: 0; }
.tfa-codes { padding: 12px 14px; border: 2px dashed var(--primary); border-radius: 12px; margin-bottom: 14px; }
.tfa-codes ul { columns: 2; list-style: none; padding: 0; margin: 8px 0 0; }
.tfa-codes code { font-size: 15px; letter-spacing: .08em; }
.tfa-actions { display: grid; gap: 4px; margin-top: 10px; }
/* M16 — seans tamamlanma onayı bekliyor (mavi) */
.badge-awaiting { background: #e3edff; color: #1d4ed8; } :root[data-theme="dark"] .badge-awaiting { background: #1b2b52; color: #9cc0ff; }
.cal-ev.is-awaiting, .cw-list li.is-awaiting { border-left-color: #2563eb !important; box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .45); }
.res-dot.st-awaiting { background: #2563eb; }
.sess-done { margin-left: 4px; }

/* FAZ B1 — online rezervasyon rozeti */
.badge-online { background: #ecfdf3; color: #067647; }
:root[data-theme="dark"] .badge-online { background: #0f2e22; color: #75e0a7; }

/* hiink isteği — sönük rozet (ör. "Randevusuz") */
.badge-muted { background: var(--surface-2, #eef1f7); color: var(--muted, #6b7280); }
