/* ==========================================================================
   SON KALE - EMNİYET GENEL MÜDÜRLÜĞÜ PERSONEL ŞUBE DAİRESİ BAŞKANLIĞI
   MODERN & ULTRA-PREMIUM TACTICAL STYLING SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Core Palette - Tactical Midnight EGM */
    --bg-dark: #070a11;
    --bg-body: #0a0f1d;
    --bg-sidebar: #080d1a;
    --bg-card: rgba(14, 22, 39, 0.75);
    --bg-card-hover: rgba(22, 34, 58, 0.85);
    --bg-card-solid: #0e1627;
    --bg-input: rgba(10, 16, 30, 0.8);
    --bg-modal: #0d1527;
    --bg-glass: rgba(13, 21, 38, 0.7);

    /* Tactical Accent Colors */
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);
    
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.3);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    
    --warning: #f97316;
    --warning-glow: rgba(249, 115, 22, 0.25);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    
    --discord: #5865f2;
    --discord-glow: rgba(88, 101, 242, 0.35);

    /* Text & Border */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border-color: rgba(51, 65, 85, 0.5);
    --border-light: rgba(148, 163, 184, 0.12);
    --border-active: rgba(59, 130, 246, 0.6);

    /* Metrics & Geometry */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 25px var(--primary-glow);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    min-height: 100vh;
    background-color: var(--bg-body);
    background-image: 
        radial-gradient(at 0% 0%, rgba(29, 78, 216, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.8) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    line-height: 1.5;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
    user-select: none;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #93c5fd;
}

/* Utility */
.hidden {
    display: none !important;
}

.font-mono {
    font-family: var(--font-mono);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 15, 29, 0.8);
}
::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.6);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 114, 148, 0.8);
}

/* ==========================================================================
   LOGIN SCREEN & UNAUTHORIZED SCREEN
   ========================================================================== */

.login-screen, .unauth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-bg-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.decor-glow-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    top: -150px;
    left: -100px;
    filter: blur(40px);
}

.decor-glow-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    filter: blur(40px);
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 70%);
}

.login-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 44px 38px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
    position: relative;
    z-index: 10;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.egm-badge-wrapper {
    position: relative;
    width: 92px;
    height: 92px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.egm-login-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 14px rgba(59, 130, 246, 0.4));
    transition: transform 0.3s ease;
}

.egm-login-logo:hover {
    transform: scale(1.06) rotate(3deg);
}

.sidebar-brand-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.egm-badge-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 1; }
}

.egm-badge-icon {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #60a5fa;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #93c5fd;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.security-notice-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-align: left;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.security-notice-box .sec-icon {
    font-size: 18px;
    color: #38bdf8;
    margin-top: 2px;
}

.security-notice-box .sec-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.security-notice-box .sec-text strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

.btn-discord-login {
    width: 100%;
    padding: 14px 20px;
    background: var(--discord);
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
}

.btn-discord-login:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.55);
}

.btn-demo-mode {
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-demo-mode:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.3);
}

/* Unauthorized Alert Screen */
.unauth-card {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px var(--danger-glow);
}

.unauth-icon-box {
    width: 76px;
    height: 76px;
    background: rgba(239, 68, 68, 0.12);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #f87171;
    margin: 0 auto 20px;
}

.unauth-tag {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* ==========================================================================
   MAIN DASHBOARD APPLICATION LAYOUT
   ========================================================================== */

.application {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

.sidebar {
    width: 270px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-light);
}

.brand-badge {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #60a5fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.brand-text strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: block;
    color: #fff;
}

.brand-text span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #60a5fa;
    text-transform: uppercase;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    padding: 20px 20px 8px;
}

.navigation {
    padding: 8px 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
    text-align: left;
}

.nav-item i {
    font-size: 17px;
    width: 22px;
    text-align: center;
    color: var(--text-dim);
    transition: color var(--transition-fast);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-item:hover i {
    color: var(--primary-light);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.05));
    color: #fff;
    font-weight: 700;
    border-left: 3px solid var(--primary);
}

