/**
 * Tracker Pro Analytics - Ortak Stil Dosyası
 * Versiyon: 1.0
 * design-system.md referans alınarak oluşturulmuştur
 */

/* ==========================================
   1. CSS DEĞİŞKENLERİ
   ========================================== */

:root {
    /* Primary - Mor/İndigo */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;

    /* Secondary - Mor */
    --secondary: #8b5cf6;

    /* Accent - Vurgu Rengi */
    --accent: #f59e0b;

    /* Durum Renkleri */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --error: #ef4444;
    --error-light: #f87171;
    --danger: #ef4444;
    /* error alias */
    --danger-light: #f87171;
    --info: #3b82f6;
    --info-light: #60a5fa;

    /* Arka Plan */
    --bg-dark: #0f0e1a;
    --bg-secondary: #1a1830;
    --bg-card: rgba(30, 27, 75, 0.6);
    --bg-hover: rgba(99, 102, 241, 0.1);

    /* Metin */
    --text-primary: #ffffff;
    --text-secondary: #a5b4fc;
    --text-muted: #6b7280;

    /* Sınırlar */
    --border: rgba(99, 102, 241, 0.2);
    --border-hover: rgba(99, 102, 241, 0.4);

    /* Efektler */
    --glass: rgba(255, 255, 255, 0.05);
    --shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    --shadow-lg: 0 25px 50px rgba(99, 102, 241, 0.25);

    /* Boyutlar */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #475569;
}

/* ==========================================
   2. RESET & BASE
   ========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================
   3. TİPOGRAFİ
   ========================================== */

h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.gradient-text {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================
   4. LAYOUT
   ========================================== */

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    padding: 2rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Flex */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

/* ==========================================
   5. ARKA PLAN ANİMASYONU
   ========================================== */

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(2%, 2%) rotate(-1deg);
    }
}

/* ==========================================
   6. HEADER & NAVİGASYON
   ========================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.logo-text h1 {
    font-size: 1.25rem;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 50;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Nav dropdowns - position from left */
.nav .dropdown-menu,
.nav-dropdown .dropdown-menu,
.admin-nav .dropdown-menu {
    left: 0;
    right: auto;
}

/* Wide dropdown for long menu items */
.dropdown-menu-wide {
    min-width: 220px;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

/* ==========================================
   7. KARTLAR
   ========================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

/* Card Colors */
.card.success::before {
    background: linear-gradient(90deg, var(--success), var(--success-light));
}

.card.warning::before {
    background: linear-gradient(90deg, var(--warning), var(--warning-light));
}

.card.error::before {
    background: linear-gradient(90deg, var(--error), var(--error-light));
}

.card.info::before {
    background: linear-gradient(90deg, var(--info), var(--info-light));
}

/* Stat Card */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success), var(--success-light));
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning), var(--warning-light));
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info), var(--info-light));
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-change {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

/* ==========================================
   8. BUTONLAR
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Icon Button */
.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.icon-btn.sm {
    width: 32px;
    height: 32px;
}

.icon-btn.lg {
    width: 48px;
    height: 48px;
}

/* ==========================================
   9. FORM ELEMANLARI
   ========================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Global Form Input Styles */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
textarea,
select,
.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    /* Better visibility on dark bg */
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s;
    /* Ensure disabled state looks correct */
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-hover);
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-hover);
}

input::placeholder,
textarea::placeholder,
.form-input::placeholder {
    color: var(--text-muted);
}

/* Select Specific Styles */
select,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}

/* Fix for date inputs to match dark theme */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 0.5rem;
}

/* ==========================================
   TOGGLE SWITCH - UIVERSE.IO RESPONSIVE DESIGN
   OFF: Açık kırmızı arka plan (#f5aeae), koyu kırmızı daire (#DC3535)
   ON: Açık yeşil arka plan (#9ed99c), koyu yeşil daire (#379237)
   Responsive em birimi kullanılıyor
   ========================================== */

/* ===== STANDARD SWITCH (.switch + .slider) ===== */
.switch {
    --circle-dim: 1.4em;
    font-size: 14px;
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
    flex-shrink: 0;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* The slider background */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f5aeae;
    transition: 0.4s;
    border-radius: 30px;
}

