/* Uygulama genelinde tipografi. Panel, Flutter uygulamasıyla aynı tasarım dilini kullanır
   (docs/design-tokens.md); web fontu yüklemek yerine sistem sans-serif yığını tercih edilir. */
html, body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    color: #0E1729;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ============================================================================
   ORTAK PANEL SÖZLÜĞÜ — tüm sayfaların paylaştığı görsel dil.
   Scoped (.razor.css) dosyalara KOPYALANMAZ: oraya yalnız sayfaya özgü kurallar
   yazılır. Buradaki sınıflar + Components/Shared bileşenleri sayesinde yeni bir
   sayfa hiçbir stil kopyalamadan tutarlı doğar.
   ========================================================================== */

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.6px; margin: 0; }
.page-head p { font-size: 13px; font-weight: 500; color: #6B7686; margin: 6px 0 0; max-width: 720px; line-height: 1.55; }
.page-head strong { color: #0E1729; font-weight: 700; }

.banner { padding: 12px 15px; border-radius: 14px; margin-bottom: 14px; font-size: 13px; font-weight: 700; max-width: 980px; }
.banner.success { background: #E6F7EF; border: 1px solid #C9EBDA; color: #127A52; }
.banner.error { background: #FCE9E9; border: 1px solid #F7D5D6; color: #B03B3F; }

.card { background: #fff; border: 1px solid #EAEDF3; border-radius: 22px; overflow: hidden; max-width: 980px; }
.card.muted { padding: 22px; color: #6B7686; font-size: 13px; }
.card + .card, .section-title + .card { margin-top: 14px; }

.section-title { font-size: 16px; font-weight: 800; letter-spacing: -.3px; margin: 30px 0 12px; }

.setting-row { display: flex; gap: 26px; align-items: flex-start; padding: 18px 20px; border-top: 1px solid #F1F3F8; }
.setting-row:first-child { border-top: none; }
.setting-info { flex: 1; min-width: 0; }
.setting-name { font-size: 14px; font-weight: 800; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting-desc { font-size: 12px; font-weight: 500; color: #6B7686; margin-top: 4px; line-height: 1.5; }
.setting-edit { display: flex; gap: 8px; align-items: flex-start; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.empty-state { padding: 26px 22px; color: #6B7686; font-size: 13px; font-weight: 600; text-align: center; }

.muted { color: #6B7686; }

.tab-count { font-size: 10.5px; font-weight: 800; background: #F3F5FA; color: #6B7686; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

.btn { padding: 10px 16px; border-radius: 999px; border: 1px solid #EAEDF3; background: #fff; color: #3D4757; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.small { padding: 7px 12px; font-size: 12px; }
.btn.primary { background: #1E63E0; border-color: #1E63E0; color: #fff; box-shadow: 0 3px 10px rgba(30,99,224,.16); }
.btn.primary:disabled { background: #C0C8D6; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: #F3F5FA; border-color: transparent; color: #6B7686; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Checkbox grubu: SwitchRow bileşeni + yatay dizilim için switch-grid. */
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #0E1729; cursor: pointer; user-select: none; }
.switch-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: #1E63E0; cursor: pointer; }
.switch-row input[type="checkbox"]:disabled { cursor: not-allowed; }
.switch-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }

/* Form alanı yığını: select/input/textarea tek dilde. */
.form-stack { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; max-width: 560px; }
.form-stack select, .form-stack input, .form-stack textarea,
.form-inline select, .form-inline input, .setting-edit select, .setting-edit input {
    padding: 10px 13px; border-radius: 14px;
    border: 1px solid #EAEDF3; background: #F8FAFE;
    font-size: 13px; font-weight: 600; color: #0E1729;
    font-family: inherit; outline: none;
}
.form-stack select:focus, .form-stack input:focus, .form-stack textarea:focus,
.form-inline select:focus, .form-inline input:focus { border-color: #1E63E0; background: #fff; }
.form-stack textarea { resize: vertical; font-weight: 500; line-height: 1.55; }
.form-stack input:disabled, .form-inline input:disabled { background: #F3F5FA; color: #98A2B1; }
.form-inline { display: flex; gap: 8px; margin-top: 10px; max-width: 560px; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 180px; }

.hint { font-size: 11px; font-weight: 600; color: #98A2B1; }

/* Denetim izi listesi (Ayarlar + Bayi Ağı). */
.history-row { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid #F1F3F8; font-size: 12.5px; flex-wrap: wrap; }
.history-row:first-child { border-top: none; }
.history-row .old { color: #98A2B1; text-decoration: line-through; }
.history-row .arrow { color: #C0C8D6; }
.history-row .new { font-weight: 700; }
.history-row .when { margin-left: auto; color: #98A2B1; font-weight: 600; }

/* Zayıf bilgi notu — uyarı kutusundan bilinçli olarak hafif (uyarı körlüğüne karşı). */
.note { font-size: 11.5px; font-weight: 600; color: #98A2B1; margin-bottom: 12px; }

.deletion-badge {
    display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
    font-size: 10px; font-weight: 800; letter-spacing: .4px; vertical-align: middle;
    background: #FDECEC; color: #C0392B;
}

/* Yönetim — Yönetim modülünün rengi (#7B5BE6), uygulamayla aynı palet. */
.account-role { font-size: 11px; font-weight: 800; color: #7B5BE6; margin-top: 2px; }
.one-time { border: 1.5px solid #7B5BE6; }
.one-time-secret { display: inline-block; margin: 10px 10px 0 0; padding: 8px 12px; border-radius: 10px;
    background: #F4F0FE; color: #4B32B8; font-size: 16px; font-weight: 800; letter-spacing: .5px; user-select: all; }
.card.padded { padding: 18px 22px; }

/* Sekmeler — Sistem Ayarları ve İşletme detayı ortak. */
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }

.tab {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 14px; border-radius: 999px;
    background: #fff; border: 1px solid #EAEDF3;
    font-size: 12.5px; font-weight: 700; color: #6B7686; cursor: pointer;
}
.tab:hover { border-color: #DCE8FB; background: #F8FAFE; }
.tab.active { background: #1E63E0; border-color: #1E63E0; color: #fff; }

.tab-count {
    font-size: 10.5px; font-weight: 800;
    background: #F3F5FA; color: #6B7686;
    border-radius: 999px; padding: 1px 7px;
}
.tab.active .tab-count { background: rgba(255,255,255,.22); color: #fff; }


/* Liste deseni: arama + filtre çipleri + 20'lik sayfa (tek desen, her listede aynı). */
.list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; max-width: 980px; }
.list-tools input[type="search"] { flex: 1; min-width: 240px; padding: 10px 14px; border-radius: 14px;
    border: 1px solid #EAEDF3; background: #fff; font: 600 13px inherit; font-family: inherit; outline: none; }
.list-tools input[type="search"]:focus { border-color: #7B5BE6; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; max-width: 980px;
    margin-top: 12px; font-size: 12px; font-weight: 700; color: #6B7686; }
.row-link { cursor: pointer; }
.row-link:hover { background: #F8FAFE; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; padding: 18px 22px; font-size: 13px; }
.kv dt { color: #6B7686; font-weight: 700; }
.kv dd { margin: 0; font-weight: 600; color: #0E1729; }
.badge-main { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
    font-size: 10px; font-weight: 800; background: #F4F0FE; color: #7B5BE6; }
.muted-note { font-size: 12px; color: #98A2B1; font-weight: 600; }
.danger-zone { border: 1.5px solid #F3C2C2; }
.audit-since { margin: 0 0 10px; }
.audit-row { flex-wrap: wrap; gap: 8px; align-items: baseline; }
.audit-row .when { margin-left: 0; min-width: 110px; }
.audit-detail { flex-basis: 100%; font-size: 11.5px; color: #6B7686; font-weight: 600; padding-left: 118px; }
.owner-warning { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: #FDECEC; color: #8E2B2B;
    font-size: 12px; font-weight: 600; line-height: 1.5; }
.owner-warning label { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-weight: 800; }

/* Abonelik durumları — uygulama paleti: Kasa yeşili, Market turuncusu, Yönetim moru. */
.status-pill { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
    font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.status-Trial { background: #EAF0FD; color: #164FC4; }
.status-Active { background: #E6F7EF; color: #1FA971; }
.status-ManualGrant { background: #F4F0FE; color: #7B5BE6; }
.status-Overdue { background: #FDF0E6; color: #C65F10; }
.status-Cancelled { background: #F3F5FA; color: #6B7686; }
.overdue-text { color: #C65F10; font-weight: 800; }
.reversal-note { color: #C65F10; }

/* Dönem satırında ödeme ve af formları alt alta (Faz D) — açıklama sütunu daralmasın. */
.period-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* Liste araç çubuğu (Faz E: Toptancılar, ürünler) — arama + süzgeç. */
.list-toolbar { display: flex; gap: 10px; margin: 16px 0 12px; flex-wrap: wrap; max-width: 980px; }
.list-toolbar input, .list-toolbar select {
    padding: 9px 12px; border-radius: 12px; border: 1px solid #EAEDF3; background: #fff;
    font-size: 13px; font-weight: 600; font-family: inherit; color: #0E1729; min-width: 220px;
}
.thumb-grid { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px 20px; }
.thumb-card { width: 132px; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; }
.thumb-card img { width: 132px; height: 132px; object-fit: cover; border-radius: 12px; border: 1px solid #EAEDF3; background: #F8FAFE; }
.thumb-card.primary img { border: 2px solid #1E63E0; }

/* Liste başlığı (ListHeader): arama + sayı, altında süzgeç çipleri (FilterChips → .tabs). */
.list-head { max-width: 980px; margin-bottom: 4px; }
.list-head .tabs { margin-bottom: 14px; }
.list-head-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.list-head-row input[type="search"] { flex: 1; min-width: 240px; padding: 10px 14px; border-radius: 14px;
    border: 1px solid #EAEDF3; background: #fff; font-size: 13px; font-weight: 600; font-family: inherit;
    color: #0E1729; outline: none; }
.list-head-row input[type="search"]:focus { border-color: #1E63E0; }
.list-count { margin-left: auto; font-size: 12px; font-weight: 700; color: #6B7686; white-space: nowrap; }
.list-head-row .tabs { margin-bottom: 0; }

/* Yükleme hatası (ErrorState) — bant renginde, "Tekrar dene" düğmesiyle. */
.error-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 980px;
    padding: 14px 18px; border-radius: 14px; background: #FCE9E9; border: 1px solid #F7D5D6; color: #B03B3F;
    font-size: 13px; font-weight: 700; box-sizing: border-box; }
.card .error-state { border-radius: 0; border: none; }

/* Geri alınamaz işlem düğmesi (onay penceresinde). */
.btn.danger { background: #E5484D; border-color: #E5484D; color: #fff; }

/* Onay penceresi (ConfirmDialog) — ekran ortasında, arkası karartılmış; Vazgeç varsayılan. */
.confirm-scrim { position: fixed; inset: 0; background: rgba(14,23,41,.38); z-index: 900; }
.confirm-dialog { position: fixed; z-index: 901; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 32px)); box-sizing: border-box; padding: 22px 24px 18px; border-radius: 22px;
    background: #fff; border: 1px solid #EAEDF3; box-shadow: 0 18px 50px rgba(14,23,41,.22); }
.confirm-dialog h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.confirm-subject { font-size: 13.5px; font-weight: 800; color: #0E1729; margin-bottom: 6px; overflow-wrap: anywhere; }
.confirm-dialog p { margin: 0; font-size: 13px; font-weight: 500; line-height: 1.55; color: #3D4757; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-actions .btn:focus-visible { outline: 2px solid #1E63E0; outline-offset: 2px; }

/* Genel arama (GlobalSearch) — üst çubuk; sonuçlar kutunun altında açılır. */
.global-search { position: relative; flex: 1; max-width: 560px; }
.global-search input[type="search"] { width: 100%; box-sizing: border-box; padding: 10px 14px; border-radius: 14px;
    border: 1px solid #EAEDF3; background: #fff; font-size: 13px; font-weight: 600; font-family: inherit;
    color: #0E1729; outline: none; position: relative; z-index: 801; }
.global-search input[type="search"]:focus { border-color: #1E63E0; }
.search-scrim { position: fixed; inset: 0; z-index: 800; }
.search-results { position: absolute; z-index: 801; top: calc(100% + 6px); left: 0; right: 0; max-height: 70vh;
    overflow-y: auto; background: #fff; border: 1px solid #EAEDF3; border-radius: 18px;
    box-shadow: 0 14px 40px rgba(14,23,41,.14); padding: 6px 0; }
.search-group + .search-group { border-top: 1px solid #F1F3F8; }
.search-group-title { padding: 10px 16px 4px; font-size: 10px; font-weight: 800; letter-spacing: .5px;
    text-transform: uppercase; color: #98A2B1; }
.search-hit { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; text-decoration: none; color: #0E1729; }
.search-hit:hover, .search-hit:focus { background: #F8FAFE; outline: none; }
.search-hit-name { font-size: 13px; font-weight: 800; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.search-hit-sub { font-size: 11.5px; font-weight: 600; color: #6B7686; overflow-wrap: anywhere; }
.search-note { padding: 12px 16px; font-size: 12.5px; font-weight: 600; color: #6B7686; display: flex;
    align-items: center; justify-content: space-between; gap: 10px; }
.search-note.error { color: #B03B3F; }

/* Ana sayfa eylem panosu — her kart: sayı, ilk satırlar, işin yapıldığı sayfaya bağlantı. */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; max-width: 980px; }
.dash-grid + .section-title { margin-top: 26px; }
.dash-card { background: #fff; border: 1px solid #EAEDF3; border-radius: 22px; padding: 16px 18px 14px;
    display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-card.attention { border-color: #F6D2B5; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dash-title { font-size: 13.5px; font-weight: 800; letter-spacing: -.2px; }
.dash-desc { font-size: 11.5px; font-weight: 600; color: #98A2B1; margin-top: 2px; line-height: 1.45; }
.dash-count { font-size: 26px; font-weight: 800; letter-spacing: -.8px; line-height: 1; color: #98A2B1; }
.dash-card.attention .dash-count { color: #C65F10; }
.dash-rows { display: flex; flex-direction: column; }
.dash-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid #F1F3F8;
    font-size: 12.5px; font-weight: 600; min-width: 0; }
.dash-row > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row .when { color: #98A2B1; white-space: nowrap; flex: none; }
.dash-ok { font-size: 12.5px; font-weight: 700; color: #1FA971; }
.dash-link { margin-top: auto; font-size: 12px; font-weight: 800; color: #1E63E0; text-decoration: none; }
.dash-card.untracked { background: #F8FAFE; border-style: dashed; }
.dash-card.untracked .dash-count { font-size: 11px; letter-spacing: .3px; text-transform: uppercase; color: #98A2B1; }
.dash-card code, .note code { font-size: 11px; background: #F3F5FA; border-radius: 6px; padding: 1px 5px; }

/* Satırdaki kullanıcı adı → kullanıcı sayfası. */
.user-link { color: #164FC4; text-decoration: none; }
.user-link:hover { text-decoration: underline; }
