/* Smart Luuq Master - Premium Modern Styling */
:root {
    --bg-main: #0b1120;
    --bg-card: #131c31;
    --bg-card-hover: #1a2642;
    --bg-input: #1e293b;
    --border: #24324f;
    --border-light: #334155;
    
    --primary: #d97706; /* Luuq Coffee Amber */
    --primary-hover: #b45309;
    --primary-light: rgba(217, 119, 6, 0.15);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Layout & Containers */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    background: rgba(13, 20, 36, 0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.brand-logo {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}
.brand span { color: #f59e0b; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.nav-links::-webkit-scrollbar {
    display: none;
}
.nav-item a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}
.nav-item a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.nav-item.active a {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    font-weight: 700;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 12px 4px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 28px 0 60px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-secondary {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--border);
    color: #fff;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* Cards & Grid */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}
.stat-card.gida::before { background: var(--success); }
.stat-card.kagit::before { background: var(--warning); }
.stat-card.temizlik::before { background: var(--info); }
.stat-card.termos::before { background: #8b5cf6; }
.stat-card.genel::before { background: var(--primary); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
    margin-bottom: 8px;
}
.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-val, .stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.2;
}
.stat-sub, .stat-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Panel */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}
.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: rgba(255, 255, 255, 0.01);
}
.panel-title {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel-body {
    padding: 24px;
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}
.data-table th {
    padding: 14px 16px;
    background: rgba(11, 17, 32, 0.6);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}
.data-table tr:hover td {
    background: var(--bg-card-hover);
}
.data-table tr.passive-row td {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.15);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-gida { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-kagit { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-temizlik { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-termos { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-diger { background: rgba(100, 116, 139, 0.15); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.3); }

/* Form Controls */
.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}
.count-input {
    width: 90px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: #0f172a;
    border: 1px solid #334155;
    color: #38bdf8;
}
.count-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.loose-input {
    color: #f59e0b;
}
.loose-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Category Filter Pills */
.filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pill {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.pill:hover {
    color: #fff;
    border-color: var(--border-light);
}
.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    background: #1e293b;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease forwards;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modals */
.modal-overlay, .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.modal-overlay.active, .modal-backdrop.active, .modal.active {
    display: flex !important;
}

/* If someone uses .modal as overlay directly */
.modal.active:not(.modal-dialog) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.modal, .modal-content, .modal-dialog {
    background: #111a2e;
    border: 1px solid #243556;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #243556;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}
.modal-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}
.modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1;
}
.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.modal-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #243556;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .grid-4, .stats-grid { grid-template-columns: 1fr; }
    .count-input { width: 75px; }
}
