/* =============================================================
   app.css — lightweight utility/component layer
   Replaces the Bootstrap dependency. Reproduces only the subset of
   Bootstrap grid / utilities / components actually used across the
   site, tuned to the white-blue VinScan theme.
   Design tokens live in site.css (:root).
   ============================================================= */

/* ---------- Grid / layout ---------- */
.container,
.container-fluid {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 16px;
    padding-left: 16px;
}

@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1240px; } }

.row {
    --gutter-x: 1.5rem;
    --gutter-y: 0;
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--gutter-y));
    margin-right: calc(-.5 * var(--gutter-x));
    margin-left: calc(-.5 * var(--gutter-x));
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--gutter-x) * .5);
    padding-left: calc(var(--gutter-x) * .5);
    margin-top: var(--gutter-y);
}

.g-0  { --gutter-x: 0;      --gutter-y: 0; }
.g-1  { --gutter-x: .25rem; --gutter-y: .25rem; }
.g-2  { --gutter-x: .5rem;  --gutter-y: .5rem; }
.g-3  { --gutter-x: 1rem;   --gutter-y: 1rem; }
.g-4  { --gutter-x: 1.5rem; --gutter-y: 1.5rem; }
.g-5  { --gutter-x: 3rem;   --gutter-y: 3rem; }

