/*
Theme Name: Gülperi Tavukçuluk Stok Takibi
Theme URI: https://resimarsivi.site
Description: Stok takip sistemi teması - Barkod okuma, stok yönetimi ve raporlama (Modern CSS)
Author: Sen Piliç
Version: 3.0.0
Text Domain: sen-pilic-stok
Requires PHP: 7.4
*/

/* ==========================================
   MODERN COLOR VARIABLES
   ========================================== */
:root {
    /* Primary Colors - Modern Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #434343 0%, #000000 100%);
    
    /* Solid Colors */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #f5576c;
    --success: #4facfe;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --purple: #764ba2;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.24);
    
    /* Transitions */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
}

/* ==========================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   NAVBAR - STICKY & MODERN
   ========================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary-gradient);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    transition: var(--transition-normal);
}

.topbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    backdrop-filter: blur(20px);
    z-index: -1;
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.topbar .logo.small {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: var(--transition-normal);
}

.topbar .logo.small:hover {
    transform: scale(1.1) rotate(5deg);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topnav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.topnav a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.topnav a:hover::before {
    width: 300px;
    height: 300px;
}

.topnav a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.user-chip {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition-normal);
}

.user-chip:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* ==========================================
   AUTH PAGES
   ========================================== */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    transition: var(--transition-normal);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    height: 70px;
    width: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.auth-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-normal);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), var(--shadow-md);
    transform: translateY(-2px);
}

.auth-form input[type="text"]:hover,
.auth-form input[type="password"]:hover {
    border-color: var(--primary-dark);
}

.auth-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

/* ==========================================
   MODERN BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: var(--white);
}

.btn-secondary {
    background: var(--success-gradient);
    color: var(--white);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3d8eff 0%, #00d4ff 100%);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: var(--white);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.btn-ghost {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: var(--white);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--white);
    color: var(--white);
}

.btn i {
    margin-right: 0.5rem;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-normal);
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid #e9ecef;
    padding: 1.5rem 2rem;
}

.card-header h2 {
    margin: 0;
    color: var(--dark);
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-body {
    padding: 2rem;
}

/* ==========================================
   FORMS - PREMIUM
   ========================================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

.form-row.two {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.form-row.three {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-row > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form label,
.form-row label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.form input[type="text"],
.form input[type="number"],
.form input[type="date"],
.form input[type="password"],
.form textarea,
.form select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-normal);
    background: var(--white);
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

.form input[type="text"]:focus,
.form input[type="number"]:focus,
.form input[type="date"]:focus,
.form input[type="password"]:focus,
.form textarea:focus,
.form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), var(--shadow-md);
    transform: translateY(-2px);
}

.form input[type="text"]:hover:not(:focus),
.form input[type="number"]:hover:not(:focus),
.form input[type="date"]:hover:not(:focus),
.form input[type="password"]:hover:not(:focus),
.form textarea:hover:not(:focus),
.form select:hover:not(:focus) {
    border-color: #c9d0d6;
}

.form textarea {
    resize: vertical;
    min-height: 100px;
}

.form input:disabled {
    background: #f5f6fa;
    cursor: not-allowed;
    color: #95a5a6;
}

/* ==========================================
   TABLES - PREMIUM DATA TABLES
   ========================================== */
.dataTable-wrapper {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Table responsive wrapper for mobile scrolling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
    position: relative;
}

.dataTable {
    width: 100% !important;
    border-collapse: collapse;
}

.dataTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dataTable thead th {
    padding: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-normal);
    user-select: none;
    border-bottom: 3px solid rgba(255,255,255,0.3);
}

.dataTable thead th:hover {
    background: rgba(255,255,255,0.1);
}

.dataTable tbody tr {
    transition: var(--transition-normal);
    border-bottom: 1px solid #f1f2f6;
}

.dataTable tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.dataTable tbody td {
    padding: 1.25rem;
    color: var(--dark);
}

/* Premium Filter Row */
thead tr.filters th {
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 2px solid #e1e8ed;
    padding: 0.75rem;
}

thead tr.filters input,
thead tr.filters select {
    font-size: 0.9rem;
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: var(--transition-normal);
}

