/* ==========================================================================
   AKILLI MUHASEBE - MASTER STYLESHEET (V6 - FORM & TABLE ALIGNMENT FIX)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ==========================================================================
   CEPTEFATURA — tasarım sistemi
   ========================================================================== */

* {
    box-sizing: border-box
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --sidebar-width: 240px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-panel: 4px 0 18px rgba(15, 23, 42, 0.06);
    --shadow-bar: 0 4px 14px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0 14px 32px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --radius: 8px;
    color-scheme: light;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font: inherit;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"],
.stat-card .value,
.totals-card {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* --- ANA DÜZEN --- */
body:not(.auth-page) {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

#sidebar-container {
    flex-shrink: 0;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    height: 100%;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-panel);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 10px -8px rgba(15, 23, 42, 0.12);
}

    .brand-logo {
        height: 40px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        display: block;
    }

.brand strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    font-weight: 700;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-size: 11px;
}

.nav {
    padding-top: 20px;
    display: grid;
    gap: 4px;
}

    .nav a[hidden] {
        display: none !important;
    }

    .nav a, .logout {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 10px;
        color: #475569;
        font-size: 14px;
        font-weight: 500;
        transform-origin: left center;
        transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }

        .nav a:hover, .logout:hover {
            background: #f8fafc;
            color: #0f172a;
            transform: scale(1.12);
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
            z-index: 1;
        }

        .nav a:active {
            transform: scale(1.06);
        }

        .nav a.active {
            background: #eff6ff;
            color: #1d4ed8;
            font-weight: 600;
            border-left: 3px solid var(--primary);
            padding-left: 7px;
            border-radius: 10px;
        }

        .nav a.active:hover {
            background: #dbeafe;
            transform: scale(1.12);
        }

.nav-ic {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform 0.18s ease, background 0.18s ease;
}

    .nav a:hover .nav-ic {
        transform: scale(1.22);
    }

    .nav a.active .nav-ic {
        transform: scale(1.1);
    }

.nav .tone-blue .nav-ic { color: #2563eb; background: #eff6ff; }
.nav .tone-sky .nav-ic { color: #0284c7; background: #f0f9ff; }
.nav .tone-amber .nav-ic { color: #d97706; background: #fffbeb; }
.nav .tone-indigo .nav-ic { color: #4f46e5; background: #eef2ff; }
.nav .tone-emerald .nav-ic { color: #059669; background: #ecfdf5; }
.nav .tone-slate .nav-ic { color: #475569; background: #f1f5f9; }

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 10px -8px rgba(15, 23, 42, 0.1);
    padding-top: 16px;
}

/* --- MAIN WORKSPACE --- */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#header-container {
    width: 100%;
}

.topbar {
    height: 72px;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-bar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-sizing: border-box;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.icon-btn {
    border: 0;
    background: var(--bg);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
    display: grid;
    place-items: center;
    transition: background 0.2s;
}

    .icon-btn:hover {
        background: #e2e8f0;
        color: var(--text);
    }

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    border: 1px solid transparent;
    transform-origin: right center;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

    .user-menu:hover,
    .user-menu.open {
        background: var(--bg);
        border-color: var(--border);
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
        transform: scale(1.02);
        z-index: 5;
    }

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow:
        0 0 0 2px #2563eb,
        0 6px 16px rgba(37, 99, 235, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

    .user-menu:hover .avatar,
    .user-menu.open .avatar {
        transform: scale(1.12);
        box-shadow:
            0 0 0 2px #1d4ed8,
            0 10px 22px rgba(37, 99, 235, 0.45);
    }

.user-menu strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    font-weight: 700;
    transition: transform 0.18s ease;
}

.user-menu small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 1px;
}

.mobile-title {
    display: none;
}

/* --- İÇERİK ALANI & HİZALAMA MERKEZİ --- */
.content {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 36px 30px 60px;
    box-sizing: border-box;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    width: 100%;
}

    .page-heading h1 {
        font-size: 20px;
        line-height: 1.2;
        margin: 0 0 6px;
        font-weight: 600;
        letter-spacing: -0.3px;
        color: var(--text);
    }

    .page-heading p {
        margin: 0;
        color: var(--muted);
        font-size: 14px;
    }

/* --- BUTTONS --- */
.btn {
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    height: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    }

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

    .btn-secondary:hover {
        background: var(--bg);
        border-color: #cbd5e1;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

    .btn-danger:hover {
        background: #fee2e2;
    }

/* --- GRID & CARDS --- */
.grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.two-col {
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
}

.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

    .card:hover {
        box-shadow: var(--shadow-card-hover);
    }

.stat-card {
    position: relative;
    min-height: 130px;
}

    .stat-card:hover {
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-2px);
    }

    .stat-card .label {
        color: var(--muted);
        font-size: 13px;
        font-weight: 500;
    }

    .stat-card .value {
        font-size: 24px;
        font-weight: 700;
        margin: 10px 0 6px;
        color: var(--text);
        letter-spacing: -0.3px;
        font-feature-settings: "tnum" 1;
        font-variant-numeric: tabular-nums;
    }

    .stat-card .change {
        font-size: 12px;
        color: var(--success);
        font-weight: 600;
    }

.stat-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: bold;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

    .card-header h2 {
        font-size: 16px;
        margin: 0;
        font-weight: 500;
        color: var(--text);
    }

.link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

    .link:hover {
        text-decoration: underline;
    }

/* --- FORM KARTLARI VE DÜZENİ (DÜZELTİLDİ) --- */
.form-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

    .form-group.full {
        grid-column: 1 / -1;
    }

    .form-group label {
        font-size: 14px;
        font-weight: 500;
        color: #334155;
    }

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
}

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        height: 42px;
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 0 14px;
        outline: none;
        background: #fff;
        color: var(--text);
        transition: border-color 0.2s, box-shadow 0.2s;
        box-sizing: border-box;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    }

    .form-group select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        padding-right: 42px;
        background-color: #fff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        background-size: 16px 16px;
        cursor: pointer;
    }

    .form-group select::-ms-expand {
        display: none;
    }

    .form-group textarea {
        height: auto;
        padding: 10px 14px;
        min-height: 88px;
    }

        .form-group input:hover,
        .form-group select:hover,
        .form-group textarea:hover {
            border-color: #94a3b8;
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
        }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
        }

        .form-group select:focus {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        }

