:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --brand: #0d6efd;
    --page-bg: #f4f7fb;
    --sidebar-width: 290px;
    --topbar-height: 76px;
}

body {
    background: linear-gradient(180deg, #eef4ff 0%, #f7f9fc 100%);
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

.auth-wrapper {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(25, 135, 84, 0.14), transparent 25%),
        #f4f7fb;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--topbar-height);
    z-index: 1035;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
}

.topbar-user {
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    padding: 0.45rem 0.85rem;
    max-width: 100%;
}

.topbar-user:hover,
.topbar-user:focus {
    background: #f8fbff;
    border-color: #bfd2f5;
}

.topbar-user-avatar {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
}

.topbar-sidebar-toggle {
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid #dbe3ef;
    border-radius: 0.9rem;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.topbar-sidebar-toggle:hover,
.topbar-sidebar-toggle:focus {
    background: #f8fbff;
    border-color: #bfd2f5;
    color: #1d4ed8;
}

.topbar-sidebar-toggle i {
    font-size: 1rem;
    line-height: 1;
}

.app-brand-icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 42%),
        linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #0891b2 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 14px 30px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}

.app-brand-icon i {
    font-size: 0.95rem;
    line-height: 1;
}

.app-sidebar.sidebar,
.app-sidebar.sidebar.offcanvas,
.app-sidebar.sidebar.offcanvas-lg,
.app-sidebar.sidebar.offcanvas-start {
    min-height: 100vh;
    background-color: var(--sidebar-bg) !important;
    background-image: none !important;
    color: #fff;
    --bs-offcanvas-bg: var(--sidebar-bg);
    --bs-offcanvas-color: #fff;
    --bs-offcanvas-border-color: rgba(255, 255, 255, 0.08);
}

.sidebar .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    border-radius: 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
}

.content-wrapper {
    min-height: 100vh;
    padding-top: var(--topbar-height);
    width: 100%;
    overflow-x: hidden;
}

.app-main {
    width: 100%;
    min-width: 0;
}

.page-header {
    gap: 1rem;
}

.page-header-copy {
    min-width: 0;
}

.page-header-copy p {
    max-width: 40rem;
}

.page-header-badge {
    flex-shrink: 0;
}

.stat-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.table thead th {
    white-space: nowrap;
}

.vehicle-thumb {
    width: 128px;
    height: 88px;
    object-fit: cover;
    border-radius: 0.5rem;
    background: #e9ecef;
}

.vehicle-thumb--table {
    width: 132px;
    height: 84px;
    border-radius: 0.9rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.vehicle-list-table thead th {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    border-bottom-width: 1px;
}

.vehicle-list-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    vertical-align: middle;
}

.vehicle-list-table tbody tr {
    border-bottom-color: #e2e8f0;
}

.vehicle-image-cell {
    width: 156px;
}

.vehicle-meta {
    color: #64748b;
    font-size: 0.88rem;
}

.vehicle-spec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vehicle-spec-list span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
}

.vehicle-price-stack {
    display: grid;
    gap: 0.75rem;
}

