/* =====================================================
   STOK TAKIP SISTEMI - GLOBAL UI
   Mobile-first, Android-friendly, Bootstrap 5 compatible
   ===================================================== */

:root {
    --font-arayuz: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-family: var(--font-arayuz);
    --bs-body-font-size: 14px;
    --renk-ana: #2563eb;
    --renk-ana-koyu: #1d4ed8;
    --renk-ana-soluk: #eff6ff;
    --renk-ikincil: #0f766e;
    --renk-basari: #16a34a;
    --renk-uyari: #d97706;
    --renk-tehlike: #dc2626;
    --renk-bilgi: #0284c7;

    --bg-genel: #f4f7fb;
    --bg-kart: #ffffff;
    --bg-yumusak: #f8fafc;
    --bg-sidebar: #152033;
    --bg-sidebar-hover: #21304a;
    --bg-sidebar-aktif: #2563eb;

    --metin-ana: #111827;
    --metin-yan: #4b5563;
    --metin-acik: #64748b;
    --metin-soluk: var(--metin-acik);
    --zemin-ikincil: var(--bg-yumusak);
    --metin-sidebar: #d7deeb;

    --kenarlik: #dfe5ef;
    --kenarlik-koyu: #c8d1df;
    --golge-kart: 0 1px 2px rgba(15, 23, 42, 0.05);
    --golge-yumusak: 0 12px 30px rgba(15, 23, 42, 0.10);

    --sidebar-w: 272px;
    --header-h: 60px;
    --radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-genel);
    color: var(--metin-ana);
    font-family: var(--font-arayuz);
    font-size: 14px;
    line-height: 1.5;
}

@supports (min-height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

body.sidebar-open {
    overflow: hidden;
}

button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 700; }
small, .small { line-height: 1.45; }

img,
svg,
video,
canvas {
    max-width: 100%;
}

a {
    color: var(--renk-ana);
    text-decoration: none;
}

a:hover {
    color: var(--renk-ana-koyu);
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.10), transparent 46%),
        linear-gradient(25deg, rgba(15, 118, 110, 0.12), transparent 44%),
        #eef3f9;
}

.login-card {
    width: min(100%, 420px);
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--golge-yumusak);
}

.login-logo {
    margin-bottom: 24px;
    text-align: center;
}

.login-logo h1 {
    margin: 10px 0 5px;
    color: var(--metin-ana);
    font-size: 24px;
    font-weight: 700;
}

.login-logo p {
    margin: 0;
    color: var(--metin-yan);
    font-size: 13px;
}

.login-icon {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--renk-ana);
    color: #fff;
    font-size: 28px;
}

/* Shell */
.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--kenarlik);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--golge-kart);
    backdrop-filter: blur(12px);
}

.app-header .navbar-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    color: var(--metin-ana);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
}

.app-header .navbar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo { height: 28px; max-width: 130px; object-fit: contain; }
.header-user-name { font-size: 13px; font-weight: 600; line-height: 1.35; }
.header-user-role { font-size: 12px; color: var(--metin-yan); line-height: 1.35; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 1200; padding: 12px 18px; border-radius: 6px; background: var(--renk-ana); color: #fff; }
.skip-link:focus { top: 8px; color: #fff; }

.app-header .menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--metin-yan);
    cursor: pointer;
    font-size: 24px;
}

.app-header .menu-toggle:hover {
    border-color: var(--kenarlik);
    background: var(--bg-yumusak);
    color: var(--metin-ana);
}

