/* ============================================
   ALTUNER TAKSİ - TASARIM SİSTEMİ
   ============================================
   Mobile-First, Responsive, Taksi Sarısı Tema
   Aydınlık / Karanlık Mod Desteği
   ============================================ */

/* ========== CSS DEĞİŞKENLERİ ========== */
:root {
    /* Taksi Sarısı Paleti */
    --taxi-yellow: #FFC107;
    --taxi-yellow-hover: #FFD54F;
    --taxi-yellow-dark: #FFA000;
    --taxi-yellow-light: #FFF8E1;
    --taxi-yellow-glow: rgba(255, 193, 7, 0.25);

    /* Aydınlık Mod */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-card: #FFFFFF;
    --bg-input: #F8F9FA;
    --bg-header: rgba(255, 255, 255, 0.92);
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --border-light: #F0F0F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);

    /* Durum Renkleri */
    --success: #22C55E;
    --success-bg: #F0FDF4;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --warning: #F59E0B;
    --info: #3B82F6;

    /* Tipografi */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;

    /* Boşluk */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-base: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Geçiş */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Layout */
    --header-height: 60px;
    --max-width: 480px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== KARANLIK MOD ========== */
[data-theme="dark"] {
    --bg-primary: #0F0F0F;
    --bg-secondary: #1A1A1A;
    --bg-card: #1E1E1E;
    --bg-input: #252525;
    --bg-header: rgba(15, 15, 15, 0.92);
    --text-primary: #E8E8E8;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --border-color: #2D2D2D;
    --border-light: #252525;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.5);
    --success-bg: rgba(34, 197, 94, 0.1);
    --danger-bg: rgba(239, 68, 68, 0.1);
}

/* ========== RESET ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input, textarea, select, button {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}

a { color: var(--taxi-yellow-dark); text-decoration: none; }

/* ========== UTILITY ========== */
.hidden { display: none !important; }
.required { color: var(--danger); }
.optional { color: var(--text-muted); font-size: var(--font-size-xs); font-weight: 400; }

/* ========== LOADING SCREEN ========== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--border-color);
    border-top-color: var(--taxi-yellow);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.loading-emoji {
    font-size: 32px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-text {
    margin-top: var(--space-base);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ========== OFFLINE BANNER ========== */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--danger);
    color: white;
    padding: var(--space-sm) var(--space-base);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-align: center;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ========== SCREENS ========== */
.screen {
    min-height: 100vh;
    min-height: 100dvh;
}