/* The circle handle */
.slider::before {
    position: absolute;
    content: "";
    height: var(--circle-dim);
    width: var(--circle-dim);
    border-radius: 50%;
    left: 0.3em;
    bottom: 0.3em;
    background-color: #DC3535;
    transition: 0.4s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Checked state - slider background */
.switch input:checked+.slider {
    background-color: #9ed99c;
}

/* Checked state - handle moves right and changes color */
.switch input:checked+.slider::before {
    transform: translateX(1.5em);
    background-color: #379237;
}

/* Hover effect */
.switch:hover .slider::before {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .switch {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .switch {
        font-size: 12px;
    }
}

/* ==========================================
   10. TABLOLAR
   ========================================== */

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.table tr:hover td {
    background: var(--bg-hover);
}

/* Clickable Rows */
.clickable-row {
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.clickable-row:hover {
    background: var(--bg-hover) !important;
}

.clickable-row:hover td {
    background: transparent;
}

.clickable-row:active {
    transform: scale(0.995);
}

/* Table Toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.search-box .form-input {
    padding-left: 2.5rem;
    width: 280px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-controls .form-select {
    width: auto;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
}

/* ==========================================
   11. MODALLAR
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.2s;
    z-index: 1000;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 960px;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Confirm Modal */
.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    background: var(--bg-hover);
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.2);
}

.modal-icon.danger {
    background: rgba(239, 68, 68, 0.2);
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.2);
}

/* ==========================================
   12. BİLDİRİMLER (TOAST)
   ========================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

.toast.info {
    border-left: 3px solid var(--info);
}

/* ==========================================
   13. LOADING
   ========================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.spinner-lg {
    width: 56px;
    height: 56px;
    border-width: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ==========================================
   14. RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .header {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box .form-input {
        width: 100%;
    }

    .pagination {
        flex-direction: column;
        text-align: center;
    }

    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
    }

    .btn-full {
        padding: 0.875rem 1.5rem;
    }
}

/* ==========================================
   15. UTILITY CLASSES
   ========================================== */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

/* ==========================================
   16. LANDING PAGE STYLES
   ========================================== */

/* Auth Layout */
.auth-layout {
    display: flex;
    min-height: 100vh;
}

.auth-panel {
    width: 450px;
    min-height: 100vh;
    background: var(--bg-secondary);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border);
}

.auth-panel .logo {
    margin-bottom: 2rem;
}

.auth-panel .logo-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Messages */
.message {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
    display: block;
}

.message.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
    display: block;
}