.app-header .header-right {
    min-width: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-dropdown .dropdown-toggle > .text-start {
    min-width: 0;
    max-width: min(220px, 30vw);
}

.user-dropdown .dropdown-toggle > .text-start > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--renk-ikincil);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.app-sidebar {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    bottom: 0;
    left: 0;
    z-index: 1020;
    width: var(--sidebar-w);
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    background: var(--bg-sidebar);
    color: var(--metin-sidebar);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.app-sidebar .menu {
    margin: 0;
    padding: 14px 0;
    list-style: none;
}

.app-sidebar .menu-baslik {
    padding: 14px 18px 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app-sidebar .menu-item a {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    border-left: 3px solid transparent;
    color: var(--metin-sidebar);
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-sidebar .menu-item a i {
    width: 22px;
    flex: 0 0 22px;
    font-size: 17px;
    text-align: center;
}

.app-sidebar .menu-item a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar .menu-item a:hover,
.app-sidebar .menu-item a:focus {
    background: var(--bg-sidebar-hover);
    color: #fff;
}

.app-sidebar .menu-item.aktif a {
    border-left-color: #fff;
    background: var(--bg-sidebar-aktif);
    color: #fff;
}

.sidebar-overlay {
    display: none;
}

.app-content {
    width: auto;
    min-width: 0;
    min-height: 0;
    flex: 1 0 auto;
    margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    margin-left: var(--sidebar-w);
    padding: clamp(14px, 2vw, 24px);
}

.app-footer {
    flex: 0 0 auto;
    margin-left: var(--sidebar-w);
    padding: 14px clamp(14px, 2vw, 24px) max(14px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--kenarlik);
    background: #fff;
    color: var(--metin-acik);
    font-size: 12px;
    text-align: center;
}

/* Page layout */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-header h1 {
    min-width: 0;
    margin: 0;
    color: var(--metin-ana);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
    flex: 1 1 240px;
}

.page-header .page-actions {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.page-header .page-actions > * {
    min-width: 0;
}

.page-header .page-actions > form {
    display: flex;
}

.page-header .page-actions .btn {
    white-space: normal;
}

.page-header .page-actions > form .btn {
    width: 100%;
}

.row,
.row > * {
    min-width: 0;
}

.card,
.table-wrap,
.stat-card {
    min-width: 0;
    border: 1px solid var(--kenarlik);
    border-radius: var(--radius);
    background: var(--bg-kart);
    box-shadow: var(--golge-kart);
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--kenarlik);
    background: #fff;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.card-header.d-flex,
.card-header.justify-content-between {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-body {
    padding: 18px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.card-footer { padding: 14px 18px; background: var(--bg-yumusak); border-color: var(--kenarlik); }
.card-footer.d-flex { flex-wrap: wrap; gap: 12px; }
.card-footer > *, .card-header > * { min-width: 0; }
.card-title { font-weight: 600; }

.empty-state {
    min-height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 20px;
    color: var(--metin-yan);
    text-align: center;
}

.empty-state > i,
.empty-state .empty-state-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--renk-ana-soluk);
    color: var(--renk-ana);
    font-size: 24px;
    line-height: 1;
}

.empty-state h3,
.empty-state h4,
.empty-state p {
    margin: 0;
}

.empty-state h3,
.empty-state h4 {
    color: var(--metin-ana);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.empty-state p {
    max-width: 520px;
    color: var(--metin-yan);
    font-size: 13px;
    line-height: 1.5;
}

.empty-state .btn {
    margin-top: 8px;
}

[data-live-result-for] {
    position: relative;
    transition: opacity 0.16s ease;
}

[data-live-result-for].is-live-loading {
    opacity: 0.64;
    pointer-events: none;
}

[data-live-result-for].is-live-loading::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(37, 99, 235, 0.22);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: liveSpin 0.7s linear infinite;
}

@keyframes liveSpin {
    to { transform: rotate(360deg); }
}

.customer-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.customer-select-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.customer-picker {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.customer-picker-button {
    display: flex;
    width: 100%;
    min-height: 42px;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--kenarlik-koyu);
    border-radius: 8px;
    background: #fff;
    padding: 7px 38px 7px 12px;
    text-align: left;
    line-height: 1.25;
}

.customer-picker-button::after {
    content: "\F282";
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--metin-soluk);
    font-family: "bootstrap-icons";
    font-size: 13px;
}

.customer-native-select.is-invalid + .customer-select-wrap .customer-picker-button {
    border-color: #dc3545;
}

.customer-picker-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--metin-ana);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-picker-subtitle {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--metin-yan);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1060;
    display: none;
    overflow: hidden;
    border: 1px solid var(--kenarlik);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.customer-picker.open .customer-picker-menu {
    display: block;
}

.customer-picker-search {
    border: 0;
    border-bottom: 1px solid var(--kenarlik);
    border-radius: 0;
}

.customer-picker-results {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
}

.customer-picker-item {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 9px 10px;
    text-align: left;
}

.customer-picker-item:hover,
.customer-picker-item:focus {
    background: var(--bg-yumusak);
}

.customer-picker-empty {
    padding: 14px 10px;
    color: var(--metin-yan);
    font-size: 13px;
    text-align: center;
}

.customer-picker-add {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
}

.temlik-musteri-secim-form .customer-picker-button,
.temlik-musteri-secim-form .customer-picker-add,
.temlik-musteri-secim-form .temlik-devam-btn {
    min-height: 44px;
    height: 44px;
}

.temlik-musteri-secim-form .temlik-devam-btn {
    width: 100%;
    white-space: nowrap;
}

.temlik-musteri-secim-form .temlik-submit-spacer {
    visibility: hidden;
}

@media (max-width: 575.98px) {
    .customer-select-wrap {
        flex-direction: column;
    }

    .customer-picker-menu {
        position: fixed;
        inset: auto 12px 12px 12px;
        top: auto;
        max-height: min(70vh, 430px);
    }

    .customer-picker-results {
        max-height: calc(min(70vh, 430px) - 48px);
    }
}

/* Tables */
.table-wrap {
    overflow: hidden;
}

.table-responsive {
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table {
    width: 100%;
    margin: 0;
}

.table-responsive .table {
    min-width: 720px;
}

.table thead th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--kenarlik);
    background: var(--bg-yumusak);
    color: var(--metin-yan);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td,
.table tbody th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--kenarlik);
    vertical-align: middle;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: #fbfdff;
}