.col          { flex: 1 0 0%; }
.col-auto     { flex: 0 0 auto; width: auto; }
.col-1  { flex: 0 0 auto; width: 8.33333333%; }
.col-2  { flex: 0 0 auto; width: 16.66666667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.33333333%; }
.col-5  { flex: 0 0 auto; width: 41.66666667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.33333333%; }
.col-8  { flex: 0 0 auto; width: 66.66666667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-3  { flex: 0 0 auto; width: 25%; }
    .col-sm-4  { flex: 0 0 auto; width: 33.33333333%; }
    .col-sm-6  { flex: 0 0 auto; width: 50%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
    .col-md-2  { flex: 0 0 auto; width: 16.66666667%; }
    .col-md-3  { flex: 0 0 auto; width: 25%; }
    .col-md-4  { flex: 0 0 auto; width: 33.33333333%; }
    .col-md-6  { flex: 0 0 auto; width: 50%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-2  { flex: 0 0 auto; width: 16.66666667%; }
    .col-lg-3  { flex: 0 0 auto; width: 25%; }
    .col-lg-4  { flex: 0 0 auto; width: 33.33333333%; }
    .col-lg-6  { flex: 0 0 auto; width: 50%; }
    .col-lg-7  { flex: 0 0 auto; width: 58.33333333%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* ---------- Display ---------- */
.d-none    { display: none !important; }
.d-block   { display: block !important; }
.d-inline  { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex    { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid    { display: grid !important; }

/* ---------- Flexbox utilities ---------- */
.flex-row    { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap   { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }
.justify-content-evenly  { justify-content: space-evenly !important; }
.justify-content-end     { justify-content: flex-end !important; }
.align-items-start    { align-items: flex-start !important; }
.align-items-center   { align-items: center !important; }
.align-items-end      { align-items: flex-end !important; }
.align-self-center    { align-self: center !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* ---------- Spacing (margins / paddings, scale 0-5) ---------- */
.m-0{margin:0!important;} .m-1{margin:.25rem!important;} .m-2{margin:.5rem!important;} .m-3{margin:1rem!important;} .m-4{margin:1.5rem!important;} .m-5{margin:3rem!important;}
.mt-0{margin-top:0!important;} .mt-1{margin-top:.25rem!important;} .mt-2{margin-top:.5rem!important;} .mt-3{margin-top:1rem!important;} .mt-4{margin-top:1.5rem!important;} .mt-5{margin-top:3rem!important;}
.mb-0{margin-bottom:0!important;} .mb-1{margin-bottom:.25rem!important;} .mb-2{margin-bottom:.5rem!important;} .mb-3{margin-bottom:1rem!important;} .mb-4{margin-bottom:1.5rem!important;} .mb-5{margin-bottom:3rem!important;}
.ms-0{margin-left:0!important;} .ms-1{margin-left:.25rem!important;} .ms-2{margin-left:.5rem!important;} .ms-3{margin-left:1rem!important;} .ms-auto{margin-left:auto!important;}
.me-0{margin-right:0!important;} .me-1{margin-right:.25rem!important;} .me-2{margin-right:.5rem!important;} .me-3{margin-right:1rem!important;} .me-auto{margin-right:auto!important;}
.mx-0{margin-left:0!important;margin-right:0!important;} .mx-2{margin-left:.5rem!important;margin-right:.5rem!important;} .mx-3{margin-left:1rem!important;margin-right:1rem!important;} .mx-auto{margin-left:auto!important;margin-right:auto!important;}
.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important;} .my-3{margin-top:1rem!important;margin-bottom:1rem!important;} .my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important;} .my-5{margin-top:3rem!important;margin-bottom:3rem!important;}

.p-0{padding:0!important;} .p-1{padding:.25rem!important;} .p-2{padding:.5rem!important;} .p-3{padding:1rem!important;} .p-4{padding:1.5rem!important;} .p-5{padding:3rem!important;}
.pt-0{padding-top:0!important;} .pt-2{padding-top:.5rem!important;} .pt-3{padding-top:1rem!important;} .pt-4{padding-top:1.5rem!important;} .pt-5{padding-top:3rem!important;}
.pb-0{padding-bottom:0!important;} .pb-2{padding-bottom:.5rem!important;} .pb-3{padding-bottom:1rem!important;} .pb-4{padding-bottom:1.5rem!important;} .pb-5{padding-bottom:3rem!important;}
.ps-2{padding-left:.5rem!important;} .ps-3{padding-left:1rem!important;}
.pe-2{padding-right:.5rem!important;} .pe-3{padding-right:1rem!important;}
.px-2{padding-left:.5rem!important;padding-right:.5rem!important;} .px-3{padding-left:1rem!important;padding-right:1rem!important;} .px-4{padding-left:1.5rem!important;padding-right:1.5rem!important;} .px-5{padding-left:3rem!important;padding-right:3rem!important;}
.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important;} .py-3{padding-top:1rem!important;padding-bottom:1rem!important;} .py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important;} .py-5{padding-top:3rem!important;padding-bottom:3rem!important;}

/* ---------- Sizing ---------- */
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }

/* ---------- Position ---------- */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed    { position: fixed !important; }
.top-0    { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0  { left: 0 !important; }
.end-0    { right: 0 !important; }

/* ---------- Overflow ---------- */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }

/* ---------- Borders / radius / shadow ---------- */
.border        { border: 1px solid var(--border) !important; }
.border-0      { border: 0 !important; }
.border-top    { border-top: 1px solid var(--border) !important; }
.rounded       { border-radius: .5rem !important; }
.rounded-pill  { border-radius: 50rem !important; }
.rounded-circle{ border-radius: 50% !important; }
.shadow-sm { box-shadow: 0 2px 8px rgba(17, 40, 90, .06) !important; }
.shadow    { box-shadow: 0 6px 20px rgba(17, 40, 90, .10) !important; }
.shadow-lg { box-shadow: 0 16px 40px rgba(17, 40, 90, .16) !important; }
.shadow-none { box-shadow: none !important; }

/* ---------- Backgrounds ---------- */
.bg-white     { background-color: #fff !important; }
.bg-light     { background-color: var(--bg) !important; }
.bg-primary   { background-color: var(--blue) !important; }
.bg-secondary { background-color: #6b7280 !important; }
.bg-danger    { background-color: #ef4444 !important; }
.bg-success   { background-color: #16a34a !important; }
.bg-transparent { background-color: transparent !important; }

/* ---------- Text utilities ---------- */
.text-start  { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end    { text-align: right !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-nowrap { white-space: nowrap !important; }
.text-uppercase { text-transform: uppercase !important; }
.fw-normal   { font-weight: 400 !important; }
.fw-medium   { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold     { font-weight: 700 !important; }
.fst-italic  { font-style: italic !important; }
.small       { font-size: .875em !important; }
.lh-1        { line-height: 1 !important; }

.text-white    { color: #fff !important; }
.text-white-50 { color: rgba(255,255,255,.55) !important; }
.text-dark     { color: var(--text-dark) !important; }
.text-muted    { color: var(--text-muted) !important; }
.text-primary  { color: var(--blue) !important; }
.text-danger   { color: #ef4444 !important; }
.text-success  { color: #16a34a !important; }

/* Heading-as-class + display + lead */
.h1,.h2,.h3,.h4,.h5,.h6 { font-weight: 600; line-height: 1.2; margin-bottom: .5rem; }
.h1 { font-size: 2.25rem; } .h2 { font-size: 1.875rem; } .h3 { font-size: 1.5rem; }
.h4 { font-size: 1.25rem; } .h5 { font-size: 1.1rem; } .h6 { font-size: 1rem; }
.display-4 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.1; }
.lead { font-size: 1.2rem; font-weight: 400; }

.opacity-50 { opacity: .5 !important; }
.opacity-75 { opacity: .75 !important; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: .55rem 1.1rem;
    font-size: 1rem;
    border-radius: 10px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 1px; }
.btn:disabled, .btn.disabled { opacity: .6; pointer-events: none; }

.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.15rem; border-radius: 12px; }

.btn-primary {
    color: #fff;
    background-color: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 6px 16px -8px rgba(30, 107, 255, .7);
}
.btn-primary:hover { color: #fff; background-color: var(--blue-dark); border-color: var(--blue-dark); }

.btn-secondary { color: #fff; background-color: #6b7280; border-color: #6b7280; }
.btn-secondary:hover { background-color: #565d68; border-color: #565d68; }

.btn-danger { color: #fff; background-color: #ef4444; border-color: #ef4444; }
.btn-danger:hover { background-color: #dc2626; border-color: #dc2626; }

.btn-outline-primary {
    color: var(--blue);
    background-color: transparent;
    border-color: var(--blue);
}
.btn-outline-primary:hover { color: #fff; background-color: var(--blue); border-color: var(--blue); }

.btn-link { color: var(--blue); background: transparent; border: 0; text-decoration: underline; }

/* ---------- Cards ---------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.card-body   { flex: 1 1 auto; padding: 1.25rem; }
.card-title  { margin-bottom: .5rem; font-weight: 600; }
.card-text   { margin-bottom: 0; }
.card-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); }
.card-img-top { width: 100%; border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); object-fit: cover; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: .35em .6em;
    font-size: .75em;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .5rem;
}

/* ---------- Forms ---------- */
.form-control {
    display: block;
    width: 100%;
    padding: .55rem .85rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    outline: 0;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
}
.form-control::placeholder { color: var(--text-muted); opacity: 1; }
.form-label { display: inline-block; margin-bottom: .4rem; font-weight: 500; }
.form-select {
    display: block;
    width: 100%;
    padding: .55rem 2rem .55rem .85rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: #fff;
}

.input-group { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; }
.input-group > .form-control { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .btn { position: relative; z-index: 2; }
.input-group:not(.input-group-lg) > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group:not(.input-group-lg) > :not(:last-child)  { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-lg > .form-control,
.input-group-lg > .btn { padding: .8rem 1.1rem; font-size: 1.15rem; }

/* ---------- Tables ---------- */
.table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    color: var(--text-dark);
    vertical-align: middle;
}
.table > thead { vertical-align: bottom; }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(30, 107, 255, .035); }

/* ---------- Spinner ---------- */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -.125em;
    border: .25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}
.text-primary.spinner-border { color: var(--blue); }
@keyframes spinner-border { to { transform: rotate(360deg); } }

/* ---------- Placeholders (loading skeleton) ---------- */
.placeholder {
    display: inline-block;
    min-height: 1em;
    vertical-align: middle;
    cursor: wait;
    background-color: currentColor;
    opacity: .35;
    border-radius: 4px;
}
.placeholder.col-8  { width: 66%; }
.placeholder.col-12 { width: 100%; }
.placeholder-glow .placeholder { animation: placeholder-glow 2s ease-in-out infinite; }
@keyframes placeholder-glow { 50% { opacity: .15; } }
