/* assets/css/style.css */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../font/poppins.woff2') format('woff2'),
        url('../font/poppins.ttf') format('truetype');
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #2563eb;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .08), 0 2px 4px -2px rgba(0, 0, 0, .06);
}

html {
    overflow-x: clip;
    overflow-y: scroll;
    height: auto;
    min-height: 100%;
    touch-action: pan-y;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16.5px;
    font-weight: 500;
    line-height: 1.6;
    overflow-x: clip;
    overflow-y: visible;
    width: 100%;
    min-height: 100%;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* ---- Input font minimal 16px (cegah iOS zoom) ---- */
input,
select,
textarea,
button {
    font-family: inherit;
    font-size: 16px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0 !important;
}

/* ========================
   NAVBAR / TOP BAR
======================== */
.navbar-main {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar-brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
}

.navbar-brand-text img {
    height: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.nav-links a {
    padding: .4rem .8rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s;
}

.nav-links a:hover,
.nav-links a.active {
    background: #eff6ff;
    color: var(--primary);
}

.nav-links .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    height: 36px;
    padding: 0 1rem;
    box-sizing: border-box;
}

.nav-links .btn-nav {
    background: var(--primary);
    color: #fff !important;
}

.nav-links .btn-nav:hover {
    background: var(--primary-dark);
}

/* ========================
   HERO / INDEX
======================== */
.hero {
    background:
        linear-gradient(90deg, rgba(30, 64, 175, .66), rgba(37, 99, 235, .42)),
        url('../logo/disdukcapil.jpg') center 42% / cover no-repeat;
    color: #fff;
    min-height: 420px;
    aspect-ratio: 16 / 5;
    padding: 4.25rem 1.25rem 3.25rem;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: .5rem;
}

.hero p {
    font-size: 1.05rem;
    opacity: .9;
    margin-bottom: 1.5rem;
}

.hero-logo {
    width: clamp(58px, 8vw, 96px);
    height: clamp(58px, 8vw, 96px);
    object-fit: contain;
    display: block;
    margin: 0 auto .75rem;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, .22));
}

.hero-search {
    display: flex;
    gap: .5rem;
    max-width: 480px;
    margin: 0 auto;
}

.hero-search input {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: 15px;
    outline: none;
}

.hero-search button {
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: 8px;
    padding: .6rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
}

/* ========================
   FILTER KATEGORI
======================== */
.filter-bar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.25rem .75rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 99;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .85rem;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: .85rem;
    transition: all .15s;
    user-select: none;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========================
   KENDARAAN CARD
======================== */
.kendaraan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
    padding: 1.25rem;
}

.kendaraan-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.kendaraan-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kendaraan-card.perbaikan {
    opacity: .8;
}

.kendaraan-card-img {
    height: 160px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.kendaraan-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
    cursor: pointer;
}

.kendaraan-card-img:hover img {
    transform: scale(1.05);
}

.kendaraan-card-img .fa-car-placeholder {
    font-size: 3rem;
    color: #94a3b8;
}