/* Info Panel */
.info-panel {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.info-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.info-panel::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.info-content {
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.info-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.info-content h2 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-content>p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.feature h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Stats Banner */
.stats-banner {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.stats-banner .stat {
    text-align: center;
}

.stats-banner .stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-banner .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Landing Responsive */
@media (max-width: 1024px) {
    .auth-layout {
        flex-direction: column;
    }

    .auth-panel {
        width: 100%;
        min-height: auto;
        padding: 2rem;
    }

    .info-panel {
        padding: 2rem;
    }

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

    .stats-banner {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .info-content h2 {
        font-size: 1.75rem;
    }
}

/* ==========================================
   17. DASHBOARD STYLES
   ========================================== */

/* View Switcher */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.site-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* BIK Toggle - uses .switch styles from main section */

/* Main Content Area */
.main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   18. ADMIN PANEL STYLES
   ========================================== */

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.sidebar-logo .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.sidebar-logo h1 {
    font-size: 1.125rem;
    font-weight: 600;
}

.sidebar-logo span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Nav Sections */
.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: var(--glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.nav-item .icon {
    font-size: 1.25rem;
}

/* Admin Main Content */
.admin-main {
    margin-left: 280px;
    min-height: 100vh;
}

.content {
    padding: 2rem;
}

/* Page Sections */
.page-section {
    display: none;
}

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

/* Card Header/Title */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stat Title */
.stat-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.badge.info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Admin Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .admin-main {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .admin-main {
        margin-left: 0;
    }
}

/* ==========================================
   19. DASHBOARD CHARTS & EXTRAS
   ========================================== */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Hourly Chart */
.hourly-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 1rem;
    background: var(--glass);
    border-radius: var(--radius-md);
}

.hourly-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: all 0.3s;
    position: relative;
}

.hourly-bar:hover {
    background: var(--primary-light);
    transform: scaleY(1.05);
}

.hourly-bar::after {
    content: attr(data-hour);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Traffic Sources */
.traffic-sources {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.source-name {
    width: 80px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.source-bar-container {
    flex: 1;
    height: 8px;
    background: var(--glass);
    border-radius: 4px;
    overflow: hidden;
}

.source-bar {
    height: 100%;
    border-radius: 3px;
}

.source-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Code Block */
.code-block {
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    padding: 1rem;
    position: relative;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.code-block code {
    color: var(--primary);
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

/* Page URL cell */
.page-url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary);
}

/* Charts Responsive */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   LANDING PAGE - AUTH LAYOUT
   ========================================== */

.auth-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    min-height: 100vh;
}

.auth-panel {
    background: var(--bg-secondary);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border);
}

.auth-panel .logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.auth-panel .logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-dark);
    padding: 4px;
    border-radius: var(--radius-md);
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.info-panel {
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.info-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    animation: bgPulse 20s ease-in-out infinite;
}

.info-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
}

.info-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.info-content h2 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-content>p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.features {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stats-banner {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.stats-banner .stat {
    text-align: center;
}

.stats-banner .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-banner .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Auth Layout Responsive */
@media (max-width: 1024px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .info-panel {
        display: none;
    }

    .auth-panel {
        border-right: none;
    }
}

/* ==========================================
   ADMIN PANEL - SIDEBAR LAYOUT
   ========================================== */

/* Admin Layout with Sidebar */
body:has(.sidebar) {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

body:has(.sidebar) .bg-animation {
    position: fixed;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.sidebar-logo .icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.sidebar-logo h1 {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-logo span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.nav-item .icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Admin Main Content */
body:has(.sidebar) .main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body:has(.sidebar) .header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
}

/* Page Sections */
.page-section {
    display: none;
}

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

/* Admin Stats Grid */
body:has(.sidebar) .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Responsive Admin */
@media (max-width: 1024px) {
    body:has(.sidebar) {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 100;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }
}

/* ==========================================
   ADDITIONAL MISSING COMPONENTS
   ========================================== */

/* Message Component */
.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.message.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.message.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Card Header & Title */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Stat Title (admin kullanımı için) */
.stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* BIK Toggle - uses unified .switch styles */

/* Site Selector */
.site-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Dashboard Main Layout */
.main {
    padding: 2rem;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Margin & Padding Utilities */
.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

/* Other Utilities */
.text-center {
    text-align: center;
}

/* ==========================================
   MODAL SYSTEM
   ========================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--error);
}

/* ==========================================
   DROPDOWN MENU - SHOW STATE FIX
   ========================================== */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: var(--shadow);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* ==========================================
   CHARTS SECTION - GRID LAYOUT FIX
   ========================================== */

.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-section .card {
    min-height: 300px;
}

/* Hourly Chart Bars */
.hourly-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    gap: 4px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

/* Traffic Sources */
.traffic-sources {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

/* ==========================================
   TABLE STYLES - FULL WIDTH
   ========================================== */

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

table,
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th,
td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    background: var(--bg-dark);
}

tr:hover td {
    background: var(--bg-hover);
}

/* ==========================================
   ADMIN PANEL - FULL WIDTH FIX
   ========================================== */

/* Remove max-width on admin content */
body:has(.sidebar) .content {
    max-width: none;
    width: 100%;
}

/* Ensure main takes full width */
body:has(.sidebar) .main {
    min-width: 0;
    overflow-x: hidden;
}

/* Admin header full width */
body:has(.sidebar) .header {
    width: 100%;
}

/* Stats grid for admin - more columns */
body:has(.sidebar) .stats-grid {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    body:has(.sidebar) .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body:has(.sidebar) .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   USER MENU IN HEADER
   ========================================== */

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ==========================================
   FORM SELECT STYLES
   ========================================== */

.form-select,
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

/* ==========================================
   RESPONSIVE CHARTS
   ========================================== */

@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* ==========================================
   HEADER - SHARED LAYOUT
   ========================================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 2rem;
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.header .logo-text h1 {
    font-size: 1rem;
    font-weight: 600;
}

.header .logo-text h1.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   NAVIGATION - TOP BAR
   ========================================== */

.nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

/* Admin Nav - Dropdown style */
.admin-nav {
    gap: 0.25rem;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    margin-top: 0.5rem;
}

/* ==========================================
   FOOTER - SHARED
   ========================================== */

.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer a {
    color: var(--primary);
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--primary-light);
}

/* ==========================================
   MAIN LAYOUT - FULL PAGE CENTERED
   ========================================== */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    flex: 1;
    padding: 2rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.content {
    width: 100%;
}

/* Stats Grid - Full Width */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ==========================================
   RESPONSIVE HEADER
   ========================================== */

@media (max-width: 1200px) {
    .header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow: visible;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header .logo-text {
        display: none;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Text Size Utilities */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted);
}

/* ==========================================
   MOBILE HAMBURGER MENU
   ========================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    z-index: 110;
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger to X animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   MOBILE NAVIGATION (768px and below)
   ========================================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header {
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .header .logo {
        flex: 1;
    }

    .header .logo-text h1 {
        font-size: 1rem;
    }

    .header .logo-text span {
        display: none;
    }

    /* Mobile Sidebar Navigation */
    .nav,
    .admin-nav {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        height: calc(100vh - 60px) !important;
        min-height: calc(100vh - 60px) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: var(--bg-secondary) !important;
        padding: 1rem !important;
        gap: 0.25rem !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto !important;
        z-index: 999 !important;
        border-right: 1px solid var(--border) !important;
    }

    .nav.mobile-open,
    .admin-nav.mobile-open {
        transform: translateX(0);
    }

    /* Nav Links in Mobile Sidebar */
    .nav .nav-link,
    .admin-nav .nav-link {
        display: flex;
        align-items: center;
        padding: 1rem;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
        width: 100%;
        text-align: left;
        color: var(--text-primary);
        background: transparent;
        transition: background 0.2s;
    }

    .nav .nav-link:hover,
    .admin-nav .nav-link:hover {
        background: var(--bg-hover);
    }

    .nav .nav-link.active,
    .admin-nav .nav-link.active {
        background: var(--primary);
        color: white;
    }

    /* Dropdown containers in mobile sidebar */
    .nav .dropdown,
    .nav .nav-dropdown,
    .admin-nav .dropdown,
    .admin-nav .nav-dropdown {
        width: 100%;
        flex-direction: column;
    }

    /* Dropdown trigger button style */
    .nav .dropdown-trigger,
    .nav-dropdown .dropdown-trigger,
    .admin-nav .dropdown-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        background: transparent;
        transition: background 0.2s;
    }

    .nav .dropdown-trigger:hover,
    .nav-dropdown .dropdown-trigger:hover,
    .admin-nav .dropdown-trigger:hover {
        background: var(--bg-hover);
    }

    /* ======================================== 
       MOBILE DROPDOWN - ULTRA SPECIFICITY FIX
       Must override base .dropdown-menu styles
       ======================================== */

    /* Base reset for ALL dropdown menus in mobile */
    body .dropdown-menu,
    body .nav .dropdown-menu,
    body .nav-dropdown .dropdown-menu,
    body .admin-nav .dropdown-menu,
    body .nav .dropdown .dropdown-menu,
    body .admin-nav .dropdown .dropdown-menu,
    body .nav.admin-nav .dropdown .dropdown-menu,
    body .nav.admin-nav .nav-dropdown .dropdown-menu,
    body .header .nav .dropdown-menu {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        inset: auto !important;
        width: 100% !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: rgba(0, 0, 0, 0.25) !important;
        border: none !important;
        border-width: 0 !important;
        border-radius: var(--radius-sm) !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: max-height 0.3s ease, height 0.3s ease, padding 0.3s ease !important;
    }

    /* Open dropdown state - ULTRA SPECIFICITY */
    body .dropdown.show .dropdown-menu,
    body .dropdown.open .dropdown-menu,
    body .nav-dropdown.show .dropdown-menu,
    body .nav-dropdown.open .dropdown-menu,
    body .nav .dropdown.show .dropdown-menu,
    body .nav .dropdown.open .dropdown-menu,
    body .nav .nav-dropdown.show .dropdown-menu,
    body .nav .nav-dropdown.open .dropdown-menu,
    body .admin-nav .dropdown.show .dropdown-menu,
    body .admin-nav .dropdown.open .dropdown-menu,
    body .admin-nav .nav-dropdown.show .dropdown-menu,
    body .admin-nav .nav-dropdown.open .dropdown-menu,
    body .nav.admin-nav .dropdown.show .dropdown-menu,
    body .nav.admin-nav .dropdown.open .dropdown-menu,
    body .dropdown-menu.show {
        height: auto !important;
        max-height: 500px !important;
        overflow: visible !important;
        padding: 0.5rem !important;
        margin-top: 0.25rem !important;
    }

    /* Dropdown items in mobile */
    .nav .dropdown-item,
    .nav-dropdown .dropdown-item,
    .admin-nav .dropdown-item {
        display: block;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        background: transparent;
        margin-bottom: 0.125rem;
        transition: all 0.2s;
    }

    .nav .dropdown-item:hover,
    .nav-dropdown .dropdown-item:hover,
    .admin-nav .dropdown-item:hover {
        background: var(--primary);
        color: white;
    }

    /* User dropdown in header - keep as popup */
    .header>.dropdown {
        position: relative;
    }

    .header>.dropdown .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        width: auto !important;
        min-width: 180px;
        max-height: none;
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border) !important;
        box-shadow: var(--shadow) !important;
        padding: 0.5rem !important;
        margin-top: 0.5rem !important;
        border-radius: var(--radius-md) !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }

    .header>.dropdown.show .dropdown-menu,
    .header>.dropdown .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Tablet media query removed - nav now stays normal until mobile breakpoint */


/* ==========================================
   GLOBAL MODAL STYLES
   ========================================== */


/* ==========================================
   GLOBAL MODAL STYLES (FLEXBOX OVERRIDE)
   ========================================== */

.modal {
    /* Başlangıçta gizli */
    display: none;

    /* Tam ekran kaplama - Viewport birimleri kullanarak */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    max-width: none !important;
    max-height: none !important;

    /* Yarı saydam siyah arka plan */
    background-color: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(5px);
    z-index: 20000 !important;

    /* Flexbox Merkezleme */
    align-items: center !important;
    justify-content: center !important;

    /* İçerik taşarsa scroll */
    padding: 1rem !important;
    box-sizing: border-box !important;
}



/* JS display:flex yaptığında grid yerine flex kullan */
.modal[style*="display: flex"],
.modal[style*="display:flex"],
.modal.show {
    display: flex !important;
}

.modal-content {
    /* Kart tasarımı */
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;

    /* Boyutlandırma */
    width: 100% !important;
    max-width: 600px;
    max-height: 90vh !important;

    /* Pozisyon */
    margin: auto !important;
    position: relative !important;

    /* İçerik düzeni */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;

    /* Efektler */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7) !important;
    animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content.lg {
    max-width: 800px;
}

.modal-content.xl {
    max-width: 1000px;
}

.modal-content.sm {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}


/* ==========================================
   GLOBAL CUSTOM SCROLLBAR STYLES (ENHANCED)
   ========================================== */

/* Varsayılan scrollbar - Firefox için */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

/* Chrome, Safari, Edge */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border: 3px solid var(--bg-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-light);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* İnce scrollbar (Tablolar ve Modallar için) */
.thin-scrollbar::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.nav::-webkit-scrollbar,
pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.thin-scrollbar::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.nav::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.thin-scrollbar::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border: none;
    border-radius: 3px;
}

.thin-scrollbar::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.nav::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

.modal-body,
.table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-hover);
}

/* ==========================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ========================================== */

/* Toast z-index fix for mobile - ensure toasts are always on top */
.toast-container {
    z-index: 9999 !important;
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .toast-container {
        left: auto;
        right: 1rem;
        margin: 0;
    }
}

.toast {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Menu Dropdown Improvements - consolidated above */
@media (max-width: 768px) {

    /* Dropdown item styles in mobile sidebar */
    .nav .dropdown-item,
    .admin-nav .dropdown-item {
        padding: 0.875rem 1rem !important;
        border-radius: var(--radius-sm) !important;
        margin-bottom: 0.25rem;
        display: block !important;
    }

    .nav .dropdown-item:hover,
    .admin-nav .dropdown-item:hover {
        background: var(--primary) !important;
        color: white !important;
    }

    .nav .dropdown-divider,
    .admin-nav .dropdown-divider {
        margin: 0.5rem 0;
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* User menu dropdown in header - special handling */
    .header .dropdown {
        position: relative;
    }

    .header .dropdown .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        width: auto !important;
        min-width: 200px;
        max-height: none;
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border) !important;
        box-shadow: var(--shadow) !important;
        padding: 0.5rem !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }

    .header .dropdown.show .dropdown-menu,
    .header .dropdown .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
    }

    /* Ensure toast is visible above everything on mobile */
    .toast-container {
        z-index: 99999 !important;
    }

    /* Mobile overlay improvements */
    .mobile-overlay {
        z-index: 98;
    }

    /* Mobile sidebar z-index */
    .nav.mobile-open {
        z-index: 99;
    }
}

