/* ==========================================================================
   JUMBO TEMPLATE - CORE DESIGN SYSTEM & LAYOUT SHELL
   ========================================================================== */

:root {
    --jb-bg: #ffffff;
    --jb-surface: #f9fafb;
    --jb-border: #e5e7eb;
    --jb-border-focus: #111827;
    --jb-text-main: #111827;
    --jb-text-muted: #6b7280;
    --jb-primary: #111827;
    --jb-primary-hover: #000000;
    --jb-primary-text: #ffffff;
    --jb-danger: #ef4444;
    --jb-warning: #f59e0b;
    --jb-header-h: 68px;
    --jb-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: var(--jb-font);
    font-size: 16.5px;
    background-color: var(--jb-bg);
    color: var(--jb-text-main);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Master Layout Shell (Zero Wrapper Divs) */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}

body:has(> .app-header) > main,
body:has(> header) > main {
    padding-top: calc(var(--jb-header-h) + 1.25rem);
}

/* Shell Top Brand Bar */
.jumbo-topbar {
    background: var(--jb-bg);
    border-top: 4px solid var(--jb-primary);
    border-bottom: 1px solid var(--jb-border);
}

body:has(> .jumbo-topbar) > main {
    padding-top: 1.5rem;
}

.jumbo-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
    font-weight: 800;
    font-size: 1.08rem;
    color: var(--jb-text-main);
}

.jumbo-brand > img {
    height: 54px;
    width: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 600px) {
    .jumbo-brand {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        font-size: 0.95rem;
    }

    .jumbo-brand > img {
        height: 42px;
    }
}

/* ==========================================================================
   CONTENT HEADER (CANONICAL PAGE HEADER)
   Component pattern: .content-header (with .actions and > nav)
   ========================================================================== */
.content-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    row-gap: 0.25rem;
    column-gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--jb-border);
}

.content-header > h1 {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--jb-text-main);
    letter-spacing: -0.025em;
    margin: 0;
    line-height: 1.25;
}

.content-header > p {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.95rem;
    color: var(--jb-text-muted);
    margin: 0;
    line-height: 1.4;
}

.content-header > .actions,
.content-header > :not(h1):not(p):not(nav) {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: end;
}

/* Header with Integrated Navigation Tabs */
.content-header:has(> nav) {
    padding-bottom: 0;
}

.content-header > nav {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-top: 1rem;
    margin-bottom: -1px;
    overflow-x: auto;
}

.content-header > nav > a {
    padding: 0.75rem 0.25rem;
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--jb-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.content-header > nav > a:hover {
    color: var(--jb-text-main);
}

.content-header > nav > a.is-active,
.content-header > nav > a[aria-current="page"] {
    color: var(--jb-text-main);
    border-bottom-color: var(--jb-primary);
}

.content-header > nav > a > span {
    background: var(--jb-surface);
    border: 1px solid var(--jb-border);
    border-radius: 9999px;
    font-size: 0.75rem;
    padding: 1px 7px;
    color: var(--jb-text-muted);
}

.content-header > nav > a.is-active > span,
.content-header > nav > a[aria-current="page"] > span {
    background: var(--jb-primary);
    color: #ffffff;
    border-color: var(--jb-primary);
}

@media (max-width: 768px) {
    .content-header {
        grid-template-columns: 1fr;
        row-gap: 0.25rem;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .content-header:has(> nav) {
        padding-bottom: 0;
    }

    .content-header > h1 {
        font-size: 1.45rem;
    }

    .content-header > p {
        font-size: 0.85rem;
        line-height: 1.35;
    }

    .content-header > .actions,
    .content-header > :not(h1):not(p):not(nav) {
        grid-column: 1;
        grid-row: 3;
        margin-top: 0.75rem;
        justify-self: start;
    }

    .content-header > nav {
        grid-column: 1;
        grid-row: 4;
        margin-top: 0.75rem;
        gap: 1.25rem;
    }
}

/* ==========================================================================
   SHARED DESIGN PATTERNS & FOUNDATIONS
   ========================================================================== */

/* 1. White interactive containers with 2px solid border */
.field input,
.field select,
.field textarea,
.counter input,
.counter .counter-btn,
.option-card,
.btn-outline {
    border: 2px solid var(--jb-border);
    background-color: #ffffff;
    color: var(--jb-text-main);
}

/* 2. Light surface panels with 1px border */
.review-card,
.file-card,
.gallery-item {
    background: var(--jb-surface);
    border: 1px solid var(--jb-border);
}

/* 3. Centered flex layout */
.counter,
.counter .counter-btn,
.option-card,
.gallery-item .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Space-between flex rows */
.review-item,
.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 5. Smooth micro-transitions */
.counter .counter-btn,
.option-card,
.upload-box,
.btn-outline {
    transition: all 0.2s ease;
}

/* 6. Standard interactive hover state */
.counter .counter-btn:hover,
.btn-outline:hover {
    border-color: var(--jb-border-focus);
    background: var(--jb-surface);
}

/* 7. Rounded pill elements */
.counter input,
.btn-outline {
    border-radius: 50px;
}

/* 8. Circular elements */
.counter .counter-btn,
.gallery-item .remove-btn {
    border-radius: 50%;
    cursor: pointer;
}

/* 9. Unstyled form inputs */
.field input,
.field select,
.field textarea,
.counter input {
    outline: none;
    font-family: inherit;
}

/* ==========================================================================
   INPUTS & FLOATING LABELS
   ========================================================================== */
.field {
    position: relative;
    width: 100%;
    margin-bottom: 1.85rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 20px 22px;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--jb-border-focus);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.06);
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--jb-danger);
}