.badge-status {
    position: absolute;
    top: .6rem;
    right: .6rem;
    padding: .25rem .65rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.badge-tersedia {
    background: #dcfce7;
    color: #15803d;
}

.badge-dipinjam {
    background: #fef9c3;
    color: #92400e;
}

.badge-perbaikan {
    background: #fee2e2;
    color: #991b1b;
    transform: rotate(-8deg);
    transform-origin: right top;
}

.kendaraan-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kendaraan-card-body h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.kendaraan-card-body .plat {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.kendaraan-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .75rem;
    font-size: .8rem;
    color: var(--text-muted);
}

.kendaraan-card-meta span {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.badge-catatan {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: .2rem .55rem;
    font-size: .75rem;
    margin-bottom: .75rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-book {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: .55rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    margin-top: auto;
}

.btn-book:hover {
    background: var(--primary-dark);
}

.btn-book:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.dipinjam-info {
    display: grid;
    gap: .35rem;
    margin: .25rem 0 .75rem;
    padding: .55rem .65rem;
    border: 1px solid #fed7aa;
    border-radius: 7px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .76rem;
    line-height: 1.35;
}

.dipinjam-info-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.dipinjam-info-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    color: #c2410c;
}

.dipinjam-info-label i {
    width: 14px;
    text-align: center;
    flex: 0 0 14px;
}

.dipinjam-info strong {
    min-width: 0;
    max-width: 9.5rem;
    color: #7c2d12;
    font-size: .74rem;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

/* ========================
   SIDEBAR DASHBOARD
======================== */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 60px);
    padding-left: 280px;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: .75rem 0;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    height: auto;
    overflow-y: auto;
    border-right: 0;
    box-shadow: none;
    z-index: 490;
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .9rem .8rem 1rem;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-head img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.sidebar-head strong {
    display: block;
    color: white;
    font-size: .98rem;
    line-height: 1.2;
}

.sidebar-head span {
    display: block;
    color: white;
    font-size: .78rem;
    margin-top: .15rem;
}

.sidebar-section {
    padding: .35rem .75rem .15rem;
    font-size: .7rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: .08em;
    margin-top: .5rem;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    border-radius: 7px;
    margin: .1rem .5rem;
    transition: background .15s, color .15s;
    cursor: pointer;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sidebar a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar a i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    margin-left: .55rem;
    margin-right: .55rem;
    margin-bottom: .35rem;
    padding: .55rem;
    border: 1px solid rgba(96, 165, 250, .22);
    background: rgba(30, 41, 59, .92);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .24);
}

.sidebar a.sidebar-profile-card {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    padding: .45rem;
    border-radius: 7px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, .18);
}

.sidebar a.sidebar-profile-card:hover {
    background: rgba(37, 99, 235, .18);
}

.sidebar a.sidebar-profile-card.active {
    background: rgba(37, 99, 235, .28);
    color: #fff;
}

.sidebar-profile-text {
    min-width: 0;
    flex: 1;
}

.sidebar-profile-text strong,
.sidebar-profile-text span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-text strong {
    color: #f8fafc;
    font-size: .84rem;
    line-height: 1.25;
}

.sidebar-profile-text span {
    color: #93c5fd;
    font-size: .74rem;
}

.sidebar-profile-arrow {
    width: auto !important;
    color: #93c5fd;
    font-size: .7rem;
    opacity: .9;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
}

