:root {
    color-scheme: light;
    font-family: Inter, Segoe UI, Arial, sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #eef4ff 0%, #f6f8fb 22%, #f8fafc 100%);
    color: #1f2937;
}

.page-shell {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
}

.auth-content {
    width: min(100%, 34rem);
}

.topbar {
    background: linear-gradient(135deg, #111827, #1d4ed8);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.topbar-auth {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}

.topbar-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topbar-user-name {
    font-weight: 700;
}

.topbar-user-menu {
    position: relative;
}

.topbar-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.3rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.topbar-user-trigger::after {
    content: "▾";
    font-size: 0.85rem;
}

.topbar-user-trigger::-webkit-details-marker {
    display: none;
}

.topbar-user-menu[open] .topbar-user-trigger,
.topbar-user-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 14rem;
    padding: 0.6rem;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: white;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
    z-index: 20;
}

.topbar-user-dropdown-title {
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.45rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.topbar-logout-form {
    margin: 0;
}

.topbar-menu-button {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #1f2937;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.topbar-menu-button:hover {
    background: #eff6ff;
}

.topbar-menu-button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.topbar-menu-button:disabled:hover {
    background: transparent;
}

.topbar-menu-button-danger {
    color: #b91c1c;
}

.topbar-menu-button-danger:hover {
    background: #fff1f2;
}

.topbar-link {
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    color: white;
    text-decoration: none;
    font-weight: 700;
}

.topbar-link.active,
.topbar-link:hover {
    background: rgba(255, 255, 255, 0.14);
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.muted {
    color: #6b7280;
}

h1,
h2 {
    margin-top: 0;
}

.hero {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    align-items: center;
    padding: 1.5rem;
}

.hero-side {
    display: grid;
    gap: 1rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.75rem;
    width: fit-content;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.18);
}

.hero-text {
    max-width: 58rem;
    font-size: 1.02rem;
    line-height: 1.7;
}

.hero-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 600;
}

.upload-box {
    padding: 1.25rem;
    border: 1px dashed #93c5fd;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff, #eef4ff);
}

.compact-box {
    align-self: stretch;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.upload-text {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.saved-state {
    margin-top: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: #1e3a8a;
}

.upload-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.small-text {
    font-size: 0.85rem;
}

.upload-input {
    width: 100%;
}

.upload-input::file-selector-button {
    margin-right: 0.9rem;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 10px;
    background: #1d4ed8;
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.loading-state {
    margin-top: 1rem;
    color: #1d4ed8;
    font-weight: 600;
}

.secondary-button,
.section-link,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button:hover,
.section-link:hover {
    background: #f8fafc;
}

.current-button {
    border-color: #1d4ed8;
    background: #dbeafe;
    color: #1d4ed8;
    cursor: default;
}

.danger-button {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.danger-button:hover {
    background: #ffe4e6;
}

.section-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: sticky;
    top: 1rem;
    z-index: 5;
    margin: 1rem 0;
    padding: 0.85rem;
}

.summary-section,
.panel[id] {
    scroll-margin-top: 6.5rem;
}

.view-switcher {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 0.85rem;
}

.view-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: white;
    color: #1f2937;
    font-weight: 700;
    cursor: pointer;
}

.view-button.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
}

.view-count {
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.85rem;
}

.accent-card {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.balance-card {
    position: relative;
    overflow: hidden;
    border-color: #93c5fd;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 45%, #ffffff 100%);
    box-shadow: 0 16px 34px rgba(29, 78, 216, 0.12);
}

.balance-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(180deg, #2563eb, #0f766e);
}

.summary-button {
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.summary-button:hover {
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.breakdown-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.suggestion-box {
    display: grid;
    gap: 0.2rem;
}

.small-button {
    min-height: 2.2rem;
    padding: 0.45rem 0.75rem;
}

.highlight-row td {
    background: #fff7ed;
}

.stat-card {
    min-height: 8rem;
}

.compact-header {
    margin-bottom: 0.5rem;
}

.no-top-margin {
    margin-top: 0;
}

.compact-actions {
    margin-top: 1rem;
}

.quick-filter-button {
    justify-content: flex-start;
}

.collapsible-panel {
    margin-bottom: 1rem;
}

.collapsible-panel summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
}

.collapsible-panel summary::-webkit-details-marker {
    display: none;
}

.collapsible-panel summary::after {
    content: "Visa";
    float: right;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.collapsible-panel[open] summary::after {
    content: "Dölj";
}

.details-content {
    margin-top: 1rem;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-meta {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 700;
}

.file-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.file-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.file-name {
    font-weight: 700;
    word-break: break-word;
}

.bulk-panel {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px dashed #bfdbfe;
    border-radius: 14px;
    background: #f8fbff;
}

.bulk-title {
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #1e3a8a;
}

.bulk-actions {
    display: flex;
    align-items: end;
}

.cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 1.25rem 0;
}

.card,
.panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.label {
    font-size: 0.9rem;
    color: #6b7280;
}

.value {
    margin-top: 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.positive {
    color: #0f766e;
}

.negative {
    color: #b91c1c;
}

.warning {
    border-left: 4px solid #d97706;
    background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.empty-state {
    text-align: center;
    padding: 2rem 1.5rem;
}

.auth-panel {
    max-width: 32rem;
    margin: 1.5rem auto 0;
}

.auth-panel-centered {
    margin: 0 auto;
}

.auth-warning {
    margin-top: 0;
    margin-bottom: 1rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-submit {
    min-width: 10rem;
}

.section-intro {
    margin-bottom: 0.25rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.filter-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.compact-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-wrap {
    overflow-x: auto;
    margin-top: 0.75rem;
}

.chart-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.bar-chart {
    display: grid;
    gap: 1rem;
}

.compact-chart {
    max-width: 56rem;
}

.bar-row {
    display: grid;
    gap: 0.45rem;
}

.bar-label-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.bar-track {
    height: 14px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
}

.pie-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.pie-chart {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: inset 0 0 0 34px white;
}

.pie-legend {
    display: grid;
    gap: 0.65rem;
}

.legend-row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.table-wrap-large {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 900px;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.7rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.text-input,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
}

.category-picker {
    position: relative;
    min-width: 12rem;
}

.category-input-row {
    display: flex;
    gap: 0.35rem;
    align-items: stretch;
}

.category-input-row .text-input {
    flex: 1 1 auto;
}

.category-toggle {
    flex: 0 0 auto;
    width: 2.35rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
}

.category-toggle:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.category-suggestions {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    display: grid;
    gap: 0.25rem;
    max-height: 15rem;
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.14);
    z-index: 30;
}

.category-suggestion,
.category-empty {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
}

.category-suggestion {
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.category-suggestion:hover {
    background: #eff6ff;
}

.category-empty {
    color: #64748b;
    font-size: 0.9rem;
}

code {
    background: #eef2ff;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .pie-layout {
        grid-template-columns: 1fr;
    }

    .pie-chart {
        width: 180px;
        height: 180px;
        box-shadow: inset 0 0 0 28px white;
    }

    .file-chip,
    .section-header {
        align-items: stretch;
    }

    .section-nav {
        top: 0.5rem;
    }

    .content {
        padding: 1.25rem 1rem 2rem;
    }
}
