:root {
    /* Light Theme (Default) */
    --bg-main: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.6);
    --input-bg: rgba(248, 250, 252, 0.7);
    --record-bg: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);

    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-text: #b91c1c;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --success-text: #047857;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-text: #b45309;

    --neutral: #94a3b8;
    --neutral-light: #f1f5f9;
    --neutral-text: #475569;
    
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary: #3b82f6; /* Keep primary bright */
    --primary-hover: #2563eb;
    
    /* Shadows for dark mode (subtler) */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    
    --primary-light: rgba(99, 102, 241, 0.2);
    --danger-light: rgba(239, 68, 68, 0.2);
    --danger-text: #fca5a5;
    --success-light: rgba(16, 185, 129, 0.2);
    --success-text: #6ee7b7;
    --warning-light: rgba(245, 158, 11, 0.2);
    --warning-text: #fcd34d;
    --neutral-light: #334155;
    --neutral-text: #cbd5e1;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Decorative Background */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        radial-gradient(at 40% 20%, rgba(var(--primary-rgb), 0.08) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(var(--secondary-rgb), 0.08) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(var(--info-rgb), 0.08) 0px, transparent 50%);
    z-index: -2;
    pointer-events: none;
}

/* Watermark */
.watermark-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.04;
    user-select: none;
}

[data-theme="dark"] .watermark-bg {
    opacity: 0.02;
}

.apple-logo {
    width: 60vw;
    max-width: 600px;
    height: auto;
    fill: var(--text-main);
}

.watermark-text {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    font-weight: 900;
    text-align: center;
    color: var(--bg-color);
    line-height: 1.2;
    letter-spacing: 3px;
    white-space: nowrap;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    height: 100vh;
    box-sizing: border-box;
    position: relative;
}

/* Default Mobile Elements Hidden on Desktop */
.mobile-bottom-nav {
    display: none;
}

.main-content {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2.5rem;
    flex: 1;
    min-height: 0;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible !important;
    position: relative;
    z-index: 999;
}

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

.logo-icon-wrapper {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.date-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.75rem 1.25rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.date-badge .material-symbols-rounded {
    font-size: 1.2rem;
    color: var(--primary);
}



/* Modern Panel Utilities */
.modern-panel {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: none;
    overflow: hidden;
}

.card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    padding: 1rem 1rem 0.5rem 1rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.card-header .subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Form Styles */
.record-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-left: 0.25rem;
}