/* ========== LOGIN ========== */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: linear-gradient(160deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.logo-emoji {
    font-size: 56px;
    display: block;
    margin-bottom: var(--space-md);
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.login-logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

.login-form {
    width: 100%;
    max-width: 360px;
}

/* ========== FORM ELEMENTLERI ========== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

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

.input-icon {
    position: absolute;
    left: var(--space-md);
    font-size: 18px;
    z-index: 1;
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper textarea {
    width: 100%;
    padding: var(--space-md) var(--space-base) var(--space-md) 44px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
    border-color: var(--taxi-yellow);
    box-shadow: 0 0 0 3px var(--taxi-yellow-glow);
    background: var(--bg-primary);
}

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

.textarea-wrapper {
    align-items: flex-start;
}

.textarea-wrapper .input-icon {
    top: var(--space-md);
}

.textarea-wrapper textarea {
    resize: vertical;
    min-height: 80px;
}

.toggle-password {
    position: absolute;
    right: var(--space-md);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: var(--space-xs);
    opacity: 0.6;
    transition: var(--transition-fast);
}

.toggle-password:hover { opacity: 1; }

.form-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-base);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========== BUTONLAR ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    min-height: 48px;
    -webkit-user-select: none;
    user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--taxi-yellow);
    color: #1A1A1A;
    border-color: var(--taxi-yellow);
}

.btn-primary:hover {
    background: var(--taxi-yellow-hover);
    box-shadow: 0 4px 15px var(--taxi-yellow-glow);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    border-color: var(--taxi-yellow);
    color: var(--taxi-yellow);
}

.btn-full { width: 100%; }

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    min-height: 36px;
    border-radius: var(--radius-sm);
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: currentColor;
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.icon-btn:hover {
    background: var(--bg-secondary);
}

/* ========== HEADER ========== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-base);
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-logo {
    font-size: 28px;
}

.header-title h1 {
    font-size: var(--font-size-md);
    font-weight: 700;
    line-height: 1.2;
}

.header-user {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ========== SIDE MENU ========== */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg-card);
    z-index: 201;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu.open {
    right: 0;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.menu-logo { font-size: 36px; }

.menu-title {
    font-weight: 700;
    font-size: var(--font-size-md);
}

.menu-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.menu-list {
    list-style: none;
    flex: 1;
    padding: var(--space-sm) 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.menu-item:hover, .menu-item.active {
    background: var(--taxi-yellow-light);
    color: var(--taxi-yellow-dark);
}

[data-theme="dark"] .menu-item:hover,
[data-theme="dark"] .menu-item.active {
    background: rgba(255, 193, 7, 0.1);
    color: var(--taxi-yellow);
}

.menu-icon { font-size: 18px; }

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-sm) 0;
}

.menu-logout { color: var(--danger) !important; }

.menu-footer {
    padding: var(--space-base) var(--space-lg);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

/* ========== PAGES ========== */
.page {
    display: none;
    padding: calc(var(--header-height) + var(--space-base)) var(--space-base) calc(var(--space-3xl) + var(--safe-bottom));
    max-width: var(--max-width);
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.page.active { display: block; }

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

.page-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.page-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.back-btn {
    background: none;
    border: none;
    color: var(--taxi-yellow-dark);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    padding: var(--space-sm);
    transition: var(--transition-fast);
}

.back-btn:hover { opacity: 0.7; }

/* ========== TOPLAM ALACAK KARTI ========== */
.total-card {
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--taxi-yellow) 0%, var(--taxi-yellow-dark) 100%);
    padding: 3px;
    box-shadow: 0 8px 32px var(--taxi-yellow-glow);
    animation: cardEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardEnter {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.total-card-inner {
    background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
    border-radius: calc(var(--radius-xl) - 2px);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.total-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.total-amount {
    color: var(--taxi-yellow);
    font-size: var(--font-size-3xl);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.total-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-xs);
    margin-top: var(--space-sm);
}

/* ========== ARAMA ÇUBUĞU ========== */
.search-bar {
    position: relative;
    margin-bottom: var(--space-lg);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 1;
}

.search-bar input {
    width: 100%;
    padding: var(--space-md) var(--space-2xl) var(--space-md) 44px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-bar input:focus {
    border-color: var(--taxi-yellow);
    box-shadow: 0 0 0 3px var(--taxi-yellow-glow);
}

.search-clear {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.search-clear:hover {
    background: var(--danger);
    color: white;
}

/* ========== FAB (Floating Action Button) ========== */
.fab {
    position: fixed;
    bottom: calc(24px + var(--safe-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--taxi-yellow);
    color: #1A1A1A;
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--taxi-yellow-glow), 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: var(--transition);
    animation: fabEnter 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.3s both;
}

@keyframes fabEnter {
    from { transform: scale(0) rotate(-180deg); }
    to { transform: scale(1) rotate(0); }
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--taxi-yellow-glow), 0 4px 12px rgba(0,0,0,0.3);
}

.fab:active { transform: scale(0.95); }

/* ========== VERESİYE LİSTESİ ========== */
.debt-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.debt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-base);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    animation: cardSlideUp 0.3s ease;
}

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

.debt-card:active {
    transform: scale(0.99);
}

.debt-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.debt-customer {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--text-primary);
}

.debt-amount {
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: var(--taxi-yellow-dark);
    white-space: nowrap;
}

[data-theme="dark"] .debt-amount {
    color: var(--taxi-yellow);
}

.debt-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-base);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.debt-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.debt-original {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-decoration: line-through;
}

.debt-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
}

.debt-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-xs);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    min-height: 44px;
    justify-content: center;
}

.debt-action-btn:hover {
    border-color: var(--taxi-yellow);
    color: var(--taxi-yellow-dark);
}