/* Admin Panel Mobile Dropdown Fix - now handled in 768px media query above */

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

    .nav-link,
    .dropdown-item,
    .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .dropdown-trigger {
        min-height: 44px;
    }
}

/* Improved accordion-style dropdown for mobile sidebar */
.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.nav-dropdown-trigger:hover {
    background: var(--bg-hover);
}

.nav-dropdown-trigger .chevron {
    transition: transform 0.3s;
}

.nav-dropdown.open .nav-dropdown-trigger .chevron {
    transform: rotate(180deg);
}

/* Ensure modals are above everything except toast */
.modal {
    z-index: 1000;
}

.modal-overlay {
    z-index: 999;
}

/* Confirm modal high priority */
#confirmModal {
    z-index: 9990 !important;
}

/* ==========================================
   NOTIFICATION BELL & PANEL
   ========================================== */

.notification-bell-wrapper {
    position: relative;
    margin-right: 0.5rem;
}

.notification-bell {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    color: var(--text-secondary);
}

.notification-bell:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.notification-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 360px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 500;
    overflow: hidden;
}

.notification-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.notification-read-all {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s;
}

.notification-read-all:hover {
    color: var(--primary-light);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-icon.info {
    background: rgba(59, 130, 246, 0.15);
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.15);
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.15);
}

