:root {
    --ink: #12345b;
    --accent: #1478ef;
    --muted: #6d7d83;
}

body {
    background: #f3f8fe;
    color: var(--ink);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}

/* Sol menü */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 34px 25px;
    background: linear-gradient(180deg, #103357, #0c2949);
    color: #d2e2e3;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    display: block;
    width: 100%;
    color: white;
    text-decoration: none;
    font-size: 32px;
    font-weight: 750;
    letter-spacing: -1px;
    flex-shrink: 0;
}

    .brand span {
        color: #60b6ff;
    }

    .brand small {
        display: block;
        margin-top: 8px;
        color: #a1b6b9;
        font-size: 9px;
        letter-spacing: 2px;
    }

/* Logo oranı korunur */
.sidebar .brand .company-logo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    max-height: 90px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
}

.nav-label {
    margin: 40px 0 12px;
    color: #8ca9ad;
    font-size: 10px;
    letter-spacing: 1.6px;
}

.sidebar nav a {
    display: block;
    margin: 4px 0;
    padding: 12px 10px;
    border-radius: 8px;
    color: #d2e2e3;
    text-decoration: none;
    font-size: 14px;
}

    .sidebar nav a:hover {
        background: linear-gradient(90deg, #135ca2, #164a7c);
        color: white;
    }

.sidebar-foot {
    margin-top: auto;
    padding-top: 30px;
    font-size: 12px;
}

    .sidebar-foot p {
        margin-top: 10px;
        color: #8ca9ad;
    }

.mobile-menu-toggle {
    display: none;
}

/* Ana düzen */
.workspace {
    margin-left: 250px;
}

.workspace,
.content,
.active-company {
    min-width: 0;
}

.topbar {
    min-height: 88px;
    padding: 20px 40px;
    background: white;
    border-bottom: 1px solid #e5eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.active-company strong,
.account-actions > span {
    overflow-wrap: anywhere;
}

.content {
    max-width: 1450px;
    margin: auto;
    padding: 38px 40px;
}

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}

h1 {
    font-size: 29px;
    font-weight: 700;
    letter-spacing: -.7px;
}

h2 {
    font-size: 18px;
    font-weight: 650;
}

.subtle {
    color: var(--muted);
    font-size: 14px;
}

.panel,
.metric {
    background: white;
    border: 1px solid #e1ebf8;
    border-radius: 14px;
    box-shadow: 0 3px 14px #143e6f06;
}

.panel {
    padding: 26px;
}

.metric {
    padding: 24px;
}

    .metric strong {
        display: block;
        margin-top: 13px;
        font-size: 31px;
    }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    --bs-btn-active-bg: #085ec3;
    --bs-btn-active-border-color: #085ec3;
}

    .btn-primary:hover {
        background: #0964d2;
        border-color: #0964d2;
    }

.table {
    vertical-align: middle;
}

    .table thead th {
        padding: 14px;
        border-bottom: 0;
        background: #f2f7fe;
        color: #35567d;
        font-size: 11px;
        letter-spacing: .6px;
    }

    .table td {
        padding: 16px 14px;
        font-size: 14px;
    }

.pill {
    padding: 6px 11px;
    border-radius: 40px;
    background: #fff3d8;
    color: #896118;
    font-size: 11px;
    font-weight: 650;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
}

.form-control,
.form-select {
    padding: 11px 13px;
    border-color: #dce4e7;
    border-radius: 8px;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #80b7fc;
        box-shadow: 0 0 0 .2rem #1478ef20;
    }

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
    background: radial-gradient(ellipse at top left, #dcecff, transparent 65%), #f3f8fe;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 38px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 70px #14393313;
}

.validation-summary-errors,
.field-validation-error {
    color: #b42318;
    font-size: 13px;
}

.empty {
    padding: 50px;
    text-align: center;
    color: #71818a;
}

.hero {
    padding: 28px;
    background: #edf5ff;
    border: 1px solid #d5e6fb;
    border-radius: 14px;
}

.money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Onay penceresi */
.app-confirm {
    width: min(520px, calc(100% - 32px));
    max-height: 90dvh;
    padding: 0;
    overflow: auto;
    border: 1px solid #e1e9e7;
    border-radius: 22px;
    background: #fff;
    color: #19313c;
    box-shadow: 0 28px 90px #102d3540;
}

    .app-confirm::backdrop {
        background: #122e3b80;
        backdrop-filter: blur(4px);
    }

.confirm-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #edf1f3;
}

.confirm-brand {
    color: #1478ef;
    font-size: 18px;
    font-weight: 800;
}

    .confirm-brand span {
        margin-left: 12px;
        color: #7b8e95;
        font-size: 10px;
        letter-spacing: 1.5px;
    }

.confirm-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f6;
    color: #536871;
    font-size: 24px;
    line-height: 1;
}

.confirm-body {
    padding: 26px 28px 12px;
}

.confirm-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #eaf3ff;
    color: #1478ef;
    font-size: 28px;
}

.confirm-body h2 {
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 750;
}

.confirm-body > p {
    color: #647780;
    line-height: 1.7;
}