thead tr.filters input:focus,
thead tr.filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

thead tr.filters input:hover,
thead tr.filters select:hover {
    border-color: var(--primary-dark);
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    border-left: 5px solid;
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.05) 100%);
    border-left-color: var(--danger);
    color: #c0392b;
}

.alert-success {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.05) 100%);
    border-left-color: var(--success);
    color: #2980b9;
}

/* ==========================================
   MODAL
   ========================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 2000;
}

.modal-backdrop:not([hidden]) {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    border: none;
    background: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--dark);
    opacity: 0.5;
    transition: var(--transition-normal);
}

.modal-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* ==========================================
   SUMMARY CARDS
   ========================================== */
.summary-card {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.summary-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.summary-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
}

.summary-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
}

.summary-value {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.summary-card small {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
}

/* ==========================================
   STATUS CHIPS & BADGES
   ========================================== */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.status-chip:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.badge-ok,
.status-ok {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: var(--white);
}

.badge-warning,
.status-warning {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: var(--white);
}

.badge-expired,
.status-expired {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: var(--white);
}

.tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.3);
}

.chip-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

/* ==========================================
   GRID LAYOUTS
   ========================================== */
.grid {
    display: grid;
    gap: 2rem;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid.three {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ==========================================
   TABS
   ========================================== */
.tab-group {
    display: inline-flex;
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    background: rgba(102, 126, 234, 0.1);
    gap: 0.5rem;
}

.tab-group button {
    border: none;
    background: transparent;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    color: var(--dark);
}

.tab-group button.active {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tab-group button:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

/* ==========================================
   SCANNER & VIDEO
   ========================================== */
.scanner-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.video-preview {
    width: 100%;
    border-radius: var(--radius-xl);
    background: #000;
    min-height: 300px;
    max-height: 50vh;
    object-fit: contain;
    border: 3px solid #e1e8ed;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.video-preview:hover {
    box-shadow: var(--shadow-xl);
    transform: scale(1.01);
}

#scan-status {
    text-align: center;
    font-size: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.muted {
    color: #6c757d;
}

/* ==========================================
   TABLE ACTIONS
   ========================================== */
.table-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Larger selection checkboxes in stock list */
.row-checkbox,
#select-all-checkbox {
    width: 22px;
    height: 22px;
}

/* Scanner sayfası için özel buton konumlandırma */
.scanner-wrap .table-actions {
    position: sticky;
    bottom: 1rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.scanner-wrap .table-actions button {
    flex: 1;
    min-width: 140px;
}

.summary-strip {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.summary-strip > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-strip strong {
    color: var(--primary);
    font-weight: 700;
}

.summary-strip span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    transition: var(--transition-normal);
}

.summary-strip span.target-hit {
    color: var(--success);
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ==========================================
   DATATABLES BUTTONS
   ========================================== */
.dt-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dt-button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.dt-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================
   THEME TOGGLE
   ========================================== */
.theme-toggle {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1) rotate(15deg);
}

/* ==========================================
   DARK MODE
   ========================================== */
[data-theme="dark"] {
    --primary: #8b9eff;
    --primary-dark: #6b7cf5;
    --dark: #e4e6eb;
    --light: #1a1a1e;
    --white: #24242e;
}

[data-theme="dark"] body {
    background: var(--light);
    color: var(--dark);
}

[data-theme="dark"] .content {
    background: var(--light);
}

[data-theme="dark"] .card {
    background: var(--white);
    border: 1px solid #3a3a45;
}

[data-theme="dark"] .card-header {
    background: linear-gradient(135deg, #2a2a35 0%, #1a1a1e 100%);
    border-bottom-color: #3a3a45;
}

[data-theme="dark"] .topbar {
    background: linear-gradient(135deg, #1a1a1e 0%, #24242e 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

[data-theme="dark"] .form input[type="text"],
[data-theme="dark"] .form input[type="number"],
[data-theme="dark"] .form input[type="date"],
[data-theme="dark"] .form input[type="password"],
[data-theme="dark"] .form textarea,
[data-theme="dark"] .form select {
    background: var(--white);
    border-color: #3a3a45;
    color: var(--dark);
}

[data-theme="dark"] .form input:focus,
[data-theme="dark"] .form textarea:focus,
[data-theme="dark"] .form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 158, 255, 0.25);
}

[data-theme="dark"] .dataTable-wrapper {
    background: var(--white);
    border: 1px solid #3a3a45;
}

[data-theme="dark"] .dataTable thead {
    background: linear-gradient(135deg, #2a2a35 0%, #1a1a1e 100%);
}

[data-theme="dark"] .dataTable tbody tr:hover {
    background: rgba(139, 158, 255, 0.1);
}

[data-theme="dark"] thead tr.filters th {
    background: rgba(42, 42, 53, 0.9);
    border-bottom-color: #3a3a45;
}

[data-theme="dark"] thead tr.filters input,
[data-theme="dark"] thead tr.filters select {
    background: var(--white);
    border-color: #3a3a45;
    color: var(--dark);
}

[data-theme="dark"] .muted {
    color: #95a5a6;
}

/* ==========================================
   CONTENT & FOOTER
   ========================================== */
.content {
    padding: 2rem;
    min-height: calc(100vh - 100px);
    max-width: 1600px;
    margin: 0 auto;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--dark);
    font-size: 0.9rem;
    border-top: 2px solid #e9ecef;
    margin-top: 2rem;
}

/* ==========================================
   SELECT CHIP (Checkbox)
   ========================================== */
.select-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
}

.select-chip:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.select-chip input[type="checkbox"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.select-chip input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 700;
}

/* ==========================================
   EXPORT TABLE
   ========================================== */
.export-table {
    display: none;
}

.export-table.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    /* Login sayfasını hariç tut - auth-body içindeyse font değiştirme */
    body:not(.auth-body) {
        font-size: 90% !important; /* ~10% küçültme */
    }
    
    .topbar {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .brand {
        font-size: 0.6rem;
    }
    
    .topnav {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .topnav a {
        font-size: 0.425rem !important;
        padding: 0.5rem 0.75rem;
    }
    
    .user-chip {
        font-size: 0.45rem !important;
        padding: 0.5rem 1rem !important;
    }
    
    .content {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h2 {
        font-size: 0.875rem !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* LOGIN SAYFASI İSTİSNASI - Normal boyutlarda kalsın */
    .auth-card {
        padding: 2rem;
        max-width: 100%;
    }
    
    .auth-header h1 {
        font-size: 1.5rem !important;
    }
    
    /* Login formu için istisna */
    .auth-form label {
        font-size: 0.9rem !important;
    }
    
    .auth-form input[type="text"],
    .auth-form input[type="password"],
    .auth-form button {
        font-size: 1rem !important;
        padding: 0.875rem 1.25rem !important;
    }
    
    /* Diğer formlar için küçült */
    .form:not(.auth-form) label,
    .form-row label {
        font-size: 0.475rem !important;
    }
    
    .form:not(.auth-form) input[type="text"],
    .form:not(.auth-form) input[type="number"],
    .form:not(.auth-form) input[type="date"],
    .form:not(.auth-form) input[type="password"],
    .form:not(.auth-form) textarea,
    .form:not(.auth-form) select {
        padding: 0.5rem 0.625rem !important;
        font-size: 0.5rem !important;
    }
    
    /* Butonlar için istisna - auth-body içindeyse normal */
    body:not(.auth-body) .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.5rem !important;
    }
    
    .table-actions .btn {
        width: 100%;
    }
    
    .dt-buttons {
        flex-direction: column;
    }
    
    .dt-button {
        width: 100%;
        font-size: 0.475rem !important;
        padding: 0.375rem 0.75rem !important;
    }
    
    .summary-value {
        font-size: 1rem !important;
    }
    
    .summary-card h3 {
        font-size: 0.6rem !important;
    }
    
    .summary-card small {
        font-size: 0.45rem !important;
    }
    
    .dataTable thead th {
        font-size: 0.9rem !important;
        padding: 0.9rem !important;
    }
    
    .dataTable tbody td {
        font-size: 0.95rem !important;
        padding: 0.9rem !important;
    }
    
    .status-chip,
    .tag {
        font-size: 0.425rem !important;
        padding: 0.175rem 0.425rem !important;
    }
    
    .modal-header h3 {
        font-size: 0.75rem !important;
    }
    
    .form-row.two,
    .form-row.three {
        grid-template-columns: 1fr;
    }
    
    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
    }
    
    .summary-strip {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem !important;
    }
    
    .summary-strip strong,
    .summary-strip span {
        font-size: 0.6rem !important;
    }
    
    /* Scanner sayfası - mobil optimizasyonu */
    .scanner-wrap {
        gap: 1rem;
        margin-top: 0.5rem;
    }
    
    .video-preview {
        min-height: 200px;
        max-height: 40vh;
        object-fit: contain;
    }
    
    /* Scanner butonları - mobilde sticky ve tam genişlik */
    .scanner-wrap .table-actions {
        position: sticky;
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        width: calc(100% - 1rem);
        margin: 0.5rem auto;
        padding: 0.75rem;
        gap: 0.75rem;
        flex-direction: column;
    }
    
    .scanner-wrap .table-actions button {
        width: 100%;
        flex: none;
        min-width: auto;
        padding: 0.875rem 1rem !important;
        font-size: 0.75rem !important;
    }
    
    #scan-status {
        font-size: 0.75rem !important;
        padding: 0.75rem;
    }
    
    .muted {
        font-size: 0.475rem !important;
    }
    
    p.muted {
        font-size: 0.475rem !important;
    }
}

/* ==========================================
   CHART CONTAINERS
   ========================================== */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
    padding: 1rem;
}

/* ==========================================
   MISC
   ========================================== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   RESPONSIVE FIX OVERRIDES (MOBILE/TABLET)
   ========================================== */
@media (max-width: 1024px) {
    .dataTable thead th, .data-table thead th { font-size: 0.9rem !important; padding: 0.9rem !important; }
    .dataTable tbody td, .data-table tbody td { font-size: 0.9rem !important; padding: 0.9rem !important; }
    thead tr.filters input { font-size: 0.9rem !important; padding: 0.6rem 0.75rem !important; }
    .btn { font-size: 0.9rem !important; padding: 0.6rem 1rem !important; }
    .chip-group { gap: 0.5rem; }
}

@media (max-width: 768px) {
    body:not(.auth-body) { font-size: inherit !important; }
    body { overflow-x: hidden !important; overflow-y: auto !important; }
    
    /* Table responsive wrapper */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y pinch-zoom;
        max-height: 70vh;
    }
    
    /* DataTables wrapper */
    .dataTables_wrapper, .dt-container {
        width: 100%;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y pinch-zoom;
        position: relative;
    }
    
    /* Tables themselves */
    .dataTable, .data-table {
        display: block;
        overflow-x: auto;
        overflow-y: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y pinch-zoom;
        width: 100%;
    }
    
    .dataTable-wrapper {
        overflow: visible;
        padding: 1rem;
    }
    
    thead tr.filters input { min-width: 140px; width: 100%; }
    .btn { font-size: 0.9rem !important; padding: 0.6rem 0.9rem !important; }
    .modal { width: 95vw !important; max-width: 95vw !important; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .tab-group { flex-wrap: wrap; }
    .chart-container { min-height: 220px !important; }
}

@media (max-width: 480px) {
    .dataTable thead th, .data-table thead th { font-size: 0.85rem !important; padding: 0.75rem !important; }
    .dataTable tbody td, .data-table tbody td { font-size: 0.85rem !important; padding: 0.75rem !important; }
    
    .table-responsive,
    .dataTables_wrapper, .dt-container {
        width: 100%;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y pinch-zoom;
        max-height: 65vh;
    }
    
    .dataTable, .data-table {
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y pinch-zoom;
    }
    
    thead tr.filters input { min-width: 120px; font-size: 0.85rem !important; }
    .btn { font-size: 0.85rem !important; padding: 0.55rem 0.8rem !important; }
}