.required {
    color: var(--danger);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 0.6rem 0.8rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.input-wrapper textarea {
    resize: vertical;
    padding-top: 0.875rem;
    min-height: 100px;
}

.textarea-wrapper .icon {
    top: 0.875rem;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    outline: none;
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-wrapper input:focus + .icon,
.input-wrapper select:focus + .icon,
.input-wrapper textarea:focus + .icon {
    color: var(--primary);
}

.input-wrapper select {
    appearance: none;
    cursor: pointer;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-main);
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary {
    background: var(--neutral-light);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* List Section */
.list-container {
    display: flex;
    flex-direction: column;
}

.list-header {
    padding: 2rem 2rem 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.list-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-box input {
    width: 100%;
    background: var(--input-bg);
    border: 2px solid transparent;
    border-radius: 30px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    background: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.filter-tabs {
    display: flex;
    padding: 0 2rem 1rem 2rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.filter-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border-radius: 30px;
}

.filter-tab:hover {
    background: var(--neutral-light);
    color: var(--text-main);
}

.filter-tab.active {
    background: var(--text-main);
    color: white;
}

.records-list {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 250px);
}

.records-list::-webkit-scrollbar {
    width: 6px;
}
.records-list::-webkit-scrollbar-track {
    background: transparent;
}
.records-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.records-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Record Item - Modern Card */
.record-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: var(--transition);
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.record-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transform: translateY(-2px);
}

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

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

.record-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.record-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.record-title .device-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Status Badges */
.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-bekliyor { background: var(--warning-light); color: var(--warning-text); }
.status-islemde { background: var(--primary-light); color: var(--primary); }
.status-tamamlandi { background: var(--success-light); color: var(--success-text); }
.status-teslim { background: var(--neutral-light); color: var(--neutral-text); }
.status-iade { background: var(--danger-light); color: var(--danger-text); }

.record-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.record-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.record-detail .icon-wrapper {
    background: var(--neutral-light);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-detail .icon-wrapper .material-symbols-rounded {
    font-size: 1.1rem;
}

.detail-content span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.detail-content p {
    color: var(--text-main);
    font-weight: 600;
}

.issue-full-width {
    grid-column: 1 / -1;
    background: var(--input-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.issue-full-width .icon-wrapper {
    background: var(--card-bg);
    color: var(--primary);
}

.record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.record-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.record-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: var(--neutral-light);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}
.action-btn.whatsapp-btn { 
    background: #25D366; 
    color: white; 
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.action-btn.whatsapp-btn:hover { 
    background: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}
.action-btn.edit { color: var(--info); }
.action-btn.edit:hover { background: var(--info); color: white; border-color: var(--info); }

.action-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--text-muted);
}

.empty-state .material-symbols-rounded {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* WhatsApp & Role specific buttons */
.action-btn.whatsapp:hover {
    background: #dcf8c6;
    color: #128c7e;
}
[data-theme="dark"] .action-btn.whatsapp:hover {
    background: rgba(18, 140, 126, 0.2);
    color: #25d366;
}
.text-success { color: var(--success) !important; font-weight: 700; }
.customer-tracking-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease 0.1s both;
}

/* Tracker badges */
.tracking-status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Header profile stats layout */
.stats-container { display: flex; gap: 1.5rem; border-right: 1px solid var(--border-color); padding-right: 1.5rem; margin-right: 1.5rem; }
.stat-box { display: flex; flex-direction: column; align-items: flex-start; }
.stat-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.user-info { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.user-info .avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.user-details { display: flex; flex-direction: column; }
.user-email { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.user-role { font-size: 0.75rem; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 0.1rem 0.5rem; border-radius: 10px; display: inline-block; width: max-content; }
.user-role.admin { color: var(--warning-text); background: var(--warning-light); }
.icon-btn { background: var(--neutral-light); border: none; color: var(--text-muted); width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); margin-left: 0.5rem; }
.icon-btn:hover { background: var(--border-color); color: var(--text-main); }
.icon-btn.logout-btn:hover { background: var(--danger-light); color: var(--danger); }

/* Dropdown Menu */
.dropdown-menu.show, .modal-overlay.show { display: flex !important; }
.dropdown-item:hover { background: var(--border-color) !important; }

/* Responsive */
@media (max-width: 1024px) {
    html, body {
        height: auto;
        overflow: auto;
    }
    .app-container {
        height: auto;
        min-height: 100vh;
    }
    .main-content {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .form-section, .records-section, .card.modern-panel, .records-list {
        overflow: visible !important;
        height: auto !important;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .record-body {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        padding: 1.5rem;
    }
    
    .record-form, .records-list {
        padding: 1.5rem;
    }
}

/* Inline Editing Styles */
.modern-input, .inline-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-main);
    color: var(--text-main);
    transition: all 0.3s ease;
    margin-top: 0.2rem;
}
.inline-input {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    border-radius: 6px;
    background: var(--input-bg);
}
.modern-input:focus, .inline-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

select.status-badge {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid transparent;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22rgba(0,0,0,0.4)%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7em top 50%;
    background-size: 0.65em auto;
    padding-right: 2.2rem;
    transition: all 0.2s ease;
}
select.status-badge:hover {
    filter: brightness(0.95);
}
select.status-badge:focus {
    border-color: rgba(0,0,0,0.1);
}
.status-badge option {
    background: #ffffff;
    color: #0f172a;
    font-weight: 500;
}

/* --- YÖN BİLİŞİM: NEW UI COMPONENTS --- */

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-main);
    z-index: 1000;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
    text-align: center;
    animation: fadeIn 0.5s ease;
}
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.login-brand .material-symbols-rounded {
    font-size: 3rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}
.login-brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-main);
}
.login-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}
.login-card .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

/* Main App Container */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

/* App Header */
.app-header {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.logo-icon-wrapper {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.header-logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}
.header-logo .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}

/* Header Profile & Stats */
.header-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.stats-panel {
    display: flex;
    gap: 1.5rem;
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--neutral-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-text);
}
.user-info {
    display: flex;
    flex-direction: column;
}
.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.user-rank {
    font-size: 0.75rem;
    color: var(--success-text);
    font-weight: 600;
    background: var(--success-light);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    margin-top: 2px;
}

/* --- MODAL STYLES --- */
.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

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

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

