/*
 * Yönetim paneli — shadcn/ui görünüm katmanı (site özel).
 * ------------------------------------------------------------------
 * Çekirdeğin SCSS'ine dokunulmaz; panel Bootstrap 5 ile geldiği için
 * Bootstrap'in CSS değişkenleri shadcn token'larına eşlenir ve panelin
 * kendi bileşenleri (sidebar, kart, tablo, form) aynı dile çekilir.
 * Böylece çekirdek güncellemeleri (upstream merge) bu dosyayı bozmaz.
 */

:root {
    --sh-background: #ffffff;
    --sh-foreground: #09090b;
    --sh-card: #ffffff;
    --sh-muted: #fafafa;
    --sh-muted-foreground: #71717a;
    --sh-secondary: #f4f4f5;
    --sh-border: #e4e4e7;
    --sh-primary: #16a34a;
    --sh-primary-hover: #15803d;
    --sh-primary-foreground: #ffffff;
    --sh-primary-soft: rgba(22, 163, 74, .08);
    --sh-ring: rgba(22, 163, 74, .3);
    --sh-radius: 10px;
    --sh-radius-sm: 6px;
    --sh-radius-lg: 14px;
    --sh-shadow-xs: 0 1px 2px rgba(9, 9, 11, .04);
    --sh-shadow-sm: 0 1px 3px rgba(9, 9, 11, .06), 0 1px 2px rgba(9, 9, 11, .04);
    --sh-shadow-md: 0 8px 24px rgba(9, 9, 11, .07);

    /* Bootstrap eşlemesi */
    --bs-body-bg: var(--sh-muted);
    --bs-body-color: #3f3f46;
    --bs-body-font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-border-color: var(--sh-border);
    --bs-border-radius: var(--sh-radius);
    --bs-border-radius-sm: var(--sh-radius-sm);
    --bs-border-radius-lg: var(--sh-radius-lg);
    --bs-primary: var(--sh-primary);
    --bs-primary-rgb: 22, 163, 74;
    --bs-link-color: var(--sh-primary);
    --bs-link-hover-color: var(--sh-primary-hover);
    --bs-secondary-color: var(--sh-muted-foreground);
    --bs-tertiary-bg: var(--sh-secondary);
    --bs-heading-color: var(--sh-foreground);
}

body {
    background: var(--sh-muted) !important;
    color: #3f3f46;
    font-family: var(--bs-body-font-family) !important;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--sh-foreground);
    font-weight: 600;
    letter-spacing: -.02em;
}

a { text-decoration: none; }

/* ---------- Kenar çubuğu ---------- */
.cms-sidebar {
    background: var(--sh-background) !important;
    border-right: 1px solid var(--sh-border) !important;
}
.cms-sidebar .cms-brand { color: var(--sh-foreground) !important; font-weight: 600; letter-spacing: -.02em; }

.cms-sidebar .nav-section {
    padding: 16px 12px 6px !important;
    color: var(--sh-muted-foreground) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase;
}

.cms-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 8px 12px !important;
    margin-bottom: 1px;
    border-radius: var(--sh-radius) !important;
    color: var(--sh-muted-foreground) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: background-color .15s ease, color .15s ease;
}
.cms-sidebar .nav-link .bi { color: var(--sh-muted-foreground) !important; font-size: 15px; }
.cms-sidebar .nav-link:hover { background: var(--sh-secondary) !important; color: var(--sh-foreground) !important; }
.cms-sidebar .nav-link:hover .bi { color: var(--sh-foreground) !important; }

.cms-sidebar .nav-pills > .nav-item > .nav-link.active,
.cms-sidebar .nav-link.active {
    background: var(--sh-secondary) !important;
    color: var(--sh-foreground) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}
.cms-sidebar .nav-pills > .nav-item > .nav-link.active::before { display: none !important; }
.cms-sidebar .nav-link.active .bi { color: var(--sh-primary) !important; }
.cms-sidebar .nav.collapse .nav-link { font-size: 13.5px !important; padding: 7px 12px !important; }

