:root {
    --navbar-height: 56px;
    --top-menu-height: 44px;
    --header-height: calc(var(--navbar-height) + var(--top-menu-height));
}

html {
    overflow-x: hidden;
}

body {
    padding-top: var(--navbar-height);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 992px) {
    body {
        padding-top: var(--header-height);
    }
}

.main-content-wrapper {
    min-height: calc(100vh - var(--navbar-height));
    overflow-x: hidden;
}

@media (min-width: 992px) {
    .main-content-wrapper {
        min-height: calc(100vh - var(--header-height));
    }
}

.main-content-wrapper > .container-fluid {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

/* Navbar */
.navbar.fixed-top {
    min-height: var(--navbar-height);
}

.navbar .container-fluid {
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    gap: 0.25rem;
}

.navbar-brand {
    font-size: 1rem;
    min-width: 0;
    max-width: min(12rem, calc(100vw - 7rem));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-search {
    width: min(260px, 42vw);
}

.top-menu-bar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    z-index: 1020;
    height: var(--top-menu-height);
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top-menu-bar::-webkit-scrollbar {
    display: none;
}

.top-menu-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.35rem 0;
    min-width: min-content;
}

.top-menu-nav .nav-link,
.mobile-menu-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.45rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.top-menu-nav .nav-link:hover,
.mobile-menu-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.top-menu-nav .nav-link.active,
.mobile-menu-nav .nav-link.active {
    background: #f59e0b;
    color: #111827;
    font-weight: 600;
}

.nav-highlight {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.menu-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.75rem 1rem 0.35rem;
}

/* Sayfa başlığı + aksiyonlar */
.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.page-toolbar > h1,
.page-toolbar > .page-toolbar-title {
    margin-bottom: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.page-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Liste satırı: mobilde alt alta */
.list-row-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .list-row-stack {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
}

.list-row-main {
    min-width: 0;
    flex: 1 1 auto;
}

.list-row-main .vehicle-meta {
    display: block;
    margin-top: 0.25rem;
    word-break: break-word;
}

@media (min-width: 576px) {
    .list-row-main .vehicle-meta {
        display: inline;
        margin-top: 0;
        margin-left: 0.5rem;
    }
}

.list-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .list-row-actions {
        width: 100%;
    }

    .list-row-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.stat-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
}

.search-hero {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: #fff;
    border-radius: 1rem;
    padding: 2rem;
}

@media (max-width: 575.98px) {
    .search-hero {
        padding: 1.25rem;
        border-radius: 0.75rem;
    }

    .search-hero .h3 {
        font-size: 1.25rem;
    }
}

.plate-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.08em;
    font-weight: 700;
    word-break: break-word;
}

.workflow-step {
    border-left: 3px solid #f59e0b;
    padding-left: 1rem;
}

/* Tablolar — yatay kaydırma, hücre taşması */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table td,
.table th {
    vertical-align: middle;
}

.table .cell-wrap {
    white-space: normal;
    word-break: break-word;
    min-width: 8rem;
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    padding: 0.2rem 0.45rem;
}

/* Formlar */
@media (max-width: 575.98px) {
    .row.g-2 > [class*="col-4"],
    .vehicle-form-meta > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Input group — dar ekranda taşmayı önle */
.input-group-lg {
    flex-wrap: nowrap;
}

.input-group-lg > .form-control {
    min-width: 0;
}

@media (max-width: 380px) {
    .input-group-lg > .btn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Durum filtreleri */
.status-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-filter-bar .btn {
    flex: 0 1 auto;
}

/* Araç arama */
.vehicle-search-wrap .vehicle-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: min(280px, 50vh);
    overflow-y: auto;
    margin-top: 0.25rem;
    border-radius: 0.5rem;
}

.vehicle-search-item {
    cursor: pointer;
}

.vehicle-selected-text {
    word-break: break-word;
}

.vehicle-selected-card {
    font-size: 0.95rem;
}

/* Kart başlıkları */
.card-header.flex-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
}

/* Giriş sayfası */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #111827;
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 16px;
    padding: 2rem;
    color: #fff;
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 1.5rem;
        border-radius: 12px;
    }
}
