:root {
    --bs-primary: #176b87;
    --bs-primary-rgb: 23, 107, 135;
    --bs-success: #198754;
    --bs-success-rgb: 25, 135, 84;
    --app-ink: #17212b;
    --app-muted: #66737d;
    --app-border: #d8dee3;
    --app-surface: rgba(255, 255, 255, 0.94);
}

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    color: var(--app-ink);
    background-color: #f4f6f8;
    font-family: var(--bs-font-sans-serif);
    letter-spacing: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--app-logo-url, none);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: var(--app-logo-size, min(66vw, 880px) auto);
    opacity: 0.12;
    filter: saturate(1.05) contrast(1.04);
}

body > * {
    position: relative;
    z-index: 1;
}

.app-user-bar {
    position: sticky;
    top: 0;
    z-index: 1080;
    min-height: 54px;
    padding: 0;
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 2px 8px rgba(22, 34, 44, 0.07);
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px);
}

.app-user-bar-inner {
    min-height: 54px;
    padding: 7px clamp(12px, 2.5vw, 30px);
    gap: 14px;
}

.app-brand {
    flex: 0 0 auto;
    color: var(--app-ink);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.app-brand:hover,
.app-brand:focus {
    color: var(--bs-primary);
}

.app-user-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
    text-align: right;
}

.app-user-name {
    color: var(--app-ink);
}

.app-user-code,
.app-user-city,
.app-user-role {
    color: var(--app-muted);
}

.app-user-separator {
    color: #a5afb7;
}

.app-user-logout {
    flex: 0 0 auto;
    border-radius: 6px;
    font-weight: 600;
}

body > .container,
body > .container-fluid,
body > main {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--app-ink);
    letter-spacing: 0;
}

h3 {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 700;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
}

.page-header h1,
.page-header h2,
.page-header h3 {
    margin: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card {
    border: 1px solid rgba(207, 214, 220, 0.85) !important;
    border-radius: 8px !important;
    background-color: var(--app-surface);
    box-shadow: 0 4px 14px rgba(22, 34, 44, 0.07) !important;
    backdrop-filter: blur(2px);
}

.card-header {
    padding: 0.85rem 1rem;
    color: var(--app-ink);
    background: rgba(248, 249, 250, 0.92);
    border-bottom-color: var(--app-border);
    font-weight: 700;
}

.card-body {
    padding: 1rem;
}

.btn {
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0;
}

.btn-info {
    color: #083344;
}

.form-label {
    margin-bottom: 0.35rem;
    color: #34424d;
    font-size: 0.88rem;
    font-weight: 600;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 38px;
    border-color: #cbd3d9;
    border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--bs-primary-rgb), 0.7);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.13);
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
    background-color: #eef1f3;
}

.form-row-note {
    width: 100%;
    margin-top: 0.25rem;
    color: var(--app-muted);
    font-size: 0.875em;
    line-height: 1.35;
}

textarea.form-control {
    min-height: 92px;
}

.table-responsive {
    border: 1px solid var(--app-border);
    border-radius: 7px;
}

.table {
    min-width: 720px;
    margin-bottom: 0;
    font-size: 0.875rem;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: 0.65rem 0.7rem;
    border-color: var(--app-border);
}

.table > tbody > tr:not(.table-secondary):not(.table-light):not(.table-dark) > *,
.table > tfoot > tr:not(.table-secondary):not(.table-light):not(.table-dark) > * {
    --bs-table-bg: rgba(255, 255, 255, 0.9);
}

.table > thead.table-dark > tr > * {
    --bs-table-bg: #26313a;
    --bs-table-color: #fff;
    color: #fff;
    background-color: #26313a;
    border-color: #43505a;
    white-space: nowrap;
}

.alert {
    border-radius: 7px;
}

.badge {
    border-radius: 5px;
}

.app-form-shell {
    max-width: 920px;
    margin-inline: auto;
}

.app-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 0.5rem;
}

.stat-card {
    height: 100%;
}

.stat-card .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.stat-card-label {
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-card-value {
    margin-top: 4px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 7px;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
    font-size: 1.15rem;
    font-weight: 700;
}

.dashboard-section-title {
    margin: 1.6rem 0 0.75rem;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 66px;
    padding: 0.85rem 1rem;
    color: var(--app-ink);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--app-border);
    border-radius: 7px;
    text-decoration: none;
    font-weight: 650;
    box-shadow: 0 3px 10px rgba(22, 34, 44, 0.05);
}

.dashboard-action:hover,
.dashboard-action:focus {
    color: var(--bs-primary);
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    background: #fff;
}

.dashboard-action-mark {
    color: var(--app-muted);
    font-size: 1.15rem;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(100%, 420px);
}

.login-logo {
    display: block;
    width: min(230px, 75%);
    max-height: 100px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.kullanici-filtre-alani {
    position: relative;
}

.kullanici-filtre-sonuclari {
    position: absolute;
    z-index: 1090;
    top: 100%;
    right: 0;
    left: 0;
    max-height: 310px;
    overflow-y: auto;
    margin-top: 3px;
    box-shadow: 0 6px 18px rgba(20, 31, 41, 0.16);
}

.kullanici-filtre-sonuclari .list-group-item {
    padding: 8px 10px;
    font-size: 13px;
    text-align: left;
}

.imza-pad-canvas {
    display: block;
    width: 100%;
    height: 210px;
    background: #fff;
    border: 1px solid #aeb8c1;
    border-radius: 6px;
    cursor: crosshair;
    touch-action: none;
}

.imza-pad-canvas.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.imza-gorseli {
    display: block;
    width: 100%;
    max-width: 480px;
    max-height: 220px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--app-border);
}

.rapor-baslik {
    display: flex;
    align-items: center;
    gap: 18px;
}

.rapor-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 72px;
    flex: 0 0 auto;
}

.rapor-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 767.98px) {
    body > .container,
    body > .container-fluid,
    body > main {
        padding-top: 1rem;
        padding-right: 12px !important;
        padding-left: 12px !important;
    }

    body::before {
        background-size: var(--app-logo-mobile-size, 94vw auto);
        opacity: 0.1;
    }

    .app-user-bar {
        position: relative;
    }

    .app-user-bar-inner {
        align-items: flex-start;
        min-height: auto;
        padding: 8px 10px;
        gap: 8px;
    }

    .app-brand {
        display: none;
    }

    .app-user-info {
        flex: 1 1 220px;
        justify-content: flex-start;
        font-size: 11px;
        text-align: left;
    }

    .app-user-separator {
        display: none;
    }

    .app-user-city,
    .app-user-role {
        display: none;
    }

    .page-header,
    body > .container > .d-flex.justify-content-between.align-items-center,
    body > .container-fluid > .d-flex.justify-content-between.align-items-center {
        align-items: flex-start !important;
    }

    .page-actions,
    body > .container > .d-flex.justify-content-between .d-flex,
    body > .container-fluid > .d-flex.justify-content-between .d-flex {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .card-body {
        padding: 0.85rem;
    }

    .table {
        font-size: 0.82rem;
    }

    .app-form-actions .btn {
        flex: 1 1 130px;
    }
}

@media print {
    .app-user-bar,
    .no-print,
    .page-actions {
        display: none !important;
    }

    body::before {
        display: none;
    }

    body,
    .card,
    .table > tbody > tr > * {
        background: #fff !important;
        box-shadow: none !important;
    }

    .rapor-baslik {
        gap: 12px;
    }

    .rapor-logo {
        width: 120px;
        height: 56px;
    }
}