/* ---------- Üst çubuk ---------- */
.cms-topbar, .navbar {
    background: var(--sh-background) !important;
    border-bottom: 1px solid var(--sh-border) !important;
    box-shadow: none !important;
}

.breadcrumb { font-size: 13.5px; margin-bottom: 0; }
.breadcrumb-item, .breadcrumb-item a { color: var(--sh-muted-foreground); }
.breadcrumb-item.active { color: var(--sh-foreground); }

/* ---------- Kart ---------- */
.card {
    background: var(--sh-card);
    border: 1px solid var(--sh-border) !important;
    border-radius: var(--sh-radius-lg) !important;
    box-shadow: var(--sh-shadow-xs) !important;
}
.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--sh-border) !important;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--sh-foreground);
}
.card-body { padding: 18px; }
.card-footer { background: transparent !important; border-top: 1px solid var(--sh-border) !important; }

/* ---------- Butonlar ---------- */
.btn {
    --bs-btn-border-radius: var(--sh-radius);
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--sh-radius) !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--sh-ring) !important; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 10px 18px; font-size: 15px; }

.btn-primary {
    --bs-btn-bg: var(--sh-primary);
    --bs-btn-border-color: var(--sh-primary);
    --bs-btn-color: var(--sh-primary-foreground);
    --bs-btn-hover-bg: var(--sh-primary-hover);
    --bs-btn-hover-border-color: var(--sh-primary-hover);
    --bs-btn-hover-color: var(--sh-primary-foreground);
    --bs-btn-active-bg: var(--sh-primary-hover);
    --bs-btn-active-border-color: var(--sh-primary-hover);
    --bs-btn-disabled-bg: var(--sh-primary);
    --bs-btn-disabled-border-color: var(--sh-primary);
}
.btn-primary:hover, .btn-primary:hover i { color: var(--sh-primary-foreground) !important; }

.btn-outline-secondary, .btn-outline-primary, .btn-outline-dark {
    --bs-btn-color: var(--sh-foreground);
    --bs-btn-border-color: var(--sh-border);
    --bs-btn-bg: var(--sh-background);
    --bs-btn-hover-bg: var(--sh-secondary);
    --bs-btn-hover-border-color: var(--sh-border);
    --bs-btn-hover-color: var(--sh-foreground);
    --bs-btn-active-bg: var(--sh-secondary);
    --bs-btn-active-color: var(--sh-foreground);
    --bs-btn-active-border-color: var(--sh-border);
}
.btn-outline-primary { --bs-btn-color: var(--sh-primary); --bs-btn-hover-color: var(--sh-primary-hover); }

.btn-light, .btn-secondary {
    --bs-btn-bg: var(--sh-secondary);
    --bs-btn-border-color: var(--sh-border);
    --bs-btn-color: var(--sh-foreground);
    --bs-btn-hover-bg: #e9e9ec;
    --bs-btn-hover-border-color: var(--sh-border);
    --bs-btn-hover-color: var(--sh-foreground);
}

.btn-danger, .btn-outline-danger { --bs-btn-border-radius: var(--sh-radius); }
.btn-link { color: var(--sh-muted-foreground); }
.btn-link:hover { color: var(--sh-foreground); }