.input-password {
    position: relative;
}

    .input-password input {
        width: 100%;
        padding-right: 44px;
    }

.pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

    .pw-toggle:hover {
        color: var(--primary);
        background: var(--primary-light);
    }

    .pw-toggle .pw-eye,
    .pw-toggle .pw-eye-off {
        display: none;
        width: 18px;
        height: 18px;
    }

    .pw-toggle .pw-eye {
        display: block;
    }

    .pw-toggle.is-visible .pw-eye {
        display: none;
    }

    .pw-toggle.is-visible .pw-eye-off {
        display: block;
    }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    width: 100%;
}

/* --- TABLOLAR VE FORM TABLO İNPUTLARI (YENİ FATURA DÜZELTME) --- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

    .table th {
        color: #64748b;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-light);
        white-space: nowrap;
    }

    .table td {
        padding: 14px 16px;
        height: 52px;
        border-bottom: 1px solid var(--border-light);
        font-size: 13px;
        color: #475569;
        vertical-align: middle;
        transition: background 0.15s ease;
    }

    .table tbody tr:hover td {
        background: rgba(248, 250, 252, 0.75);
    }

    .table th.money,
    .table td.money {
        text-align: right;
        font-feature-settings: "tnum" 1, "lnum" 1;
        font-variant-numeric: tabular-nums;
        font-weight: 500;
        color: #1e293b;
        white-space: nowrap;
    }

    .table tr:last-child td {
        border-bottom: 0;
    }

/* Tablo İçindeki İnput Alanları */
.table-input {
    width: 100%;
    min-width: 0;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
    background: #fff;
    color: var(--text);
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

    select.table-input {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        padding-right: 36px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 14px 14px;
        cursor: pointer;
    }

    .table-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

    .badge.success {
        background: var(--success-bg);
        color: var(--success);
    }

    .badge.warning {
        background: var(--warning-bg);
        color: var(--warning);
    }

    .badge.danger {
        background: var(--danger-bg);
        color: var(--danger);
    }

    .badge.info {
        background: var(--primary-light);
        color: var(--primary);
    }

    .badge.neutral {
        background: #f1f5f9;
        color: #64748b;
        border: 1px solid #e2e8f0;
    }

    .badge.credit {
        background: #ecfdf5;
        color: #047857;
        border: 1px solid #a7f3d0;
    }

    .badge.debit {
        background: #fff1f2;
        color: #be123c;
        border: 1px solid #fecdd3;
    }

    .badge.balanced {
        background: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
    }

/* --- DASHBOARD CHART --- */
.chart {
    height: 250px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 10px 10px;
    border-top: 1px solid var(--border-light);
}

.bar {
    flex: 1;
    background: linear-gradient(180deg, #93c5fd, #2563eb);
    border-radius: 8px 8px 0 0;
    position: relative;
    min-width: 20px;
    transition: opacity 0.2s;
}

    .bar:hover {
        opacity: 0.85;
    }

    .bar span {
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        color: var(--muted);
        font-weight: 500;
    }

.cashflow-card .card-header {
    margin-bottom: 0;
}

.cashflow-readout {
    margin: 8px 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.cashflow {
    height: 220px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 12px 0 0;
}

.cashflow-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border: 0;
    background: transparent;
    padding: 8px 2px 0;
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
}

    .cashflow-col:hover,
    .cashflow-col:focus-visible,
    .cashflow-col.is-active,
    .cashflow-col.is-current {
        background: var(--primary-light);
    }

    .cashflow-col:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 1px;
    }

.cashflow-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}