.table code {
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
}

.table th,
.table td {
    overflow-wrap: anywhere;
}

.table .text-truncate-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table .col-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 58px;
    min-width: 58px;
    padding: 6px;
    background: #fff;
    box-shadow: -8px 0 10px -10px rgba(15, 23, 42, 0.40);
    text-align: center;
}

.table thead .col-actions {
    background: var(--bg-yumusak);
}

.table tbody tr:hover .col-actions {
    background: #fbfdff;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #edf2f7;
}

.table-responsive::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b8c3d4;
}

/* Short information tables fit their card; operational tables scroll locally. */
.table-responsive .table-compact,
.table-responsive .table-detail { min-width: 0; }
.table-detail { table-layout: fixed; }
.table-detail > tbody > tr > :first-child { width: 38%; color: var(--metin-yan); font-weight: 500; }
.table-detail th, .table-detail td { white-space: normal !important; overflow-wrap: anywhere; }
.table-detail td a { overflow-wrap: anywhere; }
.permission-matrix th:first-child,
.permission-matrix td:first-child { position: sticky; left: 0; z-index: 2; background: var(--bg-kart); min-width: 156px; }
.permission-matrix thead th:first-child { z-index: 3; background: var(--bg-yumusak); }
.permission-matrix .form-check-input { width: 18px; height: 18px; margin: 0; cursor: pointer; }

/* Action menu */
.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--metin-yan);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-menu-btn:hover,
.action-menu-btn:focus {
    border-color: var(--kenarlik);
    background: #eef2f7;
    color: var(--metin-ana);
}

.action-menu-btn i {
    font-size: 18px;
    line-height: 1;
}

.action-menu .dropdown-menu {
    min-width: 180px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--kenarlik);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--golge-yumusak);
    font-size: 13px;
    z-index: 1120;
}

.action-menu form {
    margin: 0;
}

.action-menu form button.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.action-menu .dropdown-item {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 6px;
}

.action-menu .dropdown-item i {
    width: 16px;
    font-size: 14px;
    text-align: center;
}

.action-menu .dropdown-item:hover {
    background: var(--renk-ana-soluk);
}

.action-menu .dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: var(--renk-tehlike);
}

.action-menu .dropdown-divider {
    margin: 4px 0;
}

.action-menu-portal {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    min-width: min(180px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    margin: 0 !important;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--kenarlik);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--golge-yumusak);
    transform: none !important;
    font-size: 13px;
    z-index: 1010;
}

.action-menu-portal form {
    margin: 0;
}

.action-menu-portal form button.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.action-menu-portal .dropdown-item {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 6px;
}