.field input.is-invalid:focus,
.field select.is-invalid:focus,
.field textarea.is-invalid:focus,
input.is-invalid:focus,
select.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: var(--jb-danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.field label {
    position: absolute;
    left: 20px;
    top: 22px;
    color: var(--jb-text-muted);
    font-size: 1.2rem;
    pointer-events: none;
    background: #ffffff;
    padding: 0 8px;
    transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1) all;
}

.field input:focus + label,
.field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label,
.field select:valid + label {
    top: -12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--jb-text-main);
}

.field.has-prefix .prefix {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--jb-text-muted);
}

.field.has-prefix input {
    padding-left: 48px;
}

.field .hint {
    display: block;
    margin-top: 6px;
    padding-left: 8px;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--jb-text-muted);
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.field input:focus ~ .hint,
.field textarea:focus ~ .hint,
.field select:focus ~ .hint {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   NUMERIC COUNTERS
   ========================================================================== */
.counters-group {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.5rem 0 2rem;
}

.counter-col {
    flex: 1 1 200px;
    max-width: 280px;
    text-align: center;
}

.counter-col label {
    display: block;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--jb-text-main);
}

.counter {
    gap: 1.25rem;
}

.counter .counter-btn {
    display: inline-flex;
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
    font-weight: bold;
    user-select: none;
    flex-shrink: 0;
}

.counter input {
    width: 100px;
    text-align: center;
    font-size: 1.9rem;
    font-weight: 800;
    padding: 10px;
}

@media (max-width: 576px) {
    .counters-group {
        gap: 1.25rem;
    }
    .counter-col {
        flex: 1 1 140px;
        max-width: 170px;
    }
    .counter {
        gap: 0.6rem;
    }
    .counter .counter-btn {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
    }
    .counter input {
        width: 68px;
        font-size: 1.45rem;
        padding: 6px;
    }
}

/* ==========================================================================
   SELECTION TILES / OPTION CARDS
   ========================================================================== */
.grid-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 576px) {
    .grid-options {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

.option-card {
    padding: 22px 18px;
    border-radius: 18px;
    text-align: center;
    flex-direction: column;
    gap: 10px;
}

.option-card i {
    font-size: 2.25rem;
    color: var(--jb-text-muted);
    transition: color 0.2s;
}

.option-card span {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--jb-text-main);
}

.option-card:hover {
    border-color: var(--jb-text-muted);
}

.option-card.active {
    border-color: var(--jb-primary);
    background: var(--jb-primary);
}

.option-card.active i,
.option-card.active span {
    color: #ffffff;
}

/* ==========================================================================
   REVIEW / SUMMARY CARDS
   ========================================================================== */
.review-card {
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.review-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--jb-border);
}