.vehicle-price-stack .label {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vehicle-price-stack .value {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}

.vehicle-empty-state {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
}

.config-section-title {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.config-check-grid {
    display: grid;
    gap: 0.85rem;
}

.config-process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.config-check-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.95rem;
    cursor: pointer;
}

.config-check-card input {
    margin-top: 0.2rem;
}

.config-check-card strong {
    display: block;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.config-check-card small {
    display: block;
    color: #64748b;
    line-height: 1.45;
}

.config-panel {
    background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
}

.config-hint-title {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #334155;
    font-weight: 700;
    margin-bottom: 0.9rem;
}

.print-area {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
}

.contract-sheet {
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.contract-hero {
    background:
        linear-gradient(135deg, rgba(13, 110, 253, 0.94), rgba(8, 66, 152, 0.94)),
        linear-gradient(135deg, #0d6efd, #084298);
    color: #fff;
}

.contract-section-title {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.contract-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.contract-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem;
}

.contract-info-card .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.contract-info-card .value {
    font-weight: 700;
    color: #0f172a;
}

.contract-clause {
    border-left: 4px solid #0d6efd;
    background: #f8fbff;
    border-radius: 0.75rem;
    padding: 1rem 1rem 1rem 1.15rem;
}

.chart-panel {
    position: relative;
    height: 180px;
}

.chart-panel-lg {
    height: 320px;
}

.dashboard-hero {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.14), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 1.25rem;
}

.dashboard-eyebrow,
.dashboard-section-title {
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 800;
}

.dashboard-section-title {
    margin-bottom: 1rem;
}

.dashboard-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.dashboard-highlight-card,
.dashboard-guarantee-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.92);
}

.dashboard-highlight-card .label,
.dashboard-guarantee-card .label {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.dashboard-highlight-card strong,
.dashboard-guarantee-card strong {
    display: block;
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1.15;
    margin-bottom: 0.3rem;
}

.dashboard-highlight-card small,
.dashboard-guarantee-card small {
    color: #64748b;
    line-height: 1.45;
}

.guarantee-custody {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.guarantee-paid {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.guarantee-refund {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.guarantee-retained {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.dashboard-stat-icon {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.dashboard-ranking-list,
.dashboard-client-list {
    display: grid;
    gap: 0.85rem;
}

.dashboard-ranking-list {
    list-style: none;
    padding-left: 0;
    counter-reset: dashboard-rank;
}

.dashboard-ranking-item,
.dashboard-client-item,
.dashboard-empty-list {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fbfdff;
}

.dashboard-empty-list {
    color: #64748b;
}

.rank-badge {
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 800;
}

.responsive-table-card {
    width: 100%;
}

.responsive-table-list {
    width: 100%;
}

@media (min-width: 992px) {
    .topbar {
        left: var(--sidebar-width);
        transition: left 0.25s ease;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        min-height: 100vh;
        overflow-y: auto;
        z-index: 1040;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .app-main {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        transition: margin-left 0.25s ease, width 0.25s ease;
    }

    .sidebar .offcanvas-header {
        position: sticky;
        top: 0;
        background: var(--sidebar-bg);
        z-index: 2;
    }

    body.sidebar-collapsed .topbar {
        left: 0;
    }

    body.sidebar-collapsed .app-sidebar,
    body.sidebar-collapsed .app-sidebar.offcanvas-lg,
    body.sidebar-collapsed .app-sidebar.offcanvas-start {
        transform: translateX(calc(-1 * var(--sidebar-width))) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    body.sidebar-collapsed .app-main {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 991px) {
    :root {
        --topbar-height: 72px;
    }

    .app-sidebar {
        min-height: auto;
        width: min(86vw, 320px) !important;
        top: 0;
    }

    .topbar {
        left: 0;
    }

    .content-wrapper {
        padding-top: var(--topbar-height);
    }

    .page-header {
        align-items: flex-start !important;
        margin-bottom: 1.5rem !important;
    }

    .page-header-copy h2 {
        font-size: 1.5rem;
    }

    .chart-panel {
        height: 240px;
    }

    .chart-panel-lg {
        height: 280px;
    }

    .vehicle-list-table {
        min-width: 960px;
    }
}

@media (max-width: 767px) {
    .topbar-brand .small {
        display: none;
    }

    .topbar-user {
        padding: 0.4rem 0.65rem;
    }

    .topbar-user-avatar {
        width: 2.1rem;
        height: 2.1rem;
    }

    .content-wrapper > .p-4 {
        padding: 1rem !important;
    }

    .card-header form .d-flex,
    .card-body form .d-flex,
    .modal-body form .d-flex,
    .page-header .d-flex {
        flex-wrap: wrap;
    }

    .table-responsive {
        overflow: visible;
    }

    .responsive-table-card table,
    .responsive-table-card thead,
    .responsive-table-card tbody,
    .responsive-table-card th,
    .responsive-table-card td,
    .responsive-table-card tr {
        display: block;
    }

    .responsive-table-card thead {
        display: none;
    }

    .responsive-table-card tbody {
        display: grid;
        gap: 1rem;
    }

    .responsive-table-card tbody tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
        padding: 0.25rem 0;
    }

    .responsive-table-card tbody td {
        border: 0;
        padding: 0.7rem 1rem;
        text-align: left !important;
    }

    .responsive-table-card tbody td::before {
        content: attr(data-label);
        display: block;
        color: #64748b;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        margin-bottom: 0.3rem;
        text-transform: uppercase;
    }

    .responsive-table-card tbody td:empty {
        display: none;
    }

    .responsive-table-card tbody td .d-flex.justify-content-end,
    .responsive-table-card tbody td .d-flex.justify-content-between {
        justify-content: flex-start !important;
    }

    .responsive-table-card tbody td .btn {
        width: 100%;
    }

    .responsive-table-card tbody td .d-flex.flex-wrap {
        width: 100%;
    }

    .responsive-table-card tbody td .badge {
        width: fit-content;
    }

    .responsive-table-list table,
    .responsive-table-list thead,
    .responsive-table-list tbody,
    .responsive-table-list th,
    .responsive-table-list td,
    .responsive-table-list tr {
        display: block;
    }

    .responsive-table-list thead {
        display: none;
    }

    .responsive-table-list tbody {
        display: block;
        counter-reset: mobile-list-row;
    }

    .responsive-table-list tbody tr {
        position: relative;
        display: block;
        padding: 0.8rem 0 1rem 0;
        border: 0;
        border-bottom: 1px solid #e2e8f0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        counter-increment: mobile-list-row;
    }

    .responsive-table-list tbody tr:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .responsive-table-list tbody tr::before {
        content: counter(mobile-list-row) ".";
        display: block;
        color: #0f172a;
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        margin: 0 1rem 0.35rem;
    }

    .responsive-table-list tbody td {
        border: 0;
        padding: 0.4rem 1rem;
        text-align: left !important;
        background: transparent;
    }

    .responsive-table-list tbody td::before {
        content: attr(data-label);
        display: block;
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        margin-bottom: 0.22rem;
        text-transform: uppercase;
    }

    .responsive-table-list tbody td:empty {
        display: none;
    }

    .responsive-table-list tbody td .d-flex.justify-content-end,
    .responsive-table-list tbody td .d-flex.justify-content-between {
        justify-content: flex-start !important;
    }

    .responsive-table-list tbody td .btn {
        width: 100%;
    }

    .responsive-table-list tbody td .d-flex.flex-wrap {
        width: 100%;
    }

    .responsive-table-list tbody td .badge {
        width: fit-content;
    }

    .vehicle-image-cell {
        width: auto;
    }

    .vehicle-thumb--table {
        width: 100%;
        max-width: 240px;
        height: 150px;
    }

    .contract-sheet {
        border-radius: 0.75rem;
    }

    .contract-info-grid,
    .config-process-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-highlight-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-ranking-item,
    .dashboard-client-item {
        align-items: flex-start;
    }
}
