/* ===========================================================================
   GigApp — thin layer on top of Bootstrap 5.
   Use Bootstrap utilities first; only add here what Bootstrap cannot express.
   =========================================================================== */

:root {
    --gig-sidebar-width: 236px;
    --gig-accent: #4f46e5;
    --gig-accent-soft: #eef2ff;
}

body {
    font-size: 0.925rem;
    background: var(--bs-body-bg);
}

/* ------------------------------------------------------------ admin shell */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar-toggle { display: none; }   /* CSS-only mobile drawer */

.sidebar {
    width: var(--gig-sidebar-width);
    flex-shrink: 0;
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.nav-group {
    padding: 1rem 1.1rem 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1.1rem;
    color: var(--bs-body-color);
    border-left: 3px solid transparent;
    border-radius: 0;
    font-size: 0.875rem;
}

.sidebar .nav-link:hover { background: var(--gig-accent-soft); }

.sidebar .nav-link.active {
    background: var(--gig-accent-soft);
    color: var(--gig-accent);
    border-left-color: var(--gig-accent);
    font-weight: 600;
}

.nav-icon { width: 1rem; text-align: center; opacity: 0.7; font-size: 0.8rem; }

.admin-main { flex: 1; min-width: 0; }

.admin-header {
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.18s ease;
    }
    .sidebar-toggle:checked ~ .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 2rem rgba(0, 0, 0, 0.25);
    }
}

/* --------------------------------------------------- jQuery UI autocomplete
   jQuery UI ships its own theme which fights Bootstrap, so it is not loaded.
   These rules make the widget look like a Bootstrap dropdown instead.        */
.ui-autocomplete {
    position: absolute;
    list-style: none;
    margin: 0.125rem 0 0;
    padding: 0.25rem 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.ui-autocomplete .ui-menu-item div {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    color: var(--bs-body-color);
}

.ui-autocomplete .ui-menu-item div.ui-state-active,
.ui-autocomplete .ui-menu-item div:hover {
    background: var(--gig-accent-soft);
    color: var(--gig-accent);
    border: 0;
    margin: 0;
}

.ac-hint { font-size: 0.72rem; line-height: 1.2; }
.ui-helper-hidden-accessible { display: none; }

/* ----------------------------------------------------------------- tables */
.table > :not(caption) > * > * { padding: 0.55rem 0.65rem; }
.table thead th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    font-weight: 600;
    white-space: nowrap;
}

.mono { font-family: var(--bs-font-monospace); font-size: 0.8rem; }