.review-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-label {
    font-size: 0.95rem;
    color: var(--jb-text-muted);
    font-weight: 500;
}

.review-value {
    font-size: 1.05rem;
    color: var(--jb-text-main);
    font-weight: 700;
    text-align: right;
}

/* ==========================================================================
   FILE UPLOAD & DOCUMENT CARDS
   ========================================================================== */
.upload-box {
    border: 2px dashed var(--jb-border);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--jb-surface);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-box.dragover, .upload-box:hover {
    border-color: var(--jb-border-focus);
    background: #ffffff;
}

.upload-box i {
    font-size: 2.5rem;
    color: var(--jb-text-muted);
}

.upload-box p {
    font-size: 1rem;
    color: var(--jb-text-muted);
    margin: 0;
}

.file-card {
    padding: 1rem 1.25rem;
    border-radius: 14px;
    margin-top: 1rem;
}

.file-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
}

.file-card-info i {
    font-size: 1.75rem;
    color: var(--jb-primary);
}

.file-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--jb-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.file-size {
    font-size: 0.85rem;
    color: var(--jb-text-muted);
}

/* ==========================================================================
   GALLERY GRID & MEDIA CARDS
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(17, 24, 39, 0.75);
    color: #ffffff;
    border: none;
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    transition: background 0.2s ease;
}

.gallery-item .remove-btn:hover {
    background: var(--jb-danger);
}

/* ==========================================================================
   BUTTON PRIMITIVES (PRIMARY & OUTLINE)
   ========================================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: var(--jb-primary);
    color: var(--jb-primary-text);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 22px;
    border-radius: 14px;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--jb-primary-hover);
    color: var(--jb-primary-text);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
}

/* ==========================================================================
   METRICS & QUICK STATS CARDS
   ========================================================================== */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--jb-bg);
    border: 1.5px solid var(--jb-border);
    border-radius: 16px;
    padding: 1.15rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--jb-surface);
    color: var(--jb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.metric-icon.is-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.metric-icon.is-success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.metric-icon.is-danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.metric-info .metric-num {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--jb-text-main);
    line-height: 1.1;
}

.metric-info .metric-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--jb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

/* ==========================================================================
   TOOLBAR & SEARCH CONTROLS
   ========================================================================== */
.toolbar {
    background: var(--jb-bg);
    border: 1px solid var(--jb-border);
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--jb-text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    border: 1.5px solid var(--jb-border);
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--jb-text-main);
    background-color: var(--jb-surface);
    transition: all 0.2s ease;
    outline: none;
}

.search-box input:focus {
    background-color: var(--jb-bg);
    border-color: var(--jb-border-focus);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ==========================================================================
   DATA TABLE SURFACE
   ========================================================================== */
.table-card {
    background: var(--jb-bg);
    border: 1px solid var(--jb-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table thead {
    background: var(--jb-surface);
    border-bottom: 1px solid var(--jb-border);
}

.table th {
    padding: 0.9rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--jb-text-muted);
    white-space: nowrap;
}

.table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--jb-border);
    vertical-align: middle;
    color: var(--jb-text-main);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--jb-surface);
}

.table-empty-cell {
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--jb-text-muted);
}

.table-empty-cell i {
    font-size: 2.5rem;
    color: var(--jb-border);
    margin-bottom: 0.75rem;
}

.table-empty-cell p {
    font-size: 0.95rem;
    margin: 0;
}

/* ==========================================================================
   EMPTY & LOADING STATES
   ========================================================================== */
.empty-state {
    background: var(--jb-bg);
    border: 2px dashed var(--jb-border);
    border-radius: 24px;
    padding: 4.5rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 2rem auto;
}

.empty-state-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--jb-surface);
    color: var(--jb-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    margin-bottom: 1.25rem;
}

.empty-state h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--jb-text-main);
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    font-size: 1rem;
    color: var(--jb-text-muted);
    line-height: 1.5;
    margin: 0 0 1.75rem 0;
}

.loading-state {
    text-align: center;
    padding: 4.5rem 1rem;
    color: var(--jb-text-muted);
}

.loading-state i {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--jb-primary);
}

.loading-state p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}