.notification-icon.error {
    background: rgba(239, 68, 68, 0.15);
}

.notification-icon.new_user {
    background: rgba(99, 102, 241, 0.15);
}

.notification-icon.security {
    background: rgba(239, 68, 68, 0.15);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.notification-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .notification-panel {
        width: calc(100vw - 2rem);
        right: -5rem;
    }
}

/* ==========================================
   ANNOUNCEMENTS TICKER BAR
   ========================================== */
.announcements-ticker {
    width: 100%;
    background: linear-gradient(90deg, var(--bg-secondary), var(--bg-dark));
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcements-ticker-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 2rem;
}

.ticker-icon-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border-radius: 8px;
    margin-right: 1rem;
}

.ticker-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-content {
    display: inline-flex;
    animation: tickerScroll 40s linear infinite;
    white-space: nowrap;
    will-change: transform;
    padding-left: 100%;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 2rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-right: 1px solid var(--border);
}

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

.ticker-item .ticker-icon {
    font-size: 1rem;
}

.ticker-item .ticker-title {
    font-weight: 500;
    color: var(--text-primary);
}

.ticker-item .ticker-preview {
    color: var(--text-muted);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ticker type colors */
.ticker-item.info .ticker-title {
    color: var(--info);
}

.ticker-item.success .ticker-title {
    color: var(--success);
}

.ticker-item.warning .ticker-title {
    color: var(--warning);
}

.ticker-item.error .ticker-title {
    color: var(--error);
}

.ticker-item.update .ticker-title {
    color: var(--secondary);
}

.ticker-item.maintenance .ticker-title {
    color: var(--text-muted);
}

/* Announcement Detail Modal */
.announcement-modal-content {
    max-width: 600px;
}

.announcement-detail {
    padding: 1.5rem;
}

.announcement-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.announcement-detail-icon {
    font-size: 2.5rem;
}

.announcement-detail-info h3 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.announcement-detail-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.announcement-detail-body {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.announcement-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.announcement-type-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.announcement-type-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.announcement-type-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.announcement-type-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.announcement-type-badge.update {
    background: rgba(139, 92, 246, 0.15);
    color: var(--secondary);
}

.announcement-type-badge.maintenance {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .announcements-ticker {
        height: 36px;
    }

    .announcements-ticker::before {
        width: 40px;
        font-size: 1rem;
    }

    .ticker-wrapper {
        padding-left: 50px;
    }

    .ticker-item {
        padding: 0 1.5rem;
        font-size: 0.8rem;
    }

    .ticker-item .ticker-preview {
        display: none;
    }
}

/* Login Page Ticker */
.announcements-ticker.login-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(90deg, var(--bg-dark) 0%, rgba(99, 102, 241, 0.15) 50%, var(--bg-dark) 100%);
    border-bottom: 1px solid var(--primary);
    backdrop-filter: blur(10px);
}

.announcements-ticker.login-ticker .ticker-icon-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.announcements-ticker.login-ticker .ticker-item .ticker-title {
    color: var(--primary-light);
}

/* ==========================================
   20. UNIFIED COMPONENT SYSTEM (Migrated from Inline Styles)
   ========================================== */

/* 20.1 BADGES & LABELS */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
}