/* ---------- Form ---------- */
.form-label { color: var(--sh-foreground); font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.form-text { color: var(--sh-muted-foreground); font-size: 12.5px; }

.form-control, .form-select {
    padding: 8px 12px;
    background: var(--sh-background);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    color: var(--sh-foreground);
    font-size: 14px;
    box-shadow: none;
}
.form-control::placeholder { color: var(--sh-muted-foreground); }
.form-control:focus, .form-select:focus {
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px var(--sh-ring);
}
.form-control:disabled, .form-select:disabled { background: var(--sh-secondary); }

.input-group-text {
    background: var(--sh-secondary);
    border-color: var(--sh-border);
    color: var(--sh-muted-foreground);
    font-size: 13.5px;
    border-radius: var(--sh-radius);
}

.form-check-input { border-color: var(--sh-border); }
.form-check-input:checked { background-color: var(--sh-primary); border-color: var(--sh-primary); }
.form-check-input:focus { border-color: var(--sh-primary); box-shadow: 0 0 0 3px var(--sh-ring); }
.form-check-label { font-size: 14px; }

/* ---------- Tablo ---------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--sh-border);
    --bs-table-hover-bg: var(--sh-muted);
    margin-bottom: 0;
    font-size: 14px;
}
.table > thead {
    background: transparent;
}
.table > thead th {
    padding: 11px 14px;
    background: var(--sh-muted) !important;
    border-bottom: 1px solid var(--sh-border) !important;
    color: var(--sh-muted-foreground) !important;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}
.table > tbody td { padding: 12px 14px; border-color: var(--sh-border); vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background: var(--sh-muted); }
.table code { background: var(--sh-secondary); border: 1px solid var(--sh-border); border-radius: var(--sh-radius-sm); padding: 2px 6px; font-size: 12.5px; color: var(--sh-foreground); }

/* ---------- Rozet ---------- */
.badge {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}
.text-bg-success { background: var(--sh-primary-soft) !important; color: #15803d !important; border-color: rgba(22, 163, 74, .25); }
.text-bg-secondary { background: var(--sh-secondary) !important; color: var(--sh-muted-foreground) !important; border-color: var(--sh-border); }
.text-bg-warning { background: rgba(245, 158, 11, .12) !important; color: #b45309 !important; border-color: rgba(245, 158, 11, .28); }
.text-bg-danger { background: rgba(239, 68, 68, .1) !important; color: #b91c1c !important; border-color: rgba(239, 68, 68, .25); }
.text-bg-primary { background: var(--sh-primary-soft) !important; color: #15803d !important; border-color: rgba(22, 163, 74, .25); }

/* ---------- Uyarılar ---------- */
.alert {
    border-radius: var(--sh-radius);
    border: 1px solid var(--sh-border);
    background: var(--sh-background);
    color: var(--sh-foreground);
    font-size: 14px;
    padding: 12px 14px;
}
.alert-success { border-color: rgba(22, 163, 74, .3); background: var(--sh-primary-soft); }
.alert-danger { border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .06); color: #b91c1c; }
.alert-warning { border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .07); color: #92400e; }
.alert-info { border-color: var(--sh-border); background: var(--sh-secondary); }

/* ---------- Açılır menü / modal / offcanvas ---------- */
.dropdown-menu {
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow-md);
    padding: 5px;
    font-size: 14px;
}
.dropdown-item { border-radius: var(--sh-radius-sm); padding: 7px 10px; color: var(--sh-foreground); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--sh-secondary); }
.dropdown-divider { border-color: var(--sh-border); }

.modal-content { border: 1px solid var(--sh-border); border-radius: var(--sh-radius-lg); box-shadow: var(--sh-shadow-md); }
.modal-header, .modal-footer { border-color: var(--sh-border); }

.offcanvas { border-color: var(--sh-border) !important; }

/* ---------- Sayfalama ---------- */
.pagination { --bs-pagination-border-radius: var(--sh-radius); gap: 4px; }
.page-link {
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius) !important;
    color: var(--sh-foreground);
    font-size: 13.5px;
    padding: 6px 11px;
}
.page-link:hover { background: var(--sh-secondary); color: var(--sh-foreground); }
.active > .page-link { background: var(--sh-primary); border-color: var(--sh-primary); color: #fff; }
.disabled > .page-link { color: var(--sh-muted-foreground); background: var(--sh-background); }

/* ---------- Sekmeler ---------- */
.nav-tabs { border-bottom: 1px solid var(--sh-border); gap: 2px; }
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--sh-muted-foreground);
    font-size: 14px;
    font-weight: 500;
    padding: 9px 12px;
}
.nav-tabs .nav-link:hover { color: var(--sh-foreground); border-bottom-color: var(--sh-border); }
.nav-tabs .nav-link.active { color: var(--sh-foreground); background: transparent; border-bottom-color: var(--sh-primary); }

/* ---------- Diğer ---------- */
.list-group-item { border-color: var(--sh-border); font-size: 14px; }
.progress { background: var(--sh-secondary); border-radius: 999px; }
.progress-bar { background: var(--sh-primary); }
.text-secondary, .text-muted { color: var(--sh-muted-foreground) !important; }
.border { border-color: var(--sh-border) !important; }
.bg-light { background: var(--sh-muted) !important; }
.bg-white { background: var(--sh-background) !important; }
.shadow-sm { box-shadow: var(--sh-shadow-xs) !important; }
.shadow { box-shadow: var(--sh-shadow-sm) !important; }
.rounded, .rounded-3 { border-radius: var(--sh-radius) !important; }
.toast { border: 1px solid var(--sh-border); border-radius: var(--sh-radius); box-shadow: var(--sh-shadow-md); }

/* Panelde kullanılan istatistik kutuları */
.stat-card, .cms-stat {
    background: var(--sh-card);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-lg);
    box-shadow: var(--sh-shadow-xs);
}