@media (max-width: 768px) {
    /* App-Like Mobile Layout */
    html, body {
        height: 100vh !important;
        overflow: hidden !important;
    }
    .app-container {
        height: 100vh !important;
        min-height: auto !important;
        padding: 1rem;
        padding-bottom: 80px; /* Space for bottom nav */
    }
    .main-content {
        min-height: 0 !important;
    }
    
    /* Tab System */
    .form-section, .records-section, .management-section {
        display: none !important;
        height: 100% !important;
    }
    .form-section.mobile-active, .records-section.mobile-active, .management-section.mobile-active {
        display: flex !important;
    }
    
    .card.modern-panel {
        overflow-y: auto !important;
    }
    .records-list {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .management-section {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(var(--card-bg-rgb), 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 1000;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    }
    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(30, 41, 59, 0.85);
    }
    
    .mobile-bottom-nav .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.8rem 0;
        color: var(--text-muted);
        text-decoration: none;
        gap: 0.3rem;
        transition: all 0.2s ease;
    }
    .mobile-bottom-nav .nav-item span:first-child {
        font-size: 1.5rem;
    }
    .mobile-bottom-nav .nav-item span:last-child {
        font-size: 0.7rem;
        font-weight: 600;
    }
    .mobile-bottom-nav .nav-item.active {
        color: var(--primary);
    }
    
    /* Compact Header */
    .app-header {
        padding: 1rem !important;
        gap: 0.75rem;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
    .logo {
        flex-shrink: 0;
    }
    .logo h1 { font-size: 1.1rem !important; }
    .logo .subtitle { display: none !important; }
    .logo-icon-wrapper { width: 32px; height: 32px; }
    .logo-icon-wrapper img { width: 32px !important; height: 32px !important; }
    
    .header-profile {
        width: auto;
        flex-direction: row;
        gap: 0;
        justify-content: flex-end;
        flex: 1;
        min-width: 0;
    }
    
    /* Move Search Box and Stats inside Form Section when Mobile */
    .stats-container, .user-info, .dropdown-wrapper {
        display: none !important; /* Only accessed via Management Tab */
    }
    #dashboardTrackingForm {
        width: 100%;
        padding-right: 0 !important;
        margin-top: 0;
        min-width: 0;
        flex: 1;
    }
    #dashboardTrackingForm > div {
        width: 100% !important;
        min-width: 0;
    }
    #dashboardTrackingInput {
        padding: 0.6rem 0.5rem 0.6rem 2.2rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Mobile Records Layout */
    .date-badge, #exportExcelBtn {
        display: none !important;
    }
    .record-body {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .record-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    .record-actions {
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap;
    }
    .record-actions .action-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Hover Scaling Effect for Pricing Cards and Panels */
.pricing-card, .modern-panel {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pricing-card:hover, .modern-panel:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* Pricing Card Special State (6 months) is already translated Y -10px, so hover should translate a bit more */
.pricing-card[style*="transform: translateY(-10px)"]:hover {
    transform: translateY(-18px) scale(1.02) !important;
}

/* =========================================================================
   SUPER ADMIN PANEL (SAAS YÖNETİM MERKEZİ) PREMIUM GLASSMORPHISM STYLES
   ========================================================================= */

/* Main Container and Background */
#superAdminPanel {
    background: #0f172a !important; /* Force dark background */
    background-image: 
        radial-gradient(at 40% 20%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(236, 72, 153, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(14, 165, 233, 0.15) 0px, transparent 50%) !important;
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

/* Glass Panels (Tables, Modals) */
.sa-glass-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Stat Cards */
.sa-stat-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sa-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.sa-stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
}

.sa-stat-card:hover::before {
    opacity: 1;
}

.sa-stat-card > div {
    position: relative;
    z-index: 1;
}

/* Stat Values Glow */
.sa-glow-text {
    text-shadow: 0 0 20px currentColor;
}

/* Inputs and Selects inside SA Panel */
.sa-input {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
}

.sa-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.sa-input::placeholder {
    color: #64748b;
}

/* Action Buttons */
.sa-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sa-action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

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

/* Table specific styles */
.sa-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.sa-table th {
    padding: 1rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.sa-table td {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.sa-table td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.sa-table td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.sa-table tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

/* Modal Overlay */
.modal-overlay {
    animation: saFadeIn 0.2s ease-out forwards;
}

@keyframes saFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

/* Filter Buttons */
.sa-filter-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sa-filter-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sa-filter-btn.active {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}
.toast-message {
    background: var(--card-bg, white);
    color: var(--text-main, #333);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    border-left: 6px solid var(--primary);
    pointer-events: auto;
    max-width: 400px;
    font-weight: 500;
}
.toast-message.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-message.hiding {
    transform: translateX(120%);
    opacity: 0;
}
.toast-message.success { border-left-color: #10b981; }
.toast-message.error { border-left-color: #ef4444; }
.toast-message.warning { border-left-color: #f59e0b; }
.toast-message.info { border-left-color: #3b82f6; }
.toast-icon {
    font-size: 1.5rem;
}
.toast-message.success .toast-icon { color: #10b981; }
.toast-message.error .toast-icon { color: #ef4444; }
.toast-message.warning .toast-icon { color: #f59e0b; }
.toast-message.info .toast-icon { color: #3b82f6; }

.profile-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}
.profile-menu .dropdown-item:hover {
    background: rgba(0,0,0,0.05) !important;
}
