/*
 * Yönetim paneli tasarım sistemi (framework'süz).
 *
 * Bootstrap kaldırıldı; görünümlerin kullandığı sınıf alt kümesi burada
 * aynı adlarla yeniden implemente edildi (grid, utilities, card, btn,
 * form, table, badge, alert, pagination) + panele özgü bileşenler
 * (sidebar, topbar, stat-card, tabs, switch, auth ekranı).
 *
 * Tema rengi dinamiktir: layout'lar settings'ten gelen değeri
 * :root{--theme-color:...} inline stiliyle basar ve buradaki
 * varsayılanı ezer.
 *
 * Bölümler:
 *   1. Tokens          7. Card             13. Tabs
 *   2. Reset/base      8. Button           14. Pagination
 *   3. Tipografi       9. Form             15. Spinner
 *   4. Grid           10. Table            16. Auth ekranı
 *   5. Utilities      11. Badge            17. 3. parti override
 *   6. Yerleşim       12. Alert            18. Animasyon / mobil
 */

/* ------------------------------------------------------------------
   1. Tokens
------------------------------------------------------------------ */
:root {
    /* Marka — sihirbaz-bilisim.png logosundan örneklenen turuncu */
    --theme-color: #F39200;
    --theme-dark: color-mix(in srgb, var(--theme-color) 82%, black);
    --theme-soft: color-mix(in srgb, var(--theme-color) 12%, white);

    /* Yüzeyler */
    --bg-body: #f3f5f8;
    --bg-card: #ffffff;
    --bg-subtle: #f8f9fb;
    --sidebar-bg: #131c2e;
    --sidebar-bg-2: #0e1524;
    --sidebar-text: #94a3b8;
    --sidebar-border: rgba(255, 255, 255, 0.07);

    /* Metin */
    --text: #1e2430;
    --text-muted: #6b7280;
    --text-muted-2: #8b8f98;

    /* Durum renkleri */
    --success: #059669;  --success-bg: #ecfdf5;
    --danger:  #dc2626;  --danger-bg:  #fef2f2;
    --warning: #ca8a04;  --warning-bg: #fefce8;
    --info:    #2563eb;  --info-bg:    #eff6ff;
    --neutral: #6b7280;  --neutral-bg: #f3f4f6;
    --orange:  #ea580c;  --orange-bg:  #fff7ed;

    /* Şekil / gölge */
    --border: #e5e8ee;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.16);
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--theme-color) 22%, transparent);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ------------------------------------------------------------------
   2. Reset / base