/* Badge Colors */
.badge.primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.badge.secondary {
    background: rgba(139, 92, 246, 0.15);
    color: var(--secondary);
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge.danger,
.badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge.neutral {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-muted);
}

/* Aliases for specific pages to maintain compatibility during migration */
.status-badge,
.role-badge,
.severity-badge,
.event-badge,
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Status/Role Badge specific overrides map to generic badge styles */
.status-badge.active,
.role-badge.user,
.status-badge.success,
.status-badge.published {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.pending,
.status-badge.draft,
.severity-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-badge.suspended,
.status-badge.failed,
.role-badge.admin,
.severity-badge.high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.role-badge.moderator {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.role-badge.viewer,
.severity-badge.low {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-muted);
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.4);
    color: #ff4444;
    font-weight: 700;
}


/* 20.2 TABS SYSTEM */
.tab-buttons {
    display: flex;
    gap: 0.5rem;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    /* In modals, padding might be different, can be overridden */
}

/* Modal specific tabs override */
.modal .tab-buttons {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    padding-left: 0;
    padding-right: 0;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--glass);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-hover);
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* 20.3 FILTERS BAR */
.filters-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


/* 20.4 FORM ENHANCEMENTS */
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Toggle Group (e.g., in Page Manager) */
.toggle-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.toggle-info label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-weight: 500;
}

