html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f4f7fb;
    color: #1f2937;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

.tb-shell {
    min-height: 100vh;
    background: #f4f7fb;
}

.tb-header {
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tb-sidebar {
    background: #fff;
    border-right: 1px solid #e5e7eb;
}

.tb-body {
    background: #f4f7fb;
}

.tb-content {
    padding: 1.25rem;
}

.tb-header .rz-text,
.tb-header .rz-icon {
    color: #ffffff !important;
}

.tb-brand-subtitle {
    color: #ffffff !important;
    opacity: 1;
}

.tb-header-title,
.tb-header-date {
    color: #ffffff !important;
}

.tb-active-company-code {
    color: #ff4d4f !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em;
}

.tb-page-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tb-stat-card {
    height: 100%;
}

.tb-positive {
    color: #15803d;
    font-weight: 600;
}

.tb-negative {
    color: #b91c1c;
    font-weight: 600;
}

.tb-grid-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rz-panel-menu {
    border: none !important;
    background: transparent !important;
}

.rz-panel-menu .rz-navigation-item-link {
    border-radius: 10px;
    margin: 0.25rem 0;
}

.rz-panel-menu .rz-navigation-item-link:hover,
.rz-panel-menu .rz-navigation-item-link.rz-state-active {
    background: #eff6ff !important;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3J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ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ---------- Report tables (ICE Hakediş etc.) ---------- */
.tb-link-button {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.tb-report-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 2px solid #1f2937;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.tb-report-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.tb-report-meta {
    text-align: right;
    font-size: 0.9rem;
}

.tb-report-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.4rem;
}

.tb-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tb-report-table th,
.tb-report-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.tb-report-table thead th {
    background: #f3f4f6;
    border-bottom: 1px solid #9ca3af;
}

.tb-report-table tfoot td {
    font-weight: 700;
    border-top: 2px solid #1f2937;
}

.tb-report-table .num {
    text-align: right;
    white-space: nowrap;
}

.tb-report-table .nowrap {
    white-space: nowrap;
}

.tb-report-group {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.25rem 0 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #eef2ff;
    border-left: 4px solid #1e3a8a;
}

.tb-report-empty {
    font-style: italic;
    color: #6b7280;
}

.tb-report-net {
    margin-top: 1rem;
    background: #dbeafe;
    font-weight: 700;
}

/* ---------- A4 print ---------- */
@media print {
    @page {
        size: A4 portrait;
        margin: 5mm;
    }

    html, body, .tb-shell, .tb-body {
        background: #fff !important;
    }

    .tb-header, .tb-sidebar, .tb-no-print, .rz-header, .rz-sidebar,
    #blazor-error-ui, #components-reconnect-modal, .rz-notification {
        display: none !important;
    }

    .rz-layout, .rz-body, .tb-body {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
    }

    .tb-content {
        padding: 0 !important;
    }

    .tb-print-area .rz-card {
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
    }

    .tb-report-table {
        font-size: 8.5pt;
    }

    .tb-report-table thead {
        display: table-header-group;
    }

    .tb-report-table tfoot {
        display: table-row-group;
    }

    .tb-report-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .tb-report-group {
        break-after: avoid;
        page-break-after: avoid;
    }

    .tb-report-table thead th, .tb-report-group, .tb-report-net {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---------- Login ---------- */
.tb-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
}

.tb-login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 14px;
    padding: 2rem 1.75rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.tb-login-card form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tb-login-brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

.tb-login-subtitle {
    color: #4b5563;
    margin-bottom: 1.25rem;
}

.tb-login-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.tb-login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
}

.tb-login-input:focus {
    outline: 2px solid #2563eb;
    border-color: #2563eb;
}

.tb-login-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.tb-login-turnstile {
    margin-top: 1rem;
}

.tb-login-button {
    margin-top: 1.25rem;
    padding: 0.7rem;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.tb-login-button:hover {
    background: #1d4ed8;
}

.tb-login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.tb-user-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tb-user-box form {
    margin: 0;
}

.tb-logout-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
}

.tb-company-link {
    text-decoration: none;
}

/* ---------- Report editor ---------- */
.tb-code {
    width: 100%;
    box-sizing: border-box;
    font-family: Consolas, "Cascadia Code", "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.4;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.5rem;
    background: #0f172a;
    color: #e2e8f0;
    tab-size: 2;
    resize: vertical;
}

.tb-code-sql {
    min-height: 220px;
}

.tb-template-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    min-height: 560px;
}

.tb-template-code textarea {
    height: 100%;
    min-height: 560px;
}

.tb-template-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tb-preview-frame {
    flex: 1;
    width: 100%;
    min-height: 560px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}

.tb-preview-body {
    background: #fff;
    padding: 12px;
    margin: 0;
}

@media (max-width: 1100px) {
    .tb-template-editor {
        grid-template-columns: 1fr;
    }
}

.tb-query-result {
    max-height: 320px;
    overflow: auto;
    margin-top: 0.5rem;
}

.tb-ref-list {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
}

.tb-ref-list code {
    background: #f1f5f9;
    padding: 0 0.2rem;
    border-radius: 3px;
}

.tb-visual-preview {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 0.5rem;
}

.tb-template-error {
    color: #b91c1c;
    white-space: pre-wrap;
}

.tb-report-output {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
}

/* ---------- Dashboard ---------- */
.tb-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 260px;
    gap: 1rem;
}

.tb-dashboard-tile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.tb-dashboard-tile-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tb-dashboard-tile-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-dashboard-tile-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.tb-dashboard-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
}

.tb-kpi {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-kpi-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1e3a8a;
}

.tb-visual-table .tb-report-table {
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .tb-dashboard-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .tb-dashboard-tile {
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 260px;
    }
}

@media print {
    .tb-report-output {
        padding: 0 !important;
        border-radius: 0 !important;
    }
}

/* ---------- Veri Görüntüleyici ---------- */
.tb-table-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    vertical-align: middle;
    font-family: Consolas, "Courier New", monospace;
}

.tb-kv {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tb-kv th {
    text-align: left;
    font-weight: 600;
    color: #475569;
    padding: 0.25rem 0.5rem;
    width: 45%;
    border-bottom: 1px solid #f1f5f9;
}

.tb-kv td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.tb-kv td.num {
    text-align: right;
}

.tb-row-muted td {
    color: #94a3b8;
    text-decoration: line-through;
}

.tb-visual-html {
    height: 100%;
    overflow: auto;
}