.sidebar-password-btn {
    width: 100%;
    margin-top: .55rem;
    border: 1px solid rgba(147, 197, 253, .32);
    background: rgba(37, 99, 235, .16);
    color: #dbeafe;
    border-radius: 8px;
    padding: .55rem .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-password-btn:hover {
    background: rgba(37, 99, 235, .26);
    color: #fff;
}

/* ========================
   MAIN CONTENT
======================== */
.main-content {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
    overflow-x: hidden;
    transition: opacity .18s ease;
}

.main-content.page-loading {
    opacity: .96;
}

.main-content.page-ready {
    animation: pageFadeIn .22s ease both;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.dashboard-skeleton {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    width: min(920px, 100%);
}

.skeleton-line {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 18px;
    background: #e8eef6;
    border-radius: 6px;
    animation: skeletonPulse 1.2s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%,
    100% {
        opacity: .58;
    }

    50% {
        opacity: 1;
    }
}

.skeleton-line-title {
    width: min(340px, 68%);
    height: 28px;
    margin-bottom: .35rem;
}

.skeleton-line-mid {
    width: 74%;
}

.skeleton-line-short {
    width: 48%;
}

.return-time-panel {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.return-time-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text-primary);
}

.return-time-title i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.return-time-title strong,
.return-time-title span {
    display: block;
}

.return-time-title span {
    color: var(--text-muted);
    font-size: .82rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.verification-banner {
    width: 100%;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 5px solid var(--warning);
    border-radius: 8px;
    padding: .9rem 1rem;
    margin: -.25rem 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 10px 22px rgba(217, 119, 6, .12);
}

.verification-banner-main {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #7c2d12;
    font-size: .92rem;
}

.verification-banner-main strong {
    color: #9a3412;
}

.verification-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffedd5;
    color: var(--warning);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

/* ========================
   STAT CARDS
======================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Fallback placeholders */
.user-placeholder-fallback {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #cbd5e1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.user-placeholder-fallback i {
    font-size: 2.2rem;
}

.user-placeholder-fallback-swal {
    width: 150px;
    height: 150px;
    background-color: #cbd5e1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 1.5rem auto;
}

.user-placeholder-fallback-swal i {
    font-size: 3.5rem;
}

.kendaraan-placeholder-fallback {
    width: 100%;
    height: 100%;
    background-color: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kendaraan-placeholder-fallback i {
    font-size: 3rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: .9rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: #eff6ff;
    color: var(--primary);
}

.stat-icon.green {
    background: #f0fdf4;
    color: var(--success);
}

.stat-icon.yellow {
    background: #fefce8;
    color: var(--warning);
}

.stat-icon.red {
    background: #fef2f2;
    color: var(--danger);
}

.stat-icon.teal {
    background: #f0fdfa;
    color: #0d9488;
}

.stat-label {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ========================
   TABLE
======================== */
.card-table {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ========================
   PROFILE VERIFICATION
======================== */
.profile-verification-layout {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr);
    gap: 1.25rem;
    align-items: start;
}

.profile-panel,
.account-verification-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.profile-panel h5 {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.profile-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    margin: -.25rem 0 1.25rem;
    font-size: .9rem;
}

.profile-notice i {
    color: var(--primary);
    flex-shrink: 0;
}

.profile-field,
.verify-status-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}

.profile-field:last-child,
.verify-status-row:last-child {
    border-bottom: 0;
}

.profile-field span,
.verify-status-row span:first-child {
    color: var(--text-muted);
    font-size: .85rem;
}

.profile-field strong {
    color: var(--text-primary);
    font-size: .9rem;
    text-align: right;
}

.verify-status-row strong {
    color: var(--text);
    font-size: .85rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.profile-email-box {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.profile-waiting-box {
    margin-top: 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .85rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    color: #78350f;
    font-size: .86rem;
}

.profile-waiting-box > i {
    color: var(--warning);
    font-size: 1.2rem;
}

.camera-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 3;
    margin: 0 auto 1rem;
    overflow: hidden;
    border-radius: 12px;
    background: #0f172a;
    border: 1px solid var(--border);
}

.camera-box video,
.camera-box canvas,
.camera-box img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-box video {
    transform: scaleX(-1);
}

.camera-box canvas,
.camera-box img {
    display: none;
}

.camera-guide {
    position: absolute;
    left: 22%;
    top: 12%;
    width: 56%;
    height: 76%;
    border: 3px solid rgba(255, 255, 255, .95);
    border-radius: 48% 48% 44% 44%;
    box-shadow: 0 0 0 999px rgba(15, 23, 42, .26), 0 0 24px rgba(37, 99, 235, .55);
    pointer-events: none;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    font-size: .9rem;
    background: rgba(15, 23, 42, .72);
}

.verification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    justify-content: center;
}

.verification-meta {
    margin: .75rem 0 0;
    color: var(--text-muted);
    font-size: .86rem;
    text-align: center;
}

.verification-meta.ok {
    color: var(--success);
    font-weight: 600;
}

.card-table-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.card-table-header h6 {
    font-weight: 700;
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: .65rem 1rem;
    text-align: left;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

/* ========================
   MODAL / OVERLAY
======================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.swal2-container {
    z-index: 3000 !important;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    animation: modalIn .2s ease;
}

.modal-box.modal-lg {
    max-width: 720px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h5 {
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: .25rem .5rem;
    border-radius: 5px;
}

.modal-close:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
}

/* ========================
   FORMS
======================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .35rem;
}

.form-control {
    width: 100%;
    padding: .55rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: var(--text);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    font-size: .8rem;
    color: var(--danger);
    margin-top: .2rem;
}

.form-hint {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .2rem;
}

/* Date input cross-browser */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    font-size: 16px;
}

/* ========================
   BUTTONS
======================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: 7px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-sm {
    padding: .3rem .75rem;
    font-size: .8rem;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* ========================
   BADGES
======================== */
.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-primary {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef9c3;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* ========================
   ALERT TOAST (session kick)
======================== */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 340px;
}

.toast-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    border-left: 4px solid var(--danger);
    animation: toastIn .25s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    color: var(--danger);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: .1rem;
}

.toast-msg {
    flex: 1;
    font-size: .85rem;
    line-height: 1.5;
}

.toast-msg strong {
    display: block;
    margin-bottom: .2rem;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    padding: .1rem;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text);
}

/* ========================
   OLI WARNING BANNER
======================== */
.oli-warning {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .85rem;
    margin-bottom: .5rem;
}

.oli-warning i {
    color: var(--warning);
}

/* ========================
   LOGIN PAGE
======================== */
.auth-page {
    min-height: 100dvh;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 2rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.auth-logo h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: .4rem;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: .85rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: .55rem;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ========================
   PEMINJAMAN DATE PICKER
======================== */
.date-range-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

/* ========================
   KONDISI CHECKIN/CHECKOUT
======================== */
.foto-upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s;
}

.foto-upload-area:hover {
    border-color: var(--primary);
}

.foto-preview-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}