------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5rem; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 1rem; }
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--theme-color); text-decoration: none; }
a:hover { color: var(--theme-dark); }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; }
label { display: inline-block; }
ul { margin: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; opacity: 1; }
code { font-size: 0.85em; color: #b45309; word-wrap: break-word; }
strong, b { font-weight: 600; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------
   3. Tipografi
------------------------------------------------------------------ */
.h4 { font-size: 1.3rem; font-weight: 600; }
.h6 { font-size: 0.95rem; font-weight: 600; }
.display-6 { font-size: 2.2rem; font-weight: 700; line-height: 1.2; }
.fs-2 { font-size: 1.7rem; }
.fs-6 { font-size: 0.95rem; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
small, .small { font-size: 0.855em; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-decoration-line-through { text-decoration: line-through !important; }

/* ------------------------------------------------------------------
   4. Grid (kullanılan alt küme)
------------------------------------------------------------------ */
.row {
    --gx: 1.5rem;
    --gy: 0;
    display: flex;
    flex-wrap: wrap;
    margin: calc(var(--gy) / -2) calc(var(--gx) / -2);
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding: calc(var(--gy) / 2) calc(var(--gx) / 2);
}

.g-2 { --gx: 0.5rem; --gy: 0.5rem; }
.g-3 { --gx: 1rem; --gy: 1rem; }

.col-6  { flex: 0 0 auto; width: 50%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.3333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-8 { flex: 0 0 auto; width: 66.6667%; }
}

@media (min-width: 992px) {
    .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
}

@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
}

/* Row dışında form genişliği sınırlamak için (settings) */
.form-narrow { max-width: 560px; }
.form-wide { max-width: 760px; }

/* ------------------------------------------------------------------
   5. Utilities
------------------------------------------------------------------ */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.flex-column { flex-direction: column !important; }
.flex-fill { flex: 1 1 auto !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.m-0  { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }

.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.ps-4 { padding-left: 1.5rem !important; }
.pe-4 { padding-right: 1.5rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

@media (min-width: 768px) {
    .p-md-5 { padding: 3rem !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
}

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.bg-white { background-color: #fff !important; }
.bg-light { background-color: var(--bg-subtle) !important; }
.border { border: 1px solid var(--border) !important; }
.border-0 { border: 0 !important; }
.border-end-0 { border-right: 0 !important; }
.border-start-0 { border-left: 0 !important; }
.rounded-3 { border-radius: var(--radius) !important; }
.rounded-4 { border-radius: var(--radius-lg) !important; }
.rounded-pill { border-radius: var(--radius-pill) !important; }
.shadow-soft { box-shadow: var(--shadow-soft) !important; }

/* ------------------------------------------------------------------
   6. Yerleşim: sidebar + topbar + içerik
------------------------------------------------------------------ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 256px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    padding: 0 0.9rem 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 0.5rem;
    margin: 0 -0.9rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand img {
    height: 40px;
    width: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav .nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-item .bi {
    font-size: 1.05rem;
    opacity: 0.9;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: color-mix(in srgb, var(--theme-color) 16%, transparent);
    color: #fff;
}

.sidebar-nav .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: var(--radius-pill);
    background: var(--theme-color);
}

.sidebar-nav .nav-item.active .bi {
    color: var(--theme-color);
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.9rem 0;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.72rem;
    color: color-mix(in srgb, var(--sidebar-text) 65%, transparent);
    text-align: center;
    letter-spacing: 0.02em;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content {
    padding: 1.75rem;
    max-width: 1400px;
    width: 100%;
}

/* ------------------------------------------------------------------
   7. Card + stat-card
------------------------------------------------------------------ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.card-body { padding: 1.25rem; }

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
}

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.9rem;
}

.stat-card .stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-muted-2);
    font-size: 0.85rem;
}

/* ------------------------------------------------------------------
   8. Button
------------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    background: transparent;
    color: var(--text);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.6; pointer-events: none; }

.btn-primary {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
}

.btn-primary:hover, .btn-primary:active {
    background: var(--theme-dark);
    border-color: var(--theme-dark);
    color: #fff;
}

.btn-light {
    background: #f1f3f7;
    border-color: #f1f3f7;
    color: var(--text);
}

.btn-light:hover { background: #e6e9f0; border-color: #e6e9f0; }

.btn-outline-secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-outline-secondary:hover {
    background: var(--bg-subtle);
    border-color: #d3d8e2;
    color: var(--text);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--theme-color);
    color: var(--theme-color);
}

.btn-outline-primary:hover {
    background: var(--theme-color);
    color: #fff;
}

.btn-outline-danger {
    background: transparent;
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.82rem; }
.btn-lg { padding: 0.65rem 1.2rem; font-size: 1rem; }

/* Kopyalama butonu geri bildirimi */
.btn-copied {
    background: var(--success-bg) !important;
    color: var(--success) !important;
    border-color: #a7f3d0 !important;
}

/* ------------------------------------------------------------------
   9. Form
------------------------------------------------------------------ */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #fff;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    outline: 0;
    border-color: var(--theme-color);
    box-shadow: var(--focus-ring);
}

.form-control::placeholder { color: var(--text-muted-2); }
.form-control:disabled, .form-select:disabled { background: var(--bg-subtle); opacity: 1; }

.form-select:not([multiple]) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 12px;
    padding-right: 2.25rem;
}

.form-control-sm, .form-select-sm { padding: 0.3rem 0.55rem; font-size: 0.84rem; }
.form-select-sm:not([multiple]) { padding-right: 2rem; }

.form-control-color {
    width: 3.2rem;
    height: 2.55rem;
    padding: 0.25rem;
    cursor: pointer;
}

.form-control-color::-webkit-color-swatch { border: 0; border-radius: 6px; }
.form-control-color::-moz-color-swatch { border: 0; border-radius: 6px; }

.form-text {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Doğrulama */
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.invalid-feedback {
    display: none;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--danger);
}

.invalid-feedback.d-block { display: block; }

/* Input group */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.92rem;
    white-space: nowrap;
}

.input-group > :not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > :first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group > :last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group > :only-child { border-radius: var(--radius); }
.input-group > .form-control:focus { z-index: 3; }

.input-group-lg > .form-control,
.input-group-lg > .input-group-text {
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
}

/* Checkbox / switch */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 1.5rem;
}

.form-check-input {
    appearance: none;
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    border: 1px solid #cbd2dd;
    border-radius: 4px;
    background: #fff no-repeat center / contain;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.form-check-input:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

.form-check-input:checked {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m5 10.5 3.5 3.5L15 7'/%3e%3c/svg%3e");
}

.form-check-label { cursor: pointer; }

.form-switch .form-check-input {
    width: 2.2rem;
    height: 1.25rem;
    border-radius: var(--radius-pill);
    background: #d6dae2;
    border-color: #d6dae2;
    position: relative;
}

.form-switch .form-check-input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.25rem - 6px);
    height: calc(1.25rem - 6px);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.18s ease;
}

.form-switch .form-check-input:checked {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
    background-image: none;
}

.form-switch .form-check-input:checked::after {
    transform: translateX(0.95rem);
}

/* Tutar girişi: ortalanmış, büyük, yanında küçük para birimi */
.amount-hero {
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
}

.amount-hero .form-label {
    display: block;
    text-align: center;
}

.amount-hero .amount-group {
    position: relative;
    max-width: 280px;
    margin: 0 auto;
}

.amount-hero .amount-input {
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    /* Simetrik iç boşluk: ₺ simgesi sağda içeride, metin ortada kalır */
    padding: 0.5rem 2.2rem;
}

.amount-hero .amount-currency {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

/* Ortalanmış dar form blokları (tutar altındaki taksit/tarih alanları) */
.form-stack {
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
}

.form-stack .form-label {
    display: block;
    text-align: center;
}

.form-stack .form-control { text-align: center; }

.stack-narrow {
    max-width: 280px;
    margin: 0 auto;
}

/* İsteğe bağlı alanlar: ayrılmış, katlanabilir bölüm */
.optional-section {
    margin-top: 1.75rem;
    border-top: 1px dashed var(--border);
    padding-top: 1rem;
}

.optional-section > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

.optional-section > summary::-webkit-details-marker { display: none; }

.optional-section > summary:hover { color: var(--text); }

.optional-section > summary .bi-chevron-down {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.optional-section[open] > summary .bi-chevron-down { transform: rotate(180deg); }

.optional-section > .optional-body { margin-top: 1rem; }

/* ------------------------------------------------------------------
   10. Table
------------------------------------------------------------------ */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table thead th {
    font-weight: 600;
    color: var(--text-muted);
}

.table tbody tr:last-child td { border-bottom: 0; }
.table.align-middle th, .table.align-middle td { vertical-align: middle; }
.table-hover tbody tr { transition: background 0.12s ease; }
.table-hover tbody tr:hover { background: var(--bg-subtle); }
.table-sm th, .table-sm td { padding: 0.4rem 0.5rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Kart içindeki tablolar */
.table-card .table { margin-bottom: 0; }

.table-card thead th {
    background: #fafbfc;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.table-card tbody td { vertical-align: middle; }

/* ------------------------------------------------------------------
   11. Badge
------------------------------------------------------------------ */
.badge {
    display: inline-block;
    padding: 0.35em 0.7em;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Durum rozetleri */
.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4em 0.75em;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.badge-status.st-active     { background: var(--success-bg); color: var(--success); }
.badge-status.st-passive    { background: var(--neutral-bg); color: var(--neutral); }
.badge-status.st-paid       { background: var(--success-bg); color: var(--success); }
.badge-status.st-expired    { background: var(--orange-bg); color: var(--orange); }
.badge-status.st-processing { background: var(--warning-bg); color: var(--warning); }
.badge-status.st-success    { background: var(--success-bg); color: var(--success); }
.badge-status.st-failed,
.badge-status.st-error      { background: var(--danger-bg); color: var(--danger); }
.badge-status.st-pending    { background: var(--warning-bg); color: var(--warning); }

/* ------------------------------------------------------------------
   12. Alert
------------------------------------------------------------------ */
.alert {
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.alert .bi { flex-shrink: 0; }

.alert-danger  { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 18%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.alert-info    { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 16%, transparent); }
.alert-light   { background: var(--bg-subtle); color: var(--text-muted); border-color: var(--border); }

/* ------------------------------------------------------------------
   13. Tabs (Bootstrap pill tabs yerine)
------------------------------------------------------------------ */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    list-style: none;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn:hover { background: #f1f3f7; color: var(--text); }

.tab-btn.active {
    background: var(--theme-color);
    color: #fff;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.25s ease; }

/* ------------------------------------------------------------------
   14. Pagination
------------------------------------------------------------------ */
.pagination {
    display: flex;
    gap: 0.3rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.page-link {
    display: block;
    padding: 0.3rem 0.68rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-link:hover { background: var(--bg-subtle); color: var(--text); }

.page-item.active .page-link {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
}

.page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }

/* ------------------------------------------------------------------
   15. Spinner
------------------------------------------------------------------ */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------
   16. Auth ekranı (login)
------------------------------------------------------------------ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(900px 500px at 75% -10%, #23334f 0%, transparent 60%),
        radial-gradient(700px 500px at -10% 110%, color-mix(in srgb, var(--theme-color) 14%, transparent) 0%, transparent 55%),
        linear-gradient(160deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 70%, #0a101d 100%);
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo img { height: 48px; }

.auth-card {
    box-shadow: var(--shadow-pop);
}

.auth-card .input-group-text {
    background: var(--bg-subtle);
    border-right: 0;
    color: var(--text-muted-2);
}

.auth-card .input-group > .form-control { border-left: 0; }

.auth-card .input-group:focus-within .input-group-text {
    border-color: var(--theme-color);
    color: var(--theme-color);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------
   17. Üçüncü parti override'lar
------------------------------------------------------------------ */
/* Tom Select — default tema üzerine panel görünümü */
.ts-wrapper.form-select { padding: 0; border: 0; background-image: none; box-shadow: none; }

.ts-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text);
    background: #fff;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--theme-color);
    box-shadow: var(--focus-ring);
}

.ts-wrapper.single .ts-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 12px;
    padding-right: 2.25rem;
}

.ts-wrapper.single .ts-control::after { display: none; }

/* Küçük varyant (form-select-sm ile açılan Tom Select) */
.ts-wrapper.form-select-sm .ts-control {
    padding: 0.3rem 0.55rem;
    font-size: 0.84rem;
    min-height: calc(1.5em + 0.6rem + 2px);
}

.ts-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    font-size: 0.92rem;
    margin-top: 4px;
}

.ts-dropdown .option { padding: 0.45rem 0.75rem; }
.ts-dropdown .active { background: var(--theme-soft); color: var(--text); }
.ts-dropdown .selected { background: var(--theme-color); color: #fff; }

.ts-wrapper.multi .ts-control > .item {
    background: var(--theme-soft);
    color: var(--theme-dark);
    border-radius: 6px;
    padding: 0.1rem 0.45rem;
    font-weight: 500;
}

.ts-wrapper.multi .ts-control > .item .remove {
    border-left: 1px solid color-mix(in srgb, var(--theme-color) 25%, transparent);
    color: inherit;
}

.ts-wrapper.multi .ts-control > .item .remove:hover { background: color-mix(in srgb, var(--theme-color) 20%, transparent); }

/* Flatpickr — seçili gün tema rengi */
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--theme-color);
    border-color: var(--theme-color);
}

.flatpickr-day.today { border-color: var(--theme-color); }
.flatpickr-day.today:hover { background: var(--theme-soft); color: var(--text); }
.flatpickr-calendar { border-radius: var(--radius); box-shadow: var(--shadow-pop); font-family: var(--font); }

/* SweetAlert2 */
.swal2-popup { font-family: var(--font) !important; border-radius: var(--radius-lg) !important; }
.swal2-styled { border-radius: var(--radius) !important; }
.swal2-styled.swal2-confirm:focus, .swal2-styled.swal2-cancel:focus { box-shadow: var(--focus-ring) !important; }

/* ------------------------------------------------------------------
   18. Animasyon + mobil
------------------------------------------------------------------ */
.fade-in { animation: fadeIn 0.35s ease both; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1040;
        transform: translateX(-100%);
        box-shadow: var(--shadow-pop);
    }

    .sidebar.open { transform: translateX(0); }

    .content { padding: 1.25rem; }
}
