/* ==========================================================================
   SORGULAMA ZAMANI - PROFESYONEL YÖNETİM PANELİ (ADMIN) STİL DOSYASI
   %100 Mobil Uyumlu • Modern Karanlık/Aydınlık Dashboard Mimarisi
   ========================================================================== */

:root {
    --adm-bg: #f8fafc;
    --adm-sidebar: #0f172a;
    --adm-sidebar-hover: #1e293b;
    --adm-card: #ffffff;
    --adm-text: #0f172a;
    --adm-muted: #64748b;
    --adm-border: #e2e8f0;
    --adm-primary: #0f2b48;
    --adm-primary-hover: #1e3a8a;
    --adm-success: #059669;
    --adm-warning: #d97706;
    --adm-danger: #dc2626;
    --adm-radius: 8px;
    --adm-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--adm-font);
    background-color: var(--adm-bg);
    color: var(--adm-text);
    line-height: 1.55;
    min-height: 100vh;
}

/* Giriş Ekranı */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: #0f172a;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: var(--adm-radius);
    padding: 2.25rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--adm-radius);
    background: #0f2b48;
    border: 2px solid #b38728;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0 auto 1rem;
}

/* Panel Ana İskeleti */
.admin-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--adm-sidebar);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--adm-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

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

.nav-item-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s;
}

.nav-item-btn:hover {
    background: var(--adm-sidebar-hover);
    color: #ffffff;
}

.nav-item-btn.active {
    background: var(--adm-primary);
    color: #ffffff;
}

.nav-badge {
    background: rgba(255,255,255,0.16);
    color: #fff;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Sağ İçerik Alanı */
.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    background: var(--adm-card);
    border-bottom: 1px solid var(--adm-border);
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-content {
    padding: 1.5rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* İstatistik Kartları */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card .stat-val {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--adm-text);
    line-height: 1.15;
}

.stat-card .stat-lbl {
    font-size: 0.8rem;
    color: var(--adm-muted);
    font-weight: 600;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--adm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* Filtre ve Arama Araç Çubuğu */
.crud-toolbar {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    flex: 1;
}

.adm-input, .adm-select, .adm-textarea {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    background: #fff;
    color: var(--adm-text);
}

.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
    outline: none;
    border-color: var(--adm-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Tablo Kartları */
.table-card {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.87rem;
}

.adm-table th {
    background: #f8fafc;
    color: var(--adm-muted);
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--adm-border);
    white-space: nowrap;
}

.adm-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--adm-border);
    vertical-align: middle;
}

.adm-table tr:hover td {
    background: #f8fafc;
}

/* Durum Rozetleri */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 700;
}

.status-pill.green { background: #dcfce7; color: #15803d; }
.status-pill.yellow { background: #fef3c7; color: #b45309; }
.status-pill.red { background: #fee2e2; color: #b91c1c; }
.status-pill.blue { background: #dbeafe; color: #1d4ed8; }
.status-pill.purple { background: #f3e8ff; color: #7e22ce; }

/* Butonlar */
.adm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.52rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.adm-btn-primary { background: var(--adm-primary); color: #fff; }
.adm-btn-primary:hover { background: var(--adm-primary-hover); }
.adm-btn-success { background: var(--adm-success); color: #fff; }
.adm-btn-danger { background: #fee2e2; color: #b91c1c; }
.adm-btn-danger:hover { background: var(--adm-danger); color: #fff; }
.adm-btn-outline { background: #fff; border-color: var(--adm-border); color: var(--adm-text); }
.adm-btn-outline:hover { background: #f8fafc; }
.adm-btn-xs { padding: 0.3rem 0.6rem; font-size: 0.76rem; border-radius: 6px; }

/* Modal */
.adm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.adm-modal-backdrop.open {
    display: flex;
}

.adm-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 840px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
}

.upload-inline-group {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.upload-inline-group input[type="text"],
.upload-inline-group input[type="url"] {
    flex: 1;
}

.upload-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.52rem 0.85rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.upload-btn-label:hover {
    background: #dbeafe;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px solid var(--adm-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.rich-tool-btn {
    padding: 0.32rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--adm-border);
    background: #ffffff;
    color: var(--adm-text);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.rich-tool-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--adm-primary);
}

.adm-modal-header {
    padding: 1rem 1.35rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.adm-modal-body {
    padding: 1.35rem;
    overflow-y: auto;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-field {
    margin-bottom: 0.9rem;
}

.form-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.3rem;
}

.form-field input, .form-field select, .form-field textarea {
    width: 100%;
}

.mobile-sidebar-btn {
    display: none;
}

/* Mobil Kenar Çubuğu Perdesi */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.open {
    display: block;
    opacity: 1;
}

/* Mobil Uyumluluk */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .admin-sidebar {
        position: fixed;
        left: -290px;
        top: 0;
        bottom: 0;
        width: 275px;
        z-index: 1050;
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    }
    .admin-sidebar.open {
        left: 0;
    }
    .mobile-sidebar-btn {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    .admin-content {
        padding: 0.85rem;
    }
    .admin-topbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    .crud-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex-direction: column;
    }
}

/* ==========================================================================
   DISCORD-STYLE ROLE & PERMISSION (RBAC) STYLES
   ========================================================================== */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.role-badge-yonetici {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.role-badge-editor {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.role-badge-hakem {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.role-badge-yazar {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.role-badge-medya {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

.role-badge-moderator {
    background: #ecfeff;
    color: #0e7490;
    border-color: #a5f3fc;
}

.role-badge-ozel {
    background: #fdf4ff;
    color: #a21caf;
    border-color: #f5d0fe;
}

.role-badge-uye {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

/* Discord Rol Yönetim Modalı Kartları */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 4px;
}

.perm-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.perm-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.perm-card.active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px #3b82f6;
}

.perm-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #2563eb;
    cursor: pointer;
}

.perm-card-content {
    flex: 1;
}

.perm-card-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.perm-card-desc {
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 0.15rem;
    line-height: 1.35;
}

.role-preset-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.role-preset-banner .user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}