.foto-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.foto-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-preview-item button {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: .65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ========================
   PAGINATION
======================== */
.pagination {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.pagination button {
    padding: .35rem .65rem;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: .85rem;
    transition: all .15s;
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ========================
   EMPTY STATE
======================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    opacity: .4;
}

.empty-state p {
    font-size: .9rem;
}

/* ========================
   MOBILE HAMBURGER
======================== */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
    padding: .35rem .5rem;
    border-radius: 6px;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 498;
}

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 768px) {
    .dashboard-layout {
        padding-left: 0;
    }

    .kendaraan-grid {
        grid-template-columns: 1fr 1fr;
        gap: .75rem;
        padding: .75rem;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        min-height: 340px;
        padding: 2rem 1rem 1.5rem;
    }

    .hero-search {
        flex-direction: column;
    }

    .date-range-group {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -292px;
        top: 60px;
        bottom: 0;
        height: auto;
        z-index: 499;
        transition: left .25s;
        width: 280px;
        border-right: 0;
        box-shadow: none;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .main-content {
        padding: 1rem;
    }

    .verification-banner {
        align-items: stretch;
        flex-direction: column;
        margin-top: -.1rem;
    }

    .verification-banner .btn {
        justify-content: center;
        width: 100%;
    }

    .profile-verification-layout {
        grid-template-columns: 1fr;
    }

    .profile-waiting-box {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profile-waiting-box .btn {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .profile-field {
        flex-direction: column;
        gap: .25rem;
    }

    .profile-field strong {
        text-align: left;
    }

    .filter-bar {
        position: static;
    }

    .public-profile {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .navbar-main {
        padding: 0 .75rem;
        height: 56px;
    }

    .dashboard-layout {
        min-height: calc(100vh - 56px);
    }

    .sidebar {
        top: 56px;
    }

    .navbar-brand-text {
        font-size: 0.95rem;
        gap: 0.35rem;
    }

    .navbar-brand-text img {
        height: 28px !important;
    }

    .nav-links {
        gap: 0.35rem;
    }

    .nav-links .btn {
        height: 32px;
        padding: 0 0.65rem;
        font-size: 0.78rem;
        gap: 0.25rem;
        border-radius: 6px;
    }

    .sidebar-toggle {
        display: flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text);
        padding: 0;
    }

    .kendaraan-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .filter-bar {
        padding: .75rem;
        gap: .35rem;
    }

    .filter-chip {
        font-size: .78rem;
        padding: .28rem .65rem;
    }
}

/* ========================
   UTILITIES
======================== */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fs-sm {
    font-size: .8rem !important;
}

.mt-1 {
    margin-top: .25rem;
}

.mt-2 {
    margin-top: .5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: .25rem;
}

.mb-2 {
    margin-bottom: .5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: .5rem;
}

.gap-3 {
    gap: 1rem;
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .7);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .75rem;
    font-size: .9rem;
    color: var(--text-muted);
}

.loading-overlay.show {
    display: flex;
}

/* ========================
   CONCURRENT LOGIN KICK OVERLAY (BADGE TERBANG)
   ======================== */
.kicked-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    animation: kickedFadeIn 0.3s ease-out;
}

.kicked-badge {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: kickedSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kicked-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: #f1f5f9;
    border: none;
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.kicked-close:hover {
    background: #e2e8f0;
    color: var(--danger);
    transform: rotate(90deg);
}

.kicked-badge-icon {
    width: 76px;
    height: 76px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
    animation: kickedPulse 2s infinite;
}

.kicked-badge h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.kicked-badge p {
    font-family: 'Poppins', sans-serif;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    font-weight: 500;
}

.kicked-btn {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2), 0 2px 4px -2px rgba(220, 38, 38, 0.2);
}

.kicked-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.3);
}