.action-menu-portal .dropdown-item i {
    width: 16px;
    font-size: 14px;
    text-align: center;
}

.action-menu-portal .dropdown-item:hover {
    background: var(--renk-ana-soluk);
}

.action-menu-portal .dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: var(--renk-tehlike);
}

.action-menu-portal .dropdown-divider {
    margin: 4px 0;
}

/* Components */
.badge {
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #475569; }

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    border-color: var(--renk-ana);
    background-color: var(--renk-ana);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--renk-ana-koyu);
    background-color: var(--renk-ana-koyu);
}

.btn-sm {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 12px;
}

.form-label {
    margin-bottom: 6px;
    color: var(--metin-ana);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.form-control,
.form-select {
    min-width: 0;
    min-height: 40px;
    border-color: var(--kenarlik-koyu);
    border-radius: 7px;
    font-size: 14px;
}

.form-control::placeholder { color: var(--metin-acik); opacity: 1; }
.input-group-text { border-color: var(--kenarlik-koyu); background: var(--bg-yumusak); font-size: 14px; }
.form-control-sm, .form-select-sm, .input-group-sm > .form-control, .input-group-sm > .form-select { min-height: 36px; font-size: 13px; }

.form-control:focus,
.form-select:focus {
    border-color: var(--renk-ana);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .btn {
    min-height: 40px;
}

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

.form-text {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 10px;
}

.choice-card {
    width: 100%;
    min-height: 64px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--kenarlik);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
}

.choice-card:hover {
    border-color: var(--kenarlik-koyu);
    background: var(--bg-yumusak);
}

.choice-card:focus-within,
.choice-card:has(.form-check-input:checked) {
    border-color: var(--renk-ana);
    background: rgba(37, 99, 235, 0.05);
}

.choice-card .form-check-input {
    float: none;
    margin: 3px 0 0;
}

.choice-card-body {
    min-width: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.form-actions > * { min-width: 0; max-width: 100%; }
.form-actions > form { display: flex; }
.form-actions > form > .btn { flex: 1; }
.summary-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.summary-row > * { min-width: 0; overflow-wrap: anywhere; }
.summary-row > :last-child { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.currency-rate-value { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.currency-rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 0; }
.currency-rate-grid > * { width: auto; max-width: none; margin: 0; padding: 0; }

.required::after {
    content: " *";
    color: var(--renk-tehlike);
}

.nav-tabs {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs .nav-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dropdown-menu {
    border-color: var(--kenarlik);
    box-shadow: var(--golge-yumusak);
}

.dropdown-item, .dropdown-item-text, .dropdown-header { overflow-wrap: anywhere; white-space: normal; }
.modal-content { border: 1px solid var(--kenarlik); border-radius: var(--radius); box-shadow: var(--golge-yumusak); }
.modal-header, .modal-footer { padding: 16px 20px; gap: 10px; }
.modal-title { min-width: 0; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.modal-header .btn-close { flex: 0 0 auto; }
.modal-body { padding: 20px; min-width: 0; overflow-wrap: anywhere; }
.pagination { flex-wrap: wrap; gap: 4px; margin: 0; }
.pagination .page-link { min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px !important; }

.alert {
    border-radius: var(--radius);
}

.stat-card {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 22px;
}

.stat-card .stat-icon.bg-blue   { background: #dbeafe; color: #1e40af; }
.stat-card .stat-icon.bg-green  { background: #dcfce7; color: #166534; }
.stat-card .stat-icon.bg-orange { background: #fef3c7; color: #92400e; }
.stat-card .stat-icon.bg-red    { background: #fee2e2; color: #991b1b; }
.stat-card .stat-icon.bg-purple { background: #ede9fe; color: #5b21b6; }
.stat-card .stat-icon.bg-gray   { background: #e5e7eb; color: #374151; }

.stat-card .stat-info {
    min-width: 0;
    flex: 1;
}

.stat-card .stat-info h3 {
    margin: 0;
    color: var(--metin-ana);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-info p {
    margin: 2px 0 0;
    color: var(--metin-yan);
    font-size: 12px;
}

/* Utilities */
.text-tutar     { color: var(--metin-ana); font-weight: 700; }
.text-tutar-yes { color: var(--renk-basari); font-weight: 700; }
.text-tutar-no  { color: var(--renk-tehlike); font-weight: 700; }
.text-end, .text-tutar, .text-tutar-yes, .text-tutar-no, .input-tutar { font-variant-numeric: tabular-nums; }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0 !important; }

/* Tablet and mobile shell */
@media (max-width: 1199.98px) {
    :root {
        --header-h: 58px;
    }

    .app-sidebar {
        width: min(86vw, 320px);
        transform: translateX(-105%);
    }

    .app-sidebar.acik {
        transform: translateX(0);
        box-shadow: 18px 0 40px rgba(15, 23, 42, 0.28);
    }

    .app-content,
    .app-footer {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1010;
        display: block;
        touch-action: none;
        visibility: hidden;
        opacity: 0;
        background: rgba(15, 23, 42, 0.48);
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .sidebar-overlay.acik {
        visibility: visible;
        opacity: 1;
    }
}

@media (max-width: 767.98px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 20px;
        flex-basis: auto;
    }

    .page-header .page-actions {
        justify-content: stretch;
    }

    .page-header .page-actions > * {
        flex: 1 1 auto;
    }

    .page-header .page-actions .btn {
        width: 100%;
    }

    .table-responsive .table {
        min-width: 680px;
    }

    .table thead th,
    .table tbody td,
    .table tbody th {
        padding: 9px 10px;
        font-size: 13px;
    }

    .table .col-actions {
        width: 52px;
        min-width: 52px;
    }

    .table .badge {
        padding: 3px 7px;
        font-size: 10px;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 14px;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }

    .empty-state {
        min-height: 140px;
        padding: 24px 14px;
    }

    .empty-state > i,
    .empty-state .empty-state-icon {
        width: 42px;
        height: 42px;
        font-size: 21px;
    }

    .empty-state h3,
    .empty-state h4 {
        font-size: 16px;
    }

    .app-header {
        gap: 8px;
    }

    .app-header .navbar-brand {
        font-size: 16px;
    }

    .app-content {
        padding: 12px;
    }

    .login-wrapper {
        padding: 14px;
        align-items: start;
        padding-top: max(28px, env(safe-area-inset-top, 0px));
    }

    .login-card {
        padding: 22px;
    }

    .btn:not(.btn-sm),
    .form-control,
    .form-select,
    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .btn {
        min-height: 44px;
        font-size: 16px;
    }

    .btn-sm {
        min-height: 40px;
    }

    .form-control-sm, .form-select-sm, .input-group-sm > .form-control, .input-group-sm > .form-select { min-height: 44px; font-size: 16px; }
    .action-menu-btn { width: 40px; height: 40px; }
    .customer-picker-button { min-height: 44px; }
    .customer-picker-title { font-size: 16px; }
    .customer-picker-add { min-height: 44px; }
    .modal-header, .modal-footer, .modal-body { padding: 14px; }
    .modal-footer > .btn { flex: 1 1 auto; }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .stat-card {
        min-height: 74px;
        padding: 13px;
        gap: 11px;
    }

    .stat-card .stat-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 18px;
    }

    .stat-card .stat-info h3 {
        font-size: 18px;
    }

    .dropdown-menu {
        max-width: calc(100vw - 24px);
    }
}

@media (min-width: 360px) and (max-width: 575.98px) {
    .app-content .bayi-summary-grid,
    .app-content .depo-summary-grid,
    .app-content .magaza-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    :is(.bayi-summary-grid, .depo-summary-grid, .magaza-summary-grid) .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 126px; }
    :is(.bayi-summary-grid, .depo-summary-grid, .magaza-summary-grid) .stat-card .stat-icon { width: 32px; height: 32px; flex-basis: 32px; font-size: 17px; border-radius: 8px; }
    :is(.bayi-summary-grid, .depo-summary-grid, .magaza-summary-grid) .stat-card .stat-info { width: 100%; }
    :is(.bayi-summary-grid, .depo-summary-grid, .magaza-summary-grid) .stat-card .stat-info h3 { font-size: clamp(16px, 4.25vw, 20px); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