/* Status badges keyed off the task status string. */
.badge-pending     { background-color: #b45309 !important; }
.badge-accepted,
.badge-in_progress { background-color: #4f46e5 !important; }
.badge-completed   { background-color: #047857 !important; }
.badge-cancelled   { background-color: #b91c1c !important; }

/* --------------------------------------------------------- action buttons
   Each row action posts to a different endpoint, so every button sits in its
   own <form>. Bootstrap's .btn-group styles only direct .btn children, so a
   group would render with broken radii and spacing here. Use a plain flex row
   instead and let each button keep its own shape.                            */
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.row-actions.justify-end { justify-content: flex-end; }
.row-actions form { margin: 0; display: inline-flex; }
.row-actions .btn { white-space: nowrap; }

/* Filter bars: keep the submit/reset pair together on one line. */
.toolbar-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* ----------------------------------------------------------------- forms */
/* Standard form layout — see docs/REUSABLE.md. Every form uses .gig-form. */
.gig-form .form-label {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.gig-form .form-text { font-size: 0.75rem; }

.gig-form .required::after {
    content: " *";
    color: var(--bs-danger);
}

.form-card { max-width: 720px; }
.form-card-narrow { max-width: 420px; }

/* Toasts — see docs/REUSABLE.md for the helper that renders these. */
.gig-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: min(22rem, calc(100vw - 2rem));
}

.gig-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 2rem .95rem .85rem;
    background: var(--bs-body-bg, #fff);
    border-left: 5px solid var(--gig-toast-color);
    border-radius: .4rem;
    box-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .16);
    overflow: hidden;
    opacity: 1;
    animation: gig-toast-in .25s ease-out;
}

.gig-toast-leaving {
    animation: gig-toast-out .25s ease-in forwards;
}

.gig-toast-icon {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--gig-toast-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
}

.gig-toast-body {
    min-width: 0;
}

.gig-toast-title {
    color: var(--gig-toast-color);
    font-weight: 700;
    font-size: .92rem;
    line-height: 1.2;
}

.gig-toast-text {
    font-size: .84rem;
    color: var(--bs-secondary-color, #565e6c);
    margin-top: .1rem;
    overflow-wrap: anywhere;
}

.gig-toast-close {
    position: absolute;
    top: .35rem;
    right: .45rem;
    border: 0;
    background: none;
    color: var(--bs-secondary-color, #8a919e);
    font-size: 1.1rem;
    line-height: 1;
    padding: .1rem .25rem;
    cursor: pointer;
}

.gig-toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--gig-toast-color);
    transform-origin: left;
    animation: gig-toast-bar 4.5s linear forwards;
}

.gig-toast-success { --gig-toast-color: #16a34a; }
.gig-toast-warning { --gig-toast-color: #e08e0b; }
.gig-toast-error   { --gig-toast-color: #e11d3a; }
.gig-toast-info    { --gig-toast-color: #2563eb; }

@keyframes gig-toast-in {
    from { transform: translateX(1.5rem); }
    to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gig-toast, .gig-toast-bar { animation: none; }
}

@keyframes gig-toast-out {
    to { opacity: 0; transform: translateX(1.5rem); }
}

.gig-toast-leaving { opacity: 0; }

@keyframes gig-toast-bar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: .15rem;
}

.star-input input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.star-input label {
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    color: #d5d9e0;
    transition: color .12s ease-in-out;
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
    color: #f5a623;
}

.star-input input:focus-visible ~ label {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.stars-read {
    color: #f5a623;
    letter-spacing: .05em;
    white-space: nowrap;
}

.stars-read .star-off { color: #d5d9e0; }

.image-upload { --image-ratio: 16 / 9; }
.image-upload-square { --image-ratio: 4 / 3; }
.image-upload-circle { --image-ratio: 1 / 1; }

.image-drop {
    position: relative;
    display: block;
    aspect-ratio: var(--image-ratio);
    max-width: 22rem;
    border: 1.5px dashed #c7cdd6;
    border-radius: .6rem;
    background: #f8f9fb;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s ease-in-out, background-color .15s ease-in-out;
}

.image-upload-circle .image-drop {
    border-radius: 50%;
    max-width: 9rem;
}

.image-drop:hover,
.image-drop:focus-visible {
    border-color: #0d6efd;
    background: #f2f6ff;
    outline: none;
}

.image-drop.is-dragging {
    border-color: #0d6efd;
    border-style: solid;
    background: #e9f1ff;
}

.image-drop.is-busy { opacity: .55; pointer-events: none; }

.image-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.image-thumb { position: absolute; inset: 0; pointer-events: none; }

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-clear {
    position: absolute;
    top: .35rem;
    right: .35rem;
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1;
    font-size: 1.1rem;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(17, 24, 39, .65);
    cursor: pointer;
    pointer-events: auto;
}

.image-clear:hover { background: rgba(220, 53, 69, .9); }

.image-prompt {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: .75rem;
    text-align: center;
    pointer-events: none;
}

.image-icon { font-size: 1.5rem; filter: grayscale(1); opacity: .55; }
.image-call { font-size: .82rem; color: #495057; }
.image-limits { font-size: .7rem; color: #8a94a3; }

.image-upload-circle .image-limits { display: none; }

.image-status.is-error { color: #dc3545; }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.catalog-tile {
    display: block;
    border: 1px solid #e6e9ef;
    border-radius: .7rem;
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease-in-out, box-shadow .12s ease-in-out, border-color .12s ease-in-out;
}

.catalog-tile:hover,
.catalog-tile:focus-visible {
    transform: translateY(-2px);
    border-color: #b9c6ff;
    box-shadow: 0 .4rem 1rem rgba(13, 110, 253, .1);
    color: inherit;
    outline: none;
}

.catalog-art {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #eef2ff, #e8f6f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.catalog-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.catalog-art .catalog-initial {
    font-size: 2rem;
    font-weight: 600;
    color: #8ea2c9;
}

.catalog-body { padding: .6rem .75rem .75rem; }
.catalog-name { font-weight: 600; font-size: .92rem; }
.catalog-meta { font-size: .74rem; color: #7a8496; }
.catalog-price { font-size: .74rem; color: #146c43; font-weight: 600; }

.match-list { max-height: 19rem; overflow-y: auto; }
.match-list .list-group-item { cursor: pointer; }
.match-list .list-group-item:has(input:checked) {
    background: #eef4ff;
    border-color: #b9c6ff;
}

.no-caret::after { display: none; }

.notification-menu { min-width: 22rem; max-width: 24rem; }

.notification-row {
    display: flex;
    gap: .6rem;
    padding: .55rem .75rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f2f5;
}

.notification-row:last-child { border-bottom: 0; }
.notification-row:hover { background: #f6f8fc; color: inherit; }
.notification-row.is-unread { background: #eef4ff; }
.notification-row.is-unread:hover { background: #e4edff; }

.notification-icon { font-size: 1rem; line-height: 1.3; }
.notification-text { display: flex; flex-direction: column; min-width: 0; }
.notification-title { font-size: .82rem; font-weight: 600; }
.notification-body {
    font-size: .76rem;
    color: #5b6472;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notification-age { font-size: .68rem; color: #939bab; margin-top: .1rem; }

.offer-card { border: 1.5px solid #0d6efd; background: #f2f6ff; }
.offer-countdown { font-variant-numeric: tabular-nums; font-weight: 600; }

.master-thumb {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: .3rem;
    border: 1px solid #e6e9ef;
    display: block;
}

.master-thumb-empty {
    width: 56px;
    height: 40px;
    border-radius: .3rem;
    border: 1px dashed #ccd2dc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .62rem;
    color: #9aa3b2;
}

.shop-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid #e9ecf2;
}

.shop-hero {
    background: linear-gradient(135deg, #eef2ff 0%, #e9f7f1 100%);
    border-radius: .9rem;
    padding: 2rem 1.5rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 1rem;
}

.shop-card {
    border: 1px solid #e6e9ef;
    border-radius: .7rem;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shop-card .catalog-art { aspect-ratio: 4 / 3; }

.shop-card-body {
    padding: .65rem .75rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
}

.shop-card-name { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.shop-card-desc {
    font-size: .74rem;
    color: #6b7484;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-card-price { font-weight: 700; font-size: .95rem; }
.shop-card-foot { margin-top: auto; display: flex; align-items: center; gap: .5rem; }

.cart-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e9ecf2;
    padding: .6rem .9rem;
    box-shadow: 0 -.3rem .8rem rgba(16, 24, 40, .06);
}

.cart-line { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid #f0f2f5; }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 76px; height: 58px; object-fit: cover; border-radius: .4rem; }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid #d6dbe4; border-radius: .35rem; }
.qty-stepper button {
    border: 0;
    background: transparent;
    width: 1.9rem;
    height: 1.9rem;
    line-height: 1;
    color: #0d6efd;
    font-weight: 600;
    cursor: pointer;
}
.qty-stepper button:disabled { color: #c2c8d2; cursor: default; }
.qty-stepper .qty-value { min-width: 1.9rem; text-align: center; font-size: .85rem; font-weight: 600; }

.shop-search { max-width: 26rem; flex: 1; }

.shop-section { margin-bottom: 2.25rem; }
.shop-section-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .85rem; }
.shop-section-head h2 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.shop-section-head .see-all { margin-left: auto; font-size: .82rem; text-decoration: none; }

/* A rail scrolls sideways on small screens instead of wrapping into a wall. */
.shop-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(178px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .4rem;
    scroll-snap-type: x mandatory;
}

.shop-rail > * { scroll-snap-align: start; }

@media (max-width: 767px) {
    .shop-rail { grid-auto-columns: 62vw; }
}

.spotlight-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .4rem;
}

.spotlight-card {
    position: relative;
    display: block;
    aspect-ratio: 16 / 7;
    border-radius: .7rem;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: #1f2937;
}

.spotlight-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.spotlight-body {
    position: absolute;
    inset: 0;
    padding: .9rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: .2rem;
    background: linear-gradient(to top, rgba(10, 14, 22, .82) 12%, rgba(10, 14, 22, .18) 62%, transparent);
}

.spotlight-title { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.spotlight-sub { font-size: .78rem; opacity: .9; }
.spotlight-cta {
    align-self: flex-start;
    margin-top: .4rem;
    background: #fff;
    color: #111827;
    border-radius: .3rem;
    padding: .18rem .6rem;
    font-size: .75rem;
    font-weight: 600;
}

.wide-banner {
    position: relative;
    display: block;
    border-radius: .8rem;
    overflow: hidden;
    aspect-ratio: 32 / 9;
    color: #fff;
    text-decoration: none;
    background: #111827;
}

.wide-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wide-banner-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .3rem;
    padding: 1.2rem 1.6rem;
    background: linear-gradient(to right, rgba(10, 14, 22, .85) 30%, rgba(10, 14, 22, .1) 75%);
    max-width: 34rem;
}

.hero-stats { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.hero-stat-value { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.hero-stat-label { font-size: .72rem; color: #6b7484; }