.kicked-btn:active {
    transform: translateY(0);
}

@keyframes kickedFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes kickedSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes kickedPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* ========================
   RESPONSIVE LAYOUT UTILITIES
   ======================== */
.split-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.public-home {
    padding: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.public-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.public-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.public-section h2 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: .45rem;
}

.public-section p {
    color: var(--text-muted);
    font-size: .92rem;
    margin: 0;
}

.public-profile {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 360px);
    gap: 1rem;
    align-items: end;
}

.public-office {
    background:
        linear-gradient(rgba(255, 255, 255, .88), rgba(255, 255, 255, .92)),
        url('../logo/disdukcapil.jpg') center/cover;
}

.mini-chart {
    min-height: 220px;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    position: relative;
}

.mini-chart canvas {
    width: 100% !important;
    height: 200px !important;
}

.borrow-chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.borrow-chart-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: .9rem;
    min-width: 0;
    box-shadow: var(--shadow);
}

.borrow-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .65rem;
}

.borrow-chart-head strong {
    font-size: .92rem;
}

.borrow-chart-head span {
    color: var(--text-muted);
    font-size: .78rem;
    white-space: nowrap;
}

.chart-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    margin-top: .65rem;
}

.chart-toggle button {
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-muted);
    border-radius: 8px;
    padding: .48rem .6rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

.chart-toggle button.active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--primary);
}

.surat-tugas-box {
    border: 1px dashed #bfdbfe;
    background: #f8fbff;
    border-radius: 8px;
    padding: .85rem;
}

.form-check-line,
.delete-choice {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    margin-top: .65rem;
    cursor: pointer;
}