.debt-action-btn .action-icon {
    font-size: 16px;
}

.debt-action-btn.btn-pay { color: var(--success); }
.debt-action-btn.btn-pay:hover { background: var(--success-bg); border-color: var(--success); }

.debt-action-btn.btn-edit { color: var(--info); }
.debt-action-btn.btn-edit:hover { background: rgba(59, 130, 246, 0.08); border-color: var(--info); }

.debt-action-btn.btn-close-debt { color: var(--danger); }
.debt-action-btn.btn-close-debt:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: var(--space-base);
}

.empty-state p {
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-base);
}

/* ========== LIST LOADER ========== */
.list-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--taxi-yellow);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

/* ========== LOG LİSTESİ ========== */
.log-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.log-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    animation: cardSlideUp 0.3s ease;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.log-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.log-badge.type-debt_added { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.log-badge.type-partial_payment { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.log-badge.type-debt_edited { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.log-badge.type-debt_closed { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.log-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.log-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.load-more {
    margin-top: var(--space-base);
}

/* ========== AYARLAR ========== */
.settings-section {
    margin-bottom: var(--space-xl);
}

.settings-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-base);
}

.settings-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-base);
}

.settings-row .settings-desc { margin-bottom: 0; }

.about-info p {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xs);
}

/* ========== TOGGLE SWITCH ========== */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 28px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: var(--radius-full);
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--taxi-yellow);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.modal-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 0 var(--space-lg) var(--space-base);
}

.modal-footer {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-base) var(--space-lg) calc(var(--space-lg) + var(--safe-bottom));
}

.modal-footer .btn { flex: 1; }

.payment-info {
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-base);
    line-height: 1.6;
}

/* ========== TOAST BİLDİRİMLER ========== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-sm));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--space-2xl));
    max-width: var(--max-width);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-base);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error   { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info    { border-left: 4px solid var(--info); }

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px); }
}

.toast-icon { font-size: 18px; flex-shrink: 0; }

/* ========== DEBT FORM ========== */
.debt-form {
    animation: fadeIn 0.3s ease;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 768px) {
    :root {
        --header-height: 64px;
        --max-width: 520px;
    }

    .modal-content {
        border-radius: var(--radius-xl);
        margin-bottom: 10vh;
    }

    .modal {
        align-items: center;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 340px) {
    :root {
        --space-base: 12px;
        --font-size-base: 0.8125rem;
    }
    
    .total-amount {
        font-size: var(--font-size-2xl);
    }
    
    .debt-card-actions {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== SAFE AREA (iPhone Notch) ========== */
@supports (padding: env(safe-area-inset-top)) {
    .app-header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--header-height) + env(safe-area-inset-top));
    }

    .page {
        padding-top: calc(var(--header-height) + env(safe-area-inset-top) + var(--space-base));
    }
}

/* ========== PRINT ========== */
@media print {
    .app-header, .fab, .side-menu, .menu-overlay, 
    .debt-card-actions, .search-bar, .toast-container, .bottom-nav { display: none !important; }
    
    .page { padding-top: 0; }
    .debt-card { break-inside: avoid; }
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + var(--safe-bottom));
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-bottom);
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

[data-theme="dark"] .bottom-nav {
    box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
}

.nav-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    padding: var(--space-xs) 0;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
    transition: var(--transition-fast);
}

.nav-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-btn.active {
    color: var(--taxi-yellow-dark);
}

[data-theme="dark"] .nav-btn.active {
    color: var(--taxi-yellow);
}

.nav-btn.active .nav-icon {
    transform: scale(1.15);
}

/* Page padding bottom to prevent bottom nav overlap */
.page {
    padding-bottom: calc(80px + var(--safe-bottom)) !important;
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: var(--max-width);
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ========== CUSTOMER CARDS (GROUPED VIEW) ========== */
.customer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: var(--space-md);
    animation: cardSlideUp 0.3s ease;
}

.customer-card.expanded {
    box-shadow: var(--shadow-md);
    border-color: var(--taxi-yellow-dark);
}