.nav-item.active i {
    color: #60a5fa;
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.nav-item .nav-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    background: rgba(6, 10, 19, 0.7);
}

.bot-status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 11.5px;
    color: #6ee7b7;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-sidebar-logout {
    width: 100%;
    padding: 9px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.topbar {
    height: 72px;
    padding: 0 32px;
    background: rgba(10, 15, 29, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-main);
}

.page-title-group h2 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.page-title-group .breadcrumb {
    font-size: 11.5px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-title-group .breadcrumb span {
    color: var(--primary-light);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quick-sync-btn {
    padding: 8px 14px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    color: #93c5fd;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.quick-sync-btn:hover {
    background: rgba(59, 130, 246, 0.22);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px 6px 8px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 40px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    border: 2px solid rgba(59, 130, 246, 0.5);
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img, .officer-avatar img, .dossier-avatar-big img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.user-info {
    text-align: left;
}

.user-info strong {
    font-size: 13px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
    color: #f1f5f9;
}

.user-info span {
    font-size: 10.5px;
    color: #38bdf8;
    font-weight: 600;
}

/* ==========================================================================
   PAGES CONTENT
   ========================================================================== */

.page-wrapper {
    padding: 32px;
    max-width: 1540px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

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

.page {
    display: none;
}

.page.active-page {
    display: block;
}

/* Page Header Block */
.section-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.banner-left .eyebrow {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--primary-light);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.banner-left h1 {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.banner-left p {
    font-size: 13.5px;
    color: var(--text-muted);
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(148, 163, 184, 0.3);
}

.btn-danger {
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
    border-color: rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   STATISTICS CARDS (ULTRA-MODERN GLASS & GLOW)
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(17, 26, 46, 0.75), rgba(11, 18, 33, 0.85));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.14);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.03);
}

.stat-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.7), 0 0 25px var(--stat-glow, rgba(59, 130, 246, 0.25));
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--stat-color, var(--primary)), transparent);
}