.cashflow-bar {
    display: block;
    width: 8px;
    max-width: 46%;
    height: 0;
    border-radius: 4px 4px 0 0;
    transform-origin: bottom;
    animation: cashflowGrow 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--i) * 45ms);
}

    .cashflow-bar.gelir {
        background: linear-gradient(180deg, #60a5fa, var(--primary));
    }

    .cashflow-bar.gider {
        background: #cbd5e1;
    }

.cashflow-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
}

.cashflow-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text);
}

    .cashflow-legend i {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 2px;
        margin-right: 6px;
        vertical-align: -1px;
    }

        .cashflow-legend i.gelir { background: var(--primary); }
        .cashflow-legend i.gider { background: #cbd5e1; }

    .cashflow-legend .muted {
        margin-left: auto;
        font-size: 12px;
    }

@keyframes cashflowGrow {
    from { height: 0; }
    to { height: var(--h); }
}

@media (prefers-reduced-motion: reduce) {
    .cashflow-bar {
        animation: none;
        height: var(--h);
    }

    .splash-icon,
    .splash-word,
    .splash-logo,
    .splash-skeleton,
    .sk-check,
    .auth-brand .brand-logo {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@media (max-width: 1024px) {
    .cashflow {
        overflow-x: auto;
    }

    .cashflow-col {
        min-width: 28px;
    }

    .cashflow-legend .muted {
        margin-left: 0;
        width: 100%;
    }
}

/* --- GİRİŞ VE KAYIT SAYFASI (AUTH) --- */
body.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
    background-size: 160% 160%;
    animation: authBg 14s ease-in-out infinite;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes authBg {
    0%, 100% { background-position: 0% 40%; }
    50% { background-position: 100% 60%; }
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-sizing: border-box;
    animation: authCardIn 0.55s ease-out;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-brand {
    text-align: center;
    margin-bottom: 30px;
}

.auth-brand .brand-logo {
    height: 52px;
    width: auto;
    max-width: 260px;
    margin: 0 auto 16px;
    object-fit: contain;
    display: block;
    animation: splashLogoIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.auth-brand .brand-logo-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    animation: authLogoIn 0.7s ease-out 0.08s both;
}

@keyframes authLogoIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-brand .brand-wordmark {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.2;
    margin-bottom: 8px;
    animation: authFadeUp 0.5s ease-out 0.18s both;
}

.auth-brand .w-cepte { color: #0f172a; }
.auth-brand .w-fatura { color: #2563eb; }

.auth-brand h1 {
    font-size: 24px;
    margin: 0 0 6px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.auth-brand p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
    animation: authFadeUp 0.5s ease-out 0.28s both;
}

.auth-box form,
.auth-box .auth-footer {
    animation: authFadeUp 0.5s ease-out 0.36s both;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-box .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.auth-box .btn-primary {
    width: 100%;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 8px;
    margin-top: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-box .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--muted);
    font-size: 13px;
}

.auth-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.check-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}

    .check-line input {
        width: 16px;
        height: 16px;
        accent-color: var(--primary);
    }

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
}

        .auth-footer a:hover {
            text-decoration: underline;
        }

/* --- DİĞER BİLEŞENLER --- */
.quick-panel {
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.quick-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px;
}

.qa-hero {
    display: flex;
    align-items: center;
    width: 100%;
    height: 64px;
    padding: 14px;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
    transition: background 0.15s ease, transform 0.15s ease;
}

    .qa-hero:hover { background: #1d4ed8; color: #fff; }
    .qa-hero:active { transform: scale(0.99); }

.qa-hero-ic {
    display: grid;
    place-items: center;
    margin-right: 14px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.qa-hero .txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

    .qa-hero .txt strong {
        font-size: 14px;
        font-weight: 600;
        color: #fff;
    }

    .qa-hero .txt small {
        font-size: 12px;
        font-weight: 500;
        color: rgba(219, 234, 254, 0.9);
    }

.qa-arrow {
    flex-shrink: 0;
    color: #bfdbfe;
}

.qa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.qa-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

    .qa-btn:hover {
        background: rgba(248, 250, 252, 0.8);
        border-color: #cbd5e1;
        color: inherit;
    }

    .qa-btn:active { transform: scale(0.98); }

.qa-ic {
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.qa-btn .txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .qa-btn .txt strong {
        font-size: 12px;
        font-weight: 600;
        color: #1e293b;
    }

    .qa-btn .txt small {
        font-size: 11px;
        font-weight: 500;
        color: #64748b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.tone-amber .qa-ic { color: #d97706; background: #fffbeb; }
.tone-amber:hover .qa-ic { background: #fef3c7; }
.tone-blue .qa-ic { color: #2563eb; background: #eff6ff; }
.tone-blue:hover .qa-ic { background: #dbeafe; }
.tone-indigo .qa-ic { color: #4f46e5; background: #eef2ff; }
.tone-indigo:hover .qa-ic { background: #e0e7ff; }
.tone-emerald .qa-ic { color: #059669; background: #ecfdf5; }
.tone-emerald:hover .qa-ic { background: #d1fae5; }

.notice {
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 22px;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.upload {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    color: var(--muted);
    background: var(--bg);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

    .upload input {
        margin-top: 12px;
    }

.progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 6px;
}

    .progress span {
        display: block;
        height: 100%;
        background: var(--primary);
        border-radius: 10px;
        width: 65%;
    }

.muted {
    color: var(--muted);
}

.text-btn {
    border: 0;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
}

.danger {
    color: var(--danger) !important;
}

.filter-row {
    display: flex;
    gap: 0;
    flex-wrap: nowrap;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-card);
}

    .filter-row input, .filter-row select {
        border: 0;
        border-right: 1px solid var(--border);
        background: #fff;
        border-radius: 0;
        padding: 0 14px;
        height: 42px;
        outline: none;
        min-width: 0;
        flex: 1;
    }

    .filter-row select {
        flex: 0 0 180px;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        padding-right: 40px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px 16px;
        cursor: pointer;
    }

    .filter-row select::-ms-expand {
        display: none;
    }

    .filter-row *:last-child {
        border-right: 0;
    }

.input-mic {
    position: relative;
    width: 100%;
}

    .input-mic input {
        padding-right: 44px !important;
        width: 100%;
    }

    .input-mic .mic-btn {
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        border: 0;
        background: transparent;
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .input-mic .mic-btn.mic-listening {
        background: var(--primary-light);
        animation: micPulse 1s ease-in-out infinite;
    }

.mic-listening-hint {
    display: none;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    margin-top: 4px;
}

.input-mic.listening .mic-listening-hint {
    display: block;
}

.hint-banner {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.totals-card {
    margin-top: 20px;
    margin-left: auto;
    width: 280px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-size: 13px;
}

    .totals-card div {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        font-feature-settings: "tnum" 1;
    }

    .totals-card .grand {
        border-top: 1px solid var(--border);
        margin-top: 6px;
        padding-top: 10px;
        font-weight: 700;
        font-size: 15px;
        color: var(--text);
    }

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 28px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
}

    .dropzone.dragover {
        border-color: var(--primary);
        background: var(--primary-light);
    }

.ocr-progress {
    display: none;
    margin-top: 12px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

    .ocr-progress.is-active {
        display: block;
    }

    .ocr-progress span {
        display: block;
        height: 100%;
        width: 0;
        background: var(--primary);
        transition: width 0.4s ease;
    }

    .ocr-progress.is-active span {
        width: 100%;
        animation: ocrPulse 1.2s ease-in-out infinite;
    }

@keyframes ocrPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 280px;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text);
    animation: authFadeUp 0.25s ease-out;
}

    .toast.error { border-left-color: var(--danger); }

.context-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    border-bottom: 0;
    color: #fff;
    padding: 14px 40px;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
    position: sticky;
    top: 72px;
    z-index: 20;
}

.context-banner-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.context-banner-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.context-banner-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    color: #fff;
}

    .context-banner-text strong {
        font-weight: 800;
        font-size: 15px;
    }

    .context-banner button {
        height: 36px;
        padding: 0 14px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.45);
        background: #fff;
        color: #1e3a8a;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    }

        .context-banner button:hover {
            background: #eff6ff;
        }

body.asst-open #sidebar-container,
body.asst-open .main {
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.2s ease;
}

body.asst-open .cf-asst {
    filter: none;
    pointer-events: auto;
    z-index: 60;
}

.cf-asst-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    z-index: 55;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

body.asst-open .cf-asst-backdrop {
    display: block;
}

.modal-overlay.drawer {
    justify-content: flex-end;
    align-items: stretch;
}

    .modal-overlay.drawer .modal-card {
        width: min(460px, 100%);
        max-width: 460px;
        height: 100%;
        max-height: 100%;
        border-radius: 12px 0 0 12px;
        margin: 0;
        overflow-y: auto;
        animation: drawerIn 0.22s ease-out;
    }

@keyframes drawerIn {
    from { transform: translateX(28px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.user-menu {
    position: relative;
    cursor: pointer;
    z-index: 45;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card-hover);
    min-width: 220px;
    padding: 8px;
    z-index: 50;
}

    .user-menu.open {
        z-index: 55;
    }

    .user-menu.open .user-dropdown {
        display: block;
    }

    .user-dropdown a,
    .user-dropdown .theme-menu-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 13px;
        color: var(--text);
        text-align: left;
        border: 0;
        background: none;
        font: inherit;
        cursor: pointer;
        box-sizing: border-box;
    }

    .user-dropdown a:hover,
    .user-dropdown .theme-menu-row:hover { background: var(--bg); }
    .user-dropdown a.danger { color: var(--danger); }

/* --- Bildirim zili --- */
.notif-menu {
    position: relative;
    z-index: 45;
}

.notif-bell {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card-hover);
    width: 320px;
    max-width: calc(100vw - 32px);
    z-index: 50;
    overflow: hidden;
}

    .notif-menu.open .notif-dropdown {
        display: block;
    }

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

    .notif-dropdown-header strong {
        font-size: 13px;
        color: var(--text);
    }

    .notif-dropdown-header .text-btn {
        font-size: 12px;
    }

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-list .notif-empty {
    padding: 18px 14px;
    text-align: center;
    font-size: 13px;
}

.notif-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}

    .notif-item:last-child {
        border-bottom: 0;
    }

    .notif-item:hover {
        background: var(--bg);
    }

    .notif-item.is-unread {
        background: #eff6ff;
    }

    .notif-item.is-unread:hover {
        background: #e0edff;
    }

.notif-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-item-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    visibility: hidden;
}

    .notif-item.is-unread .notif-item-dot {
        visibility: visible;
    }

.notif-item-msg {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.notif-item-time {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--muted);
}

.theme-menu-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.theme-menu-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.theme-menu-sub {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.theme-switch-track {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

.theme-menu-row.is-on .theme-switch-track,
.theme-switch.is-on .theme-switch-track {
    background: var(--primary);
}

.theme-menu-row.is-on .theme-switch-thumb,
.theme-switch.is-on .theme-switch-thumb {
    transform: translateX(16px);
}

.action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    animation: actionIn 0.4s ease both;
}

    .action-card:nth-child(1) { animation-delay: 0.04s; }
    .action-card:nth-child(2) { animation-delay: 0.08s; }
    .action-card:nth-child(3) { animation-delay: 0.12s; }
    .action-card:nth-child(4) { animation-delay: 0.16s; }
    .action-card:nth-child(5) { animation-delay: 0.2s; }

    .action-card:hover {
        border-color: var(--primary);
        background: var(--primary-light);
        color: var(--primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow-card-hover);
    }

    .action-card span.ic {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: var(--primary-light);
        color: var(--primary);
        display: grid;
        place-items: center;
        flex-shrink: 0;
        transition: transform 0.18s ease;
    }

    .action-card:hover span.ic {
        transform: scale(1.06);
    }

    .action-card .txt {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .action-card .txt strong {
        font-size: 13px;
        font-weight: 650;
        color: var(--text);
    }

    .action-card .txt small {
        font-size: 11px;
        font-weight: 500;
        color: var(--muted);
    }

    .action-card:hover .txt strong,
    .action-card:hover .txt small {
        color: inherit;
    }

    .action-card.featured {
        grid-column: 1 / -1;
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
        min-height: 72px;
    }

    .action-card.featured span.ic {
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
    }

    .action-card.featured .txt strong,
    .action-card.featured .txt small {
        color: #fff;
    }

    .action-card.featured:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
        color: #fff;
    }

@keyframes actionIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: center;
    gap: 48px;
    width: 100%;
    max-width: 980px;
    min-height: auto;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 8px 8px 12px;
    color: #fff;
}

    .auth-panel h2 {
        font-size: 32px;
        font-weight: 700;
        margin: 16px 0 12px;
        letter-spacing: -0.5px;
        max-width: 440px;
    }

    .auth-panel p {
        color: rgba(255,255,255,0.85);
        max-width: 420px;
        line-height: 1.6;
        font-size: 15px;
    }

.auth-shell .auth-box {
    margin: 0;
    justify-self: end;
    animation: authCardIn 0.55s ease-out;
}

body.auth-page.auth-split {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 24px;
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 420px;
        padding: 0;
        gap: 0;
        
    }
    .auth-panel { display: none; }
    .auth-shell .auth-box {
        margin: 0 auto;
        justify-self: center;
    }
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 10px -8px rgba(15, 23, 42, 0.12);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 18px;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

    .tab.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
    }

/* --- RESPONSIVE TASARIM --- */
@media(max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

.menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.fab {
    display: none;
}

.empty-state {
    display: none;
    text-align: center;
    padding: 48px 24px;
}

    .empty-state.visible {
        display: block;
    }

    .empty-state .empty-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 16px;
        border-radius: 8px;
        background: var(--primary-light);
        color: var(--primary);
        display: grid;
        place-items: center;
        font-size: 22px;
        font-weight: 700;
    }

    .empty-state p {
        margin: 0 0 16px;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.5;
    }

.table-wrap.is-empty {
    display: none;
}

.repeat-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

    .repeat-toggle input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

.switch {
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 99px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

    .switch::after {
        content: "";
        position: absolute;
        top: 2px;
        left: 2px;
        width: 18px;
        height: 18px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
        transition: transform 0.15s ease;
    }

    .repeat-toggle input:checked + .switch {
        background: var(--primary);
    }

    .repeat-toggle input:checked + .switch::after {
        transform: translateX(18px);
    }

.btn-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    margin-left: 6px;
}

.table-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 160px;
}

    .table-actions .btn-sm {
        margin-left: 0;
    }

.icon-btn-danger {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

    .icon-btn-danger:hover {
        background: #fee2e2;
        border-color: #f87171;
        color: #b91c1c;
    }

.invite-btn {
    font-size: 13px;
}

.input-mic textarea {
    width: 100%;
    padding-right: 44px;
    min-height: 88px;
}

.input-mic .mic-btn.textarea-mic {
    top: 12px;
    transform: none;
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: grid;
    }

    .mobile-title {
        display: block;
        font-weight: 700;
        font-size: 15px;
        color: var(--text);
    }

    .invite-btn {
        display: none;
    }

    .topbar {
        padding: 0 16px;
        gap: 12px;
        justify-content: flex-start;
    }

    .content {
        padding: 24px 16px 80px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 50;
        box-shadow: none;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 40;
    }

    body.nav-open .sidebar-overlay {
        display: block;
    }

    .fab {
        display: grid;
        place-items: center;
        position: fixed;
        right: 20px;
        bottom: 24px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--primary);
        color: #fff;
        font-size: 28px;
        font-weight: 500;
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
        z-index: 25;
        text-decoration: none;
        line-height: 1;
    }

    .context-banner {
        padding: 12px 16px;
        top: 64px;
        flex-wrap: wrap;
    }

    .context-banner-badge {
        font-size: 10px;
    }

    .table {
        min-width: 720px;
    }
}

@media(max-width: 600px) {
    .stats, .three-col, .form-grid {
        grid-template-columns: 1fr;
    }

    .page-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .user-menu > div:not(.avatar):not(.user-dropdown) {
        display: none;
    }

    .auth-box {
        padding: 30px 20px;
    }
}

.mic-btn {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 8px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.mic-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.mic-btn.mic-listening {
    background: var(--primary-light);
    border-color: var(--primary);
    animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #fff;
    display: grid;
    place-items: center;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

    .app-splash.is-done {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

.splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: min(380px, 86vw);
}

.splash-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 72px;
}

    .splash-logo-wrap::before {
        content: "";
        position: absolute;
        left: 8px;
        width: 88px;
        height: 88px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(37, 99, 235, 0.32) 0%, rgba(37, 99, 235, 0) 70%);
        animation: splashGlow 1.4s ease-in-out infinite;
    }

.splash-icon {
    position: relative;
    height: 64px;
    width: auto;
    object-fit: contain;
    animation: splashIconIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.splash-word {
    position: relative;
    height: 28px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    animation: splashWordIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

.splash-logo {
    position: relative;
    height: 56px;
    width: auto;
    max-width: 360px;
    object-fit: contain;
    animation: splashIconIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes splashIconIn {
    0% {
        opacity: 0;
        transform: translateX(-36px) scale(0.55);
        filter: blur(4px);
    }
    68% {
        opacity: 1;
        transform: translateX(0) scale(1.08);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes splashWordIn {
    0% {
        opacity: 0;
        transform: translateX(-14px);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

@keyframes splashLogoIn {
    0% {
        opacity: 0;
        transform: scale(0.42) translateY(16px);
    }
    62% {
        opacity: 1;
        transform: scale(1.06) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes splashGlow {
    0%, 100% { transform: scale(0.92); opacity: 0.55; }
    50% { transform: scale(1.18); opacity: 1; }
}

.splash-skeleton {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    animation: splashLogoIn 0.7s ease 0.28s both;
}

.sk-line {
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 0%, #dbeafe 40%, #e2e8f0 80%);
    background-size: 220% 100%;
    animation: skShimmer 1.15s ease-in-out infinite;
}

    .sk-line:nth-child(1) { width: 88%; }
    .sk-line:nth-child(2) { width: 70%; animation-delay: 0.1s; }
    .sk-line:nth-child(3) { width: 52%; animation-delay: 0.2s; }

.sk-check {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    align-self: flex-end;
    border-radius: 50%;
    background: var(--primary);
    position: relative;
    animation: skCheck 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

    .sk-check::after {
        content: "";
        position: absolute;
        left: 5px;
        top: 3px;
        width: 5px;
        height: 9px;
        border: 2px solid #fff;
        border-top: 0;
        border-left: 0;
        transform: rotate(45deg);
    }

@keyframes skShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes skCheck {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- CEPTE ASISTAN --- */
.cf-asst {
    position: fixed;
    right: 28px;
    bottom: 40px;
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

.cf-asst-fab {
    width: 84px;
    height: 84px;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.4);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

    .cf-asst-fab img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        pointer-events: none;
    }

    .cf-asst-fab:hover {
        box-shadow: 0 18px 40px rgba(37, 99, 235, 0.5);
        transform: translateY(-3px) scale(1.05);
    }

    .cf-asst.is-open .cf-asst-fab {
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
        opacity: 0.9;
        transform: scale(0.96);
    }

.cf-asst-panel {
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: min(520px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .cf-asst-panel[hidden] {
        display: none;
    }

.cf-asst-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

    .cf-asst-head img {
        border-radius: 6px;
        flex-shrink: 0;
    }

    .cf-asst-head div {
        min-width: 0;
        flex: 1;
    }

    .cf-asst-head strong {
        display: block;
        font-size: 14px;
        font-weight: 700;
        color: var(--text);
    }

    .cf-asst-head span {
        display: block;
        font-size: 12px;
        color: var(--muted);
    }

.cf-asst-iconbtn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 8px;
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

    .cf-asst-iconbtn:hover {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .cf-asst-iconbtn.is-muted {
        color: var(--muted);
        background: #fff;
    }

    .cf-asst-iconbtn.mic-listening {
        background: #ecfdf5;
        border-color: #10b981;
        color: #059669;
        box-shadow: 0 0 0 calc(4px + (var(--mic-level, 0.2) * 14px)) rgba(16, 185, 129, calc(0.15 + var(--mic-level, 0.2) * 0.45));
        animation: asstMicGlow 1.1s ease-out infinite;
    }

@keyframes asstMicGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
        transform: scale(1);
    }
    55% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(1);
    }
}

.cf-asst-form.listening [data-asst-input] {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.cf-asst-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg);
}

.cf-asst-msg {
    max-width: 92%;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
}

    .cf-asst-msg.user {
        align-self: flex-end;
        background: var(--primary);
        color: #fff;
    }

    .cf-asst-msg.bot {
        align-self: flex-start;
        background: #fff;
        border: 1px solid var(--border);
        color: var(--text);
    }

    .cf-asst-msg.bot p {
        margin: 0;
    }

    .cf-asst-msg.pending {
        color: var(--muted);
        font-style: italic;
    }

.cf-asst-link {
    display: inline-flex;
    margin-top: 8px;
    height: 32px;
    padding: 0 10px;
    align-items: center;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.cf-asst-confirm {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

    .cf-asst-confirm button {
        height: 32px;
        padding: 0 14px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }

    .cf-asst-confirm-yes {
        border: none;
        background: var(--primary);
        color: #fff;
    }

        .cf-asst-confirm-yes:disabled {
            opacity: 0.6;
            cursor: default;
        }

    .cf-asst-confirm-no {
        border: 1px solid var(--border);
        background: #fff;
        color: var(--text);
    }

        .cf-asst-confirm-no:disabled {
            opacity: 0.6;
            cursor: default;
        }

.cf-asst-confirm-done {
    margin: 8px 0 0 !important;
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}

.cf-asst-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

    .cf-asst-chips button {
        border: 1px solid #bfdbfe;
        background: #fff;
        color: #1e3a8a;
        border-radius: 99px;
        height: 32px;
        padding: 0 12px;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
    }

        .cf-asst-chips button:hover {
            background: var(--primary-light);
            border-color: var(--primary);
        }

.cf-asst-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: #fff;
}

    .cf-asst-form input {
        flex: 1;
        min-width: 0;
        height: 40px;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 0 12px;
        background: #fff;
    }

        .cf-asst-form input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
        }

.cf-asst-send {
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

    .cf-asst-send:hover {
        background: var(--primary-dark);
    }

@media (max-width: 1024px) {
    body.has-fab .cf-asst {
        bottom: 100px;
    }

    body.has-fab .cf-asst-panel {
        max-height: min(520px, calc(100vh - 190px));
    }
}

@media (max-width: 480px) {
    .cf-asst {
        right: 16px;
        left: 16px;
        align-items: stretch;
    }

    .cf-asst-fab {
        align-self: flex-end;
    }

    .cf-asst-panel {
        width: 100%;
        max-width: none;
        height: min(68vh, 520px);
    }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] {
    color-scheme: dark;
    --primary: #3b82f6;
    --primary-dark: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --border-light: #1e293b;
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-panel: 4px 0 18px rgba(0, 0, 0, 0.28);
    --shadow-bar: 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-card-hover: 0 14px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .nav a,
[data-theme="dark"] .logout { color: #cbd5e1; }
[data-theme="dark"] .nav a:hover,
[data-theme="dark"] .logout:hover { background: var(--border-light); color: var(--text); }
[data-theme="dark"] .nav a.active { background: var(--primary-light); color: var(--primary-dark); }

[data-theme="dark"] .nav .tone-blue .nav-ic { color: #93c5fd; background: rgba(37, 99, 235, 0.22); }
[data-theme="dark"] .nav .tone-sky .nav-ic { color: #7dd3fc; background: rgba(2, 132, 199, 0.22); }
[data-theme="dark"] .nav .tone-amber .nav-ic { color: #fcd34d; background: rgba(217, 119, 6, 0.22); }
[data-theme="dark"] .nav .tone-indigo .nav-ic { color: #a5b4fc; background: rgba(79, 70, 229, 0.22); }
[data-theme="dark"] .nav .tone-emerald .nav-ic { color: #6ee7b7; background: rgba(5, 150, 105, 0.22); }
[data-theme="dark"] .nav .tone-slate .nav-ic { color: #cbd5e1; background: rgba(148, 163, 184, 0.18); }

[data-theme="dark"] .table th { color: var(--muted); }
[data-theme="dark"] .table td { color: #cbd5e1; }
[data-theme="dark"] .table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .table th.money,
[data-theme="dark"] .table td.money { color: var(--text); }

[data-theme="dark"] .form-group label,
[data-theme="dark"] .check-line { color: #cbd5e1; }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .table-input,
[data-theme="dark"] .filter-row,
[data-theme="dark"] .filter-row input,
[data-theme="dark"] .filter-row select,
[data-theme="dark"] .cf-asst-form input,
[data-theme="dark"] .input-password input {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .badge.neutral,
[data-theme="dark"] .badge.balanced { background: var(--border-light); color: var(--muted); border-color: var(--border); }
[data-theme="dark"] .badge.credit { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); }
[data-theme="dark"] .badge.debit { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); }

[data-theme="dark"] .qa-btn,
[data-theme="dark"] .toast,
[data-theme="dark"] .user-dropdown,
[data-theme="dark"] .action-card,
[data-theme="dark"] .app-splash,
[data-theme="dark"] .cf-asst-panel,
[data-theme="dark"] .cf-asst-head,
[data-theme="dark"] .cf-asst-msg.bot,
[data-theme="dark"] .cf-asst-chips button,
[data-theme="dark"] .cf-asst-form {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .user-dropdown a:hover,
[data-theme="dark"] .user-dropdown .theme-menu-row:hover { background: var(--border-light); }
[data-theme="dark"] .qa-btn .txt small { color: var(--muted); }

[data-theme="dark"] .user-menu:hover,
[data-theme="dark"] .user-menu.open {
    background: #334155;
    border-color: #475569;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .user-menu strong {
    color: #f8fafc;
}

[data-theme="dark"] .user-menu small {
    color: #cbd5e1;
}

[data-theme="dark"] .avatar {
    border-color: #1e293b;
    box-shadow:
        0 0 0 2px #3b82f6,
        0 6px 16px rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .user-menu:hover .avatar,
[data-theme="dark"] .user-menu.open .avatar {
    box-shadow:
        0 0 0 2px #60a5fa,
        0 8px 18px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .context-banner { background: var(--primary-light); border-bottom-color: var(--border); color: #93c5fd; }
[data-theme="dark"] .context-banner button { background: var(--surface); color: #93c5fd; border-color: var(--border); }
[data-theme="dark"] .hint-banner { color: #93c5fd; border-color: var(--border); }
[data-theme="dark"] .repeat-toggle { color: #93c5fd; border-color: var(--border); }

[data-theme="dark"] .mic-btn,
[data-theme="dark"] .cf-asst-iconbtn,
[data-theme="dark"] .icon-btn,
[data-theme="dark"] .pw-toggle { background: var(--border-light); color: var(--muted); }

[data-theme="dark"] .switch { background: #475569; }

[data-theme="dark"] .dropzone,
[data-theme="dark"] .upload,
[data-theme="dark"] .totals-card { background: var(--border-light); border-color: var(--border); }

[data-theme="dark"] input[readonly] {
    background: var(--border-light) !important;
    color: var(--muted) !important;
}

[data-theme="dark"] .tab { color: var(--muted); }
[data-theme="dark"] .tab.active { color: var(--primary); }

[data-theme="dark"] .notif-dropdown,
[data-theme="dark"] .notif-item {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .notif-item.is-unread {
    background: var(--primary-light);
}

[data-theme="dark"] .notif-badge {
    box-shadow: 0 0 0 2px var(--surface);
}

.account-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
}

.account-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
}

.account-hero-meta h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.account-hero-meta p {
    margin: 0 0 8px;
}

@media (max-width: 640px) {
    .account-hero {
        flex-direction: column;
        align-items: flex-start;
    }
}