.toggle-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}


/* 20.5 SETTINGS LAYOUT (Generic) */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-dark);
    /* Inner card bg */
    border-radius: 10px;
    border: 1px solid var(--border);
    gap: 1rem;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    margin-right: 1rem;
}

.setting-info h4,
.setting-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.setting-info p,
.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* 20.5.1 SECTION INFO BOX */
.section-info {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.section-info .info-icon-large {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.section-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.section-info p strong {
    color: var(--text-primary);
}

/* 20.5.2 RECOMMENDATION BADGES */
.rec-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.rec-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.rec-badge.recommended {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.rec-badge.optional {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.rec-badge.advanced {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* 20.5.3 VALUE HINTS */
.value-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.value-hint.warning {
    color: #eab308;
}

.value-hint.success {
    color: #22c55e;
}


/* 20.6 PAGINATION BUTTONS */
.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.page-btn:hover:not(:disabled),
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* 20.7 ACTIVITY TIMELINE (Generic) */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--bg-hover);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.activity-info {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* 20.8 LAYOUT UTILS */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}


.action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}


.form-input.small {
    width: 100px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.9rem;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Icon Utilities */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2px;
}

.icon-xs {
    width: 0.875rem;
    height: 0.875rem;
    stroke-width: 2px;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
    stroke-width: 2px;
}

.icon-md {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 2px;
}

.icon-lg {
    width: 2rem;
    height: 2rem;
    stroke-width: 2px;
}

/* Page: Announcements */
.modal-lg {
    max-width: 700px;
    width: 95%;
}

/* Announcement Preview */
.announcement-preview {
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.announcement-preview.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
}

.announcement-preview.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.announcement-preview.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.announcement-preview.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

/* Title with icon */
.announcement-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.announcement-title .icon {
    font-size: 1rem;
}

.announcement-title .text {
    font-weight: 500;
    color: var(--text-primary);
}