.form-check-line input,
.delete-choice input {
    margin-top: .2rem;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.form-check-line span {
    font-size: .84rem;
    color: var(--text);
}

.delete-choice {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .7rem;
    background: #f8fafc;
}

.delete-choice strong,
.delete-choice small {
    display: block;
}

.delete-choice small {
    color: var(--text-muted);
    font-size: .76rem;
    margin-top: .15rem;
}

/* Dashboard refinements */
.dashboard-layout {
    transition: padding-left .2s ease;
}

body.sidebar-collapsed .dashboard-layout {
    padding-left: 0;
}

.sidebar {
    transition: width .2s ease;
}

body.sidebar-collapsed .sidebar {
    width: 0;
    border-right-width: 0;
    box-shadow: none;
    overflow: hidden;
}

body.sidebar-collapsed .sidebar-head {
    justify-content: center;
    padding-left: .5rem;
    padding-right: .5rem;
}

body.sidebar-collapsed .sidebar-head div,
body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar a span,
body.sidebar-collapsed .sidebar-password-btn,
body.sidebar-collapsed .sidebar-profile-text,
body.sidebar-collapsed .sidebar-profile-arrow {
    display: none;
}

body.sidebar-collapsed .sidebar a {
    justify-content: center;
    padding: .72rem 0;
}

body.sidebar-collapsed .sidebar-footer {
    padding: .6rem .4rem;
}

body.sidebar-collapsed .sidebar-profile-card {
    justify-content: center;
}

.sidebar-collapse-btn {
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    color: #334155;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-collapse-btn:hover {
    border-color: #bfdbfe;
    color: var(--primary);
    background: #eff6ff;
}

body.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.icon-action {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 .1rem;
    transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.icon-action:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(.96);
}

.icon-action:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.icon-action-success {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.icon-action-warning {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fed7aa;
}

.icon-action-danger {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.icon-action-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #fff;
    padding: .35rem .55rem;
    border-radius: 6px;
    font-size: .72rem;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 30;
}

.has-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
    opacity: .78;
    font-weight: 400;
}

select:invalid {
    color: #94a3b8;
}

/* Final responsive overrides: keep late public-home rules from defeating mobile layout. */
.hero h1,
.hero p {
    max-width: min(100%, 920px);
    overflow-wrap: anywhere;
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: clamp(92px, 9vw, 148px);
    height: clamp(92px, 9vw, 148px);
    position: relative;
    z-index: 1;
}

@media (min-width: 769px) {
    .navbar-brand-text img {
        height: 46px !important;
    }
}

.public-stats .stat-card {
    min-width: 0;
}

.public-stats .stat-card > div:last-child {
    min-width: 0;
}

@media (min-width: 992px) {
    .public-stats {
        grid-template-columns: repeat(4, minmax(210px, 1fr));
    }
}

.public-home,
.public-section,
.public-profile,
.public-profile > *,
.mini-chart {
    min-width: 0;
}

.mini-chart {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .public-home {
        width: 100%;
        padding: 1rem;
    }

    .public-stats,
    .public-profile,
    .borrow-chart-grid {
        grid-template-columns: 1fr;
    }

    .public-stats .stat-label {
        white-space: normal;
    }

    .public-section {
        padding: 1rem;
    }

    .mini-chart {
        min-height: 190px;
    }

    .mini-chart canvas {
        height: 175px !important;
    }
}

@media (max-width: 480px) {
    .navbar-main {
        gap: .5rem;
    }

    .navbar-brand-text {
        min-width: 0;
        max-width: 160px;
    }

    .nav-links {
        flex-shrink: 0;
    }

    .nav-links .btn {
        width: 38px;
        padding: 0;
        font-size: 0;
    }

    .nav-links .btn span {
        display: none;
    }

    .nav-links .btn i {
        font-size: 1rem;
        margin: 0;
    }

    .hero {
        min-height: 300px;
        aspect-ratio: auto;
        padding: 1.75rem 1rem 1.25rem;
        overflow: hidden;
    }

    .hero > * {
        max-width: calc(100vw - 2rem);
    }

    .hero h1 {
        font-size: 1.45rem;
        line-height: 1.25;
        width: 100%;
        white-space: normal;
    }

    .hero p {
        font-size: .9rem;
        line-height: 1.45;
        width: 100%;
        white-space: normal;
    }

    .public-stats {
        gap: .75rem;
    }

    .public-stats .stat-card {
        width: 100%;
    }

    .hero-logo {
        display: block !important;
        width: 72px;
        height: 72px;
        flex: 0 0 auto;
    }

    .public-section h2 {
        font-size: 1rem;
    }

    .public-section p {
        font-size: .86rem;
    }
}