[data-theme="dark"] .customer-card.expanded {
    border-color: var(--taxi-yellow);
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-base);
    cursor: pointer;
    background: transparent;
    transition: var(--transition-fast);
    -webkit-user-select: none;
    user-select: none;
}

.customer-header:hover {
    background: var(--bg-secondary);
}

.customer-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.customer-name {
    font-weight: 700;
    font-size: var(--font-size-md);
    color: var(--text-primary);
}

.customer-count-badge {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.customer-phone-meta {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

.customer-amount-col {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-align: right;
}

.customer-total-amount {
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: var(--taxi-yellow-dark);
    white-space: nowrap;
}

[data-theme="dark"] .customer-total-amount {
    color: var(--taxi-yellow);
}

.expand-indicator {
    font-size: 12px;
    color: var(--text-muted);
    transition: var(--transition);
}

/* Accordion details expanded list */
.customer-details {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-base) var(--space-md);
    animation: slideDownAccordion 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDownAccordion {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sub-records-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sub-record-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.sub-record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.sub-record-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sub-record-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.sub-record-amount {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.sub-record-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    border-left: 3px solid var(--taxi-yellow);
}

.sub-record-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-xs);
}

.customer-details-header {
    display: flex;
    justify-content: space-between;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

.btn-bulk-pay,
.btn-bulk-edit,
.btn-close-all {
    flex: 1 1 calc(33.33% - 8px);
    min-width: 90px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    border: 1.5px solid transparent;
}

/* Ödeme Al (Blue) */
.btn-bulk-pay {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-bulk-pay:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

/* Düzenle (Orange/Accent) */
.btn-bulk-edit {
    border-color: #ff9800;
    color: #ff9800;
}
.btn-bulk-edit:hover {
    background: #ff9800;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

/* Tümünü Kapat (Green) */
.btn-close-all {
    border-color: var(--success);
    color: var(--success);
}
.btn-close-all:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

/* Sub-record paid info banner */
.sub-record-paid-info {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--success);
    background: rgba(46, 125, 50, 0.08);
    border-left: 3px solid var(--success);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    margin-top: 4px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

[data-theme="dark"] .sub-record-paid-info {
    background: rgba(76, 175, 80, 0.12);
    color: #81c784;
    border-left-color: #81c784;
}

/* Closed sub-record styling */
.sub-record-closed {
    opacity: 0.65;
    border-color: rgba(46, 125, 50, 0.2);
    background: rgba(46, 125, 50, 0.02);
}

.sub-record-actions-placeholder {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-muted);
    font-style: italic;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px dashed var(--border-color);
    margin-top: var(--space-sm);
}

/* Green paid notice */
.sub-record-paid-info.closed-paid {
    background: rgba(46, 125, 50, 0.12) !important;
    color: var(--success) !important;
    border-left-color: var(--success) !important;
}

[data-theme="dark"] .sub-record-paid-info.closed-paid {
    background: rgba(76, 175, 80, 0.18) !important;
    color: #81c784 !important;
    border-left-color: #81c784 !important;
}

/* ========== ÖZEL AUTOCOMPLETE DROPDOWN ========== */

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 4px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1.5px solid var(--taxi-yellow);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: acSlideIn 0.18s ease-out;
}

[data-theme="dark"] .autocomplete-dropdown {
    background: #1e1e1e;
    border-color: var(--taxi-yellow);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 193, 7, 0.1);
}

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

.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--taxi-yellow) transparent;
}

.autocomplete-list::-webkit-scrollbar {
    width: 5px;
}

.autocomplete-list::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-list::-webkit-scrollbar-thumb {
    background: var(--taxi-yellow);
    border-radius: 10px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.2);
}

[data-theme="dark"] .autocomplete-item:hover,
[data-theme="dark"] .autocomplete-item.active {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.25);
}

.ac-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 50%;
}

[data-theme="dark"] .ac-icon {
    background: rgba(255, 193, 7, 0.15);
}

.ac-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.ac-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-name mark {
    background: rgba(255, 193, 7, 0.35);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: 700;
}

[data-theme="dark"] .ac-name mark {
    background: rgba(255, 193, 7, 0.4);
}

.ac-phone {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