.confirm-summary {
    margin: 20px 0;
    padding: 8px 16px;
    border: 1px solid #e7eef0;
    border-radius: 12px;
    background: #f5f8f9;
}

    .confirm-summary[hidden] {
        display: none;
    }

    .confirm-summary div {
        display: flex;
        justify-content: space-between;
        gap: 18px;
        padding: 10px 0;
    }

        .confirm-summary div + div {
            border-top: 1px solid #e4ebee;
        }

    .confirm-summary dt {
        color: #6c7e86;
        font-size: 13px;
        font-weight: 400;
    }

    .confirm-summary dd {
        max-width: 65%;
        margin: 0;
        text-align: right;
        overflow-wrap: anywhere;
        font-size: 13px;
        font-weight: 700;
    }

.confirm-hint {
    font-size: 12px;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px 24px;
}

    .confirm-actions .btn {
        padding: 11px 20px;
        border-radius: 10px;
        font-weight: 600;
    }

.app-confirm button:focus-visible {
    outline: 3px solid #83b8fa;
    outline-offset: 3px;
}

/* Belge toplamları */
.expense-totals {
    width: min(100%, 400px);
    margin: 24px 0 0 auto;
    padding: 18px 22px;
    border: 1px solid #dce8f8;
    border-radius: 14px;
    background: #f4f8fe;
}

    .expense-totals > div {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 18px;
        padding: 9px 0;
    }

    .expense-totals span {
        color: #647780;
    }

    .expense-totals strong {
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .expense-totals .expense-grand-total {
        margin-top: 8px;
        padding-top: 16px;
        border-top: 1px solid #d8e5f5;
    }

.expense-grand-total span {
    color: #19313c;
    font-weight: 700;
}

.expense-grand-total strong {
    color: #1478ef;
    font-size: 25px;
}

.expense-totals small {
    display: block;
    margin-top: 10px;
    color: #73858c;
    font-size: 11px;
}

.logo-preview {
    max-width: 280px;
    max-height: 130px;
    padding: 15px;
    border-radius: 12px;
    background: #103357;
    object-fit: contain;
}

.logo-upload-panel {
    max-width: 680px;
}

/* Telefon ve tablet */
@media (max-width: 900px) {
    .sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
    }

        .sidebar .brand {
            order: 0;
            width: 180px;
            max-width: calc(100% - 155px);
            min-width: 0;
            font-size: 25px;
        }

            .sidebar .brand .company-logo {
                width: 100%;
                height: auto;
                max-width: 180px;
                max-height: 48px;
            }

        .sidebar.menu-ready .mobile-menu-toggle {
            order: 1;
            display: block;
            min-height: 44px;
            padding: 10px 12px;
            border: 1px solid #7ca0c5;
            border-radius: 8px;
            background: transparent;
            color: white;
            font-size: 14px;
        }

        .sidebar nav {
            order: 2;
            flex-basis: 100%;
            width: 100%;
            display: block;
        }

        .sidebar.menu-ready:not(.menu-open) nav {
            display: none;
        }

        .sidebar nav a {
            min-height: 44px;
            padding: 12px;
            font-size: 15px;
        }

    .nav-label,
    .sidebar-foot,
    .brand small {
        display: none;
    }

    .sidebar.menu-open nav .nav-label {
        display: block;
        margin: 12px 0 4px;
    }

    .workspace {
        margin: 0;
    }

    .topbar {
        min-height: 0;
        padding: 15px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .active-company {
        flex: 1 1 180px;
    }

    .account-actions {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .content {
        padding: 24px 16px;
    }

    .page-head {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }

        .page-head > div {
            min-width: 0;
            overflow-wrap: anywhere;
        }

    h1 {
        font-size: 24px;
    }

    .panel {
        padding: 18px;
    }

    .content .d-flex {
        flex-wrap: wrap;
    }

        .content .d-flex > .form-control {
            min-width: 0;
        }

    .content .btn {
        min-height: 44px;
        white-space: normal;
    }

    .table-responsive {
        max-width: 100%;
    }

    .table th {
        white-space: nowrap;
    }

    #lines .form-control[type="number"] {
        min-width: 110px;
    }

    .panel p,
    .panel h2,
    .subtle,
    .alert {
        overflow-wrap: anywhere;
    }

    .form-control,
    .form-select {
        font-size: 16px;
    }

    .logo-preview {
        max-width: 100%;
    }
}

/* Küçük telefon */
@media (max-width: 480px) {
    .content {
        padding: 20px 12px;
    }

    .panel {
        padding: 16px;
    }

    .auth-shell {
        padding: 16px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .expense-totals {
        padding: 16px;
    }

        .expense-totals > div {
            gap: 10px;
            flex-wrap: wrap;
        }

    .expense-grand-total strong {
        font-size: 23px;
    }

    .confirm-top {
        padding: 16px;
    }

    .confirm-body {
        padding: 22px 20px 8px;
    }

    .confirm-actions {
        padding: 16px 20px 22px;
    }

        .confirm-actions .btn {
            flex: 1;
            padding: 10px;
        }

    .confirm-brand span {
        display: none;
    }
}

/* Yazdırma */
@media print {
    .sidebar,
    .topbar,
    .no-print,
    .mobile-menu-toggle,
    .app-confirm {
        display: none !important;
    }

    .workspace {
        margin: 0;
    }

    .content {
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
    }

    body {
        background: white;
    }
}