.stat-card.blue { --stat-color: #38bdf8; --stat-glow: rgba(56, 189, 248, 0.3); }
.stat-card.emerald { --stat-color: #10b981; --stat-glow: rgba(16, 185, 129, 0.3); }
.stat-card.amber { --stat-color: #f59e0b; --stat-glow: rgba(245, 158, 11, 0.3); }
.stat-card.rose { --stat-color: #ef4444; --stat-glow: rgba(239, 68, 68, 0.3); }
.stat-card.cyan { --stat-color: #06b6d4; --stat-glow: rgba(6, 182, 212, 0.3); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--text-muted);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--stat-color, var(--primary));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-sub .badge-trend {
    font-weight: 700;
    color: #34d399;
}

/* ==========================================================================
   CONTENT PANELS & GRIDS
   ========================================================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 24px;
    margin-bottom: 28px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 22, 39, 0.4);
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header .panel-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.panel-body {
    padding: 24px;
}

/* ==========================================================================
   TOOLBARS & SEARCH
   ========================================================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    flex: 1;
    min-width: 260px;
    max-width: 480px;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-box i {
    color: var(--text-dim);
    font-size: 15px;
}

.search-box input {
    width: 100%;
    color: var(--text-main);
    font-size: 13.5px;
}

.search-box input::placeholder {
    color: var(--text-dim);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.select-filter {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-filter:focus {
    border-color: var(--primary);
}

.select-filter option {
    background: #0d1527;
    color: #fff;
}

/* ==========================================================================
   TABLE DESIGN
   ========================================================================== */

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table th {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-dim);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 16, 30, 0.6);
    white-space: nowrap;
}

table td {
    padding: 16px 20px;
    font-size: 13.5px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tbody tr {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

table tbody tr:hover {
    background: rgba(56, 189, 248, 0.05);
    transform: scale(1.002);
    box-shadow: inset 3px 0 0 #38bdf8;
}

/* Officer Cell Styling */
.officer-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.officer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #93c5fd;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.officer-details strong {
    display: block;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    font-size: 14px;
}

.officer-details small {
    font-size: 11.5px;
    color: #38bdf8;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Badges and Tags */
.badge-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 6px;
    color: #67e8f9;
    white-space: nowrap;
}

.badge-sicil {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    color: #fcd34d;
    white-space: nowrap;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.active {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.status-pill.danger {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.status-pill.suspended {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
}

/* Action Buttons inside tables */
.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-action-icon:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.5);
    transform: scale(1.05);
}

.btn-action-icon.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.btn-manage-officer {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

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

/* ==========================================================================
   UNITS GRID & UNIT CARDS
   ========================================================================== */

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.unit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.unit-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
}

.unit-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.unit-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #60a5fa;
    flex-shrink: 0;
}

.unit-info h4 {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.unit-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.unit-meta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.unit-meta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.unit-meta-item span {
    color: var(--text-dim);
}

.unit-meta-item strong {
    color: var(--text-main);
    font-family: var(--font-mono);
}

.unit-card-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   DISCIPLINARY & WARNING CARDS
   ========================================================================== */

.warning-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
}

.warning-level-badge.level-1 {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.warning-level-badge.level-2 {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: #fb923c;
}

.warning-level-badge.level-3 {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.warning-level-badge.discharge {
    background: rgba(220, 38, 38, 0.25);
    border: 1px solid #ef4444;
    color: #fff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   AUDIT & HISTORY TIMELINE
   ========================================================================== */

.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 14px;
    position: relative;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 24px;
    bottom: -16px;
    width: 2px;
    background: var(--border-light);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-indicator {
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-card-solid);
    box-shadow: 0 0 8px var(--primary-glow);
}

.timeline-indicator.danger {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger-glow);
}

.timeline-indicator.warning {
    background: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold-glow);
}

.timeline-content {
    background: rgba(10, 16, 30, 0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    width: 100%;
}

.timeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.timeline-top strong {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
}

.timeline-top span {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.timeline-content p {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ==========================================================================
   DISCORD INTEGRATION PAGE
   ========================================================================== */

.discord-hero-card {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(88, 101, 242, 0.35);
    border-radius: var(--radius-xl);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    box-shadow: 0 15px 40px -10px rgba(88, 101, 242, 0.2);
    flex-wrap: wrap;
}

.discord-hero-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.discord-big-icon {
    width: 68px;
    height: 68px;
    background: var(--discord);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 10px 25px rgba(88, 101, 242, 0.4);
    flex-shrink: 0;
}

.discord-hero-info h3 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.discord-hero-info p {
    font-size: 13.5px;
    color: #cbd5e1;
}

.discord-role-table td {
    padding: 12px 16px;
}

/* ==========================================================================
   MODAL WINDOWS & BACKDROP
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    padding: 32px;
    animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

/* Forms inside modal */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    color: #fff;
    font-size: 13.5px;
    transition: all var(--transition-fast);
}

.form-group select option {
    background: #0d1527;
    color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group small {
    font-size: 11px;
    color: var(--text-dim);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   DOSSIER / SİCİL DETAY MODAL
   ========================================================================== */

.dossier-header-card {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.4), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.dossier-avatar-big {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    border: 2px solid rgba(59, 130, 246, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.dossier-info h2 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.dossier-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dossier-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.dossier-tab-btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.dossier-tab-btn.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #0e1627;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 440px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

.toast.success {
    border-left-color: var(--success);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), 0 0 20px var(--success-glow);
}

.toast.error {
    border-left-color: var(--danger);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), 0 0 20px var(--danger-glow);
}

.toast.warning {
    border-left-color: var(--warning);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), 0 0 20px var(--warning-glow);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1080px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
    }

    .mobile-menu-btn {
        display: flex;
    }

    .page-wrapper {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   MODAL SELECT & OPTION STYLING
   ========================================================================== */

select[size] {
    background: rgba(10, 16, 30, 0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 6px;
    color: #e2e8f0;
    overflow-y: auto;
}

select[size] option {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

select[size] option:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

select[size] option:checked {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(59, 130, 246, 0.3));
    border-left: 3px solid #38bdf8;
    color: #fff;
    font-weight: 600;
}