/* Giriş ekranı */
body.cms-login, .auth-wrapper { background: var(--sh-muted) !important; }

/* Eski sarı tema artıkları (link/rozet/sayfalama) yeşil vurguya çekilir. */
a { color: var(--sh-primary); }
a:hover { color: var(--sh-primary-hover); }
.text-primary { color: var(--sh-primary) !important; }
.bg-primary, .badge.bg-primary { background-color: var(--sh-primary) !important; color: #fff !important; }
.page-item.active .page-link { background-color: var(--sh-primary); border-color: var(--sh-primary); color: #fff; }
.cms-sidebar .nav-pills > .nav-item > .nav-link.active .bi { color: var(--sh-primary) !important; }
.btn-outline-primary { --bs-btn-color: var(--sh-primary); --bs-btn-hover-bg: var(--sh-primary); --bs-btn-hover-border-color: var(--sh-primary); --bs-btn-hover-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--sh-primary); box-shadow: 0 0 0 3px var(--sh-ring); }


/*
 * Koyu varyant — site ile aynı dil. Üye alanı (giriş/panel) bu bayrakla açılır:
 * <html data-shadcn="dark">. Yönetim paneli açık kalır.
 */
html[data-shadcn="dark"] {
    --sh-background: #09090b;
    --sh-foreground: #fafafa;
    --sh-card: #121214;
    --sh-muted: #0e0e10;
    --sh-muted-foreground: #a1a1aa;
    --sh-secondary: #1c1c1f;
    --sh-border: #27272a;
    --sh-primary: #22c55e;
    --sh-primary-hover: #16a34a;
    --sh-primary-foreground: #052e16;
    --sh-primary-soft: rgba(34, 197, 94, .12);
    --sh-ring: rgba(34, 197, 94, .35);
    --sh-shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
    --sh-shadow-sm: 0 1px 3px rgba(0, 0, 0, .55);
    --sh-shadow-md: 0 8px 24px rgba(0, 0, 0, .6);

    --bs-body-bg: var(--sh-background);
    --bs-body-color: #d4d4d8;
    --bs-emphasis-color: var(--sh-foreground);
    color-scheme: dark;
}
html[data-shadcn="dark"] body { background: var(--sh-background) !important; color: #d4d4d8; }
html[data-shadcn="dark"] .form-control,
html[data-shadcn="dark"] .form-select { background: var(--sh-card); color: var(--sh-foreground); }
html[data-shadcn="dark"] .form-control::placeholder { color: var(--sh-muted-foreground); }
html[data-shadcn="dark"] .form-check-input { background-color: var(--sh-card); border-color: var(--sh-border); }
html[data-shadcn="dark"] .form-check-input:checked { background-color: var(--sh-primary); border-color: var(--sh-primary); }
html[data-shadcn="dark"] .btn-primary { --bs-btn-color: var(--sh-primary-foreground); --bs-btn-hover-color: var(--sh-primary-foreground); }
html[data-shadcn="dark"] .text-bg-success { color: #4ade80 !important; }
html[data-shadcn="dark"] .text-bg-warning { color: #fbbf24 !important; }
html[data-shadcn="dark"] .alert-danger { color: #fca5a5; }
