/* ==========================================================================
   THN Pipeline Report Studio — theme layer on top of Bootstrap 5.3
   Palette from the THN logo and thehospitalitynetwork.com:
   blue #1878B8 → cyan #38B0D0, orange #E86018 → amber #F5A623, midnight navy #061E3B.
   (PowerPoint decks keep their own palettes — this file only styles the portal.)
   ========================================================================== */
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fira-sans/fira-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fira-sans/fira-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fira-sans/fira-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fira-sans/fira-sans-latin-700-normal.woff2") format("woff2"); }

:root {
    --thn-navy: #061E3B;
    --thn-navy-2: #0B2E57;
    --thn-blue: #1878B8;
    --thn-blue-rgb: 24, 120, 184;
    --thn-blue-dark: #12629A;
    --thn-blue-soft: #EAF4FB;
    --thn-blue-line: #A9D0EC;
    --thn-cyan: #38B0D0;
    --thn-link: #3F96EC;
    --thn-orange: #F2632C;
    --thn-orange-rgb: 242, 99, 44;
    --thn-orange-dark: #D9501C;
    --thn-amber: #F5A623;
    --thn-grad-blue: linear-gradient(90deg, #1070B8, #38B0D0);
    --thn-grad-orange: linear-gradient(90deg, #E86018, #F5A623);
    --thn-grad-brand: linear-gradient(90deg, #1070B8 0%, #38B0D0 48%, #F5A623 52%, #E86018 100%);
    --app-bg: #F4F7FB;

    --bs-primary: var(--thn-blue);
    --bs-primary-rgb: var(--thn-blue-rgb);
    --bs-primary-text-emphasis: #0B4A75;
    --bs-primary-bg-subtle: #DDEEF9;
    --bs-primary-border-subtle: var(--thn-blue-line);
    --bs-link-color: var(--thn-blue);
    --bs-link-color-rgb: var(--thn-blue-rgb);
    --bs-link-hover-color: var(--thn-blue-dark);
    --bs-link-hover-color-rgb: 18, 98, 154;
    --bs-body-bg: var(--app-bg);
    --bs-body-color: #1F2A3A;
    --bs-heading-color: var(--thn-navy);
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .9rem;
    --bs-font-sans-serif: "Fira Sans", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
body { font-feature-settings: "tnum" 1; }
.ls-1 { letter-spacing: .06em; }
.text-primary { color: var(--thn-blue) !important; }

/* Buttons — blue = standard, orange = the main action (like the website CTA) */
.btn { font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--thn-blue); --bs-btn-border-color: var(--thn-blue);
    --bs-btn-hover-bg: var(--thn-blue-dark); --bs-btn-hover-border-color: var(--thn-blue-dark);
    --bs-btn-active-bg: #0E5283; --bs-btn-active-border-color: #0E5283;
    --bs-btn-disabled-bg: #8DBBDB; --bs-btn-disabled-border-color: #8DBBDB;
    --bs-btn-focus-shadow-rgb: var(--thn-blue-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--thn-blue); --bs-btn-border-color: var(--thn-blue);
    --bs-btn-hover-bg: var(--thn-blue); --bs-btn-hover-border-color: var(--thn-blue);
    --bs-btn-active-bg: var(--thn-blue-dark); --bs-btn-active-border-color: var(--thn-blue-dark);
    --bs-btn-focus-shadow-rgb: var(--thn-blue-rgb);
}
.btn-success, .btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--thn-orange); --bs-btn-border-color: var(--thn-orange);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--thn-orange-dark); --bs-btn-hover-border-color: var(--thn-orange-dark);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #BF4515; --bs-btn-active-border-color: #BF4515;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #F6A485; --bs-btn-disabled-border-color: #F6A485;
    --bs-btn-focus-shadow-rgb: var(--thn-orange-rgb);
    box-shadow: 0 4px 14px rgba(var(--thn-orange-rgb), .28);
}
.btn-success:disabled, .btn-accent:disabled { box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: #8CC0E4; box-shadow: 0 0 0 .2rem rgba(var(--thn-blue-rgb), .2); }
.btn:focus-visible { box-shadow: 0 0 0 .2rem rgba(var(--thn-blue-rgb), .3); }
.form-check-input:checked { background-color: var(--thn-blue); border-color: var(--thn-blue); }
.text-bg-primary { background-color: var(--thn-blue) !important; }
.badge.text-bg-warning { background-color: #FDE7DC !important; color: #A63A10 !important; }

/* Navbar (white, like thehospitalitynetwork.com) / footer */
.app-navbar { background: #fff; padding: .65rem 0; border-bottom: 1px solid #E6ECF3; position: relative; box-shadow: 0 2px 10px rgba(6,30,59,.04); }
.app-navbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--thn-grad-brand); }
.app-navbar .navbar-brand { color: var(--thn-navy); margin-right: .5rem; min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; flex: none; }
.brand-divider { width: 1px; height: 30px; background: #D5DEE8; flex: none; }
.brand-name { color: var(--thn-navy); font-weight: 600; font-size: 1.05rem; letter-spacing: -.005em; }
.brand-name b { color: var(--thn-blue); font-weight: 700; }
.brand-sub { color: #6B7A8F; font-size: .72rem; margin-top: 3px; }
.app-badge { background: #FFF2EC; color: #C2470F; border: 1px solid #F9C7B2; font-weight: 500; }
#healthBadge { background: #F4F7FB; color: #44546A; border: 1px solid #DCE4EE !important; font-weight: 500; }
.app-footer { background: var(--thn-navy); color: rgba(255,255,255,.72); position: relative; }
.app-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--thn-grad-brand); }
.app-footer .text-body-tertiary { color: rgba(255,255,255,.55) !important; }
.app-footer .footer-logo { height: 22px; width: auto; vertical-align: -6px; margin-right: .55rem; background: #fff; border-radius: 6px; padding: 3px 6px; box-sizing: content-box; }
@media (max-width: 575.98px) { .brand-logo { height: 28px; } .brand-name { font-size: .95rem; } .brand-divider { height: 24px; } }

/* Cards */
.app-card { border-radius: var(--bs-border-radius-lg); }
.app-card.shadow-sm { box-shadow: 0 1px 2px rgba(6,30,59,.04), 0 4px 16px rgba(6,30,59,.06) !important; }

/* Stepper */
.app-stepper { align-items: center; }
.app-step { display: flex; align-items: center; gap: .55rem; color: #94A3B8; font-weight: 500; font-size: .9rem; }
.app-step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #CBD5E1;
    background: #fff; font-weight: 700; font-size: .85rem; transition: all .2s; }
.app-step-num .check { display: none; }
.app-step.active { color: var(--thn-navy); }
.app-step.active .app-step-num { border-color: transparent; background: linear-gradient(135deg, #1070B8, #38B0D0); color: #fff; box-shadow: 0 0 0 5px rgba(var(--thn-blue-rgb), .15); }
.app-step.done { color: var(--thn-blue); }
.app-step.done .app-step-num { border-color: var(--thn-blue); color: var(--thn-blue); }
.app-step.done .app-step-num .num { display: none; }
.app-step.done .app-step-num .check { display: inline; }
.app-step-line { width: 64px; height: 3px; background: #D5DEE8; border-radius: 3px; }
.app-step.done + .app-step-line { background: var(--thn-grad-blue); }

/* Drop zone */
.dropzone { border: 2px dashed #B8C4D6; background: linear-gradient(180deg, #FAFBFD, #F4F7FB); cursor: pointer; transition: all .2s; }
.dropzone:hover, .dropzone:focus, .dropzone.dragover { border-color: var(--thn-blue); background: var(--thn-blue-soft); outline: none; }
.dropzone.dragover { transform: scale(1.01); }
.dropzone-icon { width: 76px; height: 76px; border-radius: 20px; display: inline-grid; place-items: center; font-size: 2.2rem;
    color: #fff; background: linear-gradient(135deg, #1070B8, #38B0D0); box-shadow: 0 8px 22px rgba(var(--thn-blue-rgb), .3); }
.feature { display: flex; align-items: center; justify-content: center; gap: .6rem; text-align: left; color: #334155; }
.feature > i { font-size: 1.35rem; color: var(--thn-blue); }

/* KPI cards */
.kpi-card { border-radius: var(--bs-border-radius-lg); background: #fff; padding: 1rem 1.1rem; height: 100%;
    box-shadow: 0 1px 2px rgba(6,30,59,.04), 0 4px 16px rgba(6,30,59,.06); position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--kpi-accent, var(--thn-blue)); }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 1rem;
    color: var(--kpi-accent, var(--thn-blue)); background: color-mix(in srgb, var(--kpi-accent, #1878B8) 12%, transparent); }
.kpi-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; color: var(--thn-navy); line-height: 1.15; }
.kpi-label { font-size: .75rem; color: #64748B; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* Template cards */
.template-card { cursor: pointer; border: 2px solid #E2E8F0; border-radius: var(--bs-border-radius-lg); overflow: hidden;
    transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.template-card:hover { border-color: var(--thn-blue-line); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(6,30,59,.08); }
.btn-check:checked + .template-card { border-color: var(--thn-blue); box-shadow: 0 0 0 4px rgba(var(--thn-blue-rgb), .14); }
.btn-check:focus-visible + .template-card { box-shadow: 0 0 0 4px rgba(var(--thn-blue-rgb), .3); }
.template-check { position: absolute; top: .6rem; right: .7rem; font-size: 1.35rem; color: #fff; opacity: 0; transition: opacity .15s;
    text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.btn-check:checked + .template-card .template-check { opacity: 1; }
.template-thumb { height: 108px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 1.1rem;
    color: #fff; font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.template-thumb span { display: inline-block; width: fit-content; padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,.14); }
.thumb-brief { background: linear-gradient(135deg, #061E3B 0%, #0F4F8A 55%, #1878B8 100%); }
.thumb-overview { background: linear-gradient(135deg, #061E3B 0%, #1878B8 50%, #E86018 100%); }

/* Version cards */
.version-wrap { animation: fadeIn .2s ease; }
.version-card { display: block; cursor: pointer; border: 2px solid #E2E8F0; border-radius: .7rem; padding: .7rem .8rem; background: #fff;
    transition: all .15s; height: 100%; }
.version-card:hover { border-color: var(--thn-blue-line); }
.btn-check:checked + .version-card { border-color: var(--thn-blue); background: var(--thn-blue-soft); box-shadow: 0 0 0 3px rgba(var(--thn-blue-rgb), .12); }
.version-desc { font-size: .72rem; }
.swatch { display: block; height: 26px; border-radius: 6px; margin-bottom: .5rem; border: 1px solid rgba(0,0,0,.06); }
.swatch-v1 { background: linear-gradient(90deg, #fff 0 55%, #1B6B3A 55% 70%, #F5B041 70% 85%, #C0392B 85%); }
.swatch-v2 { background: linear-gradient(90deg, #1E293B 0 60%, #0D9B9B 60% 80%, #F5B041 80%); }
.swatch-v3 { background: linear-gradient(90deg, #FAF8F5 0 45%, #1B2A4A 45% 72%, #B87333 72%); }
.swatch-v4 { background: linear-gradient(90deg, #fff 0 50%, #0D7377 50% 63%, #C0392B 63% 76%, #1B3A5C 76% 89%, #D4A853 89%); }

/* Countries table */
.country-scroll { max-height: 470px; overflow-y: auto; }
.country-scroll thead th { background: #fff; color: #64748B; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.slides-pill { font-size: .7rem; font-weight: 600; }

.action-bar { padding: .9rem 0; }
@media (min-width: 992px) {
    .action-bar { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(243,245,249,0), var(--app-bg) 35%); z-index: 5; }
}

/* Slide viewer */
.slide-viewer { background: #061E3B; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.slide-image { width: 100%; height: 100%; object-fit: contain; transition: opacity .2s; }
.slide-image.loading { opacity: .35; }
.slide-loading { position: absolute; inset: 0; display: none; place-items: center; }
.slide-viewer.is-loading .slide-loading { display: grid; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
    background: rgba(6,30,59,.55); color: #fff; border: 1px solid rgba(255,255,255,.2); display: grid; place-items: center; padding: 0;
    backdrop-filter: blur(4px); }
.slide-nav:hover { background: var(--thn-blue); color: #fff; }
.slide-nav:disabled { opacity: .25; }
.slide-nav.prev { left: 14px; } .slide-nav.next { right: 14px; }
.no-preview { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: rgba(255,255,255,.85); text-align: center; padding: 2rem; }

.thumb-strip { display: flex; gap: .6rem; overflow-x: auto; padding: .8rem 1rem; background: #F8FAFC; scroll-behavior: smooth; }
.thumb { flex: 0 0 auto; width: 128px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; cursor: pointer; position: relative;
    background: #E2E8F0; aspect-ratio: 16 / 9; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .thumb-num { position: absolute; bottom: 3px; right: 4px; font-size: .65rem; font-weight: 700; color: #fff; background: rgba(6,30,59,.7);
    border-radius: 4px; padding: 0 5px; }
.thumb:hover { border-color: var(--thn-blue-line); }
.thumb.active { border-color: var(--thn-blue); box-shadow: 0 0 0 2px rgba(var(--thn-blue-rgb), .25); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.wizard-step { animation: fadeIn .25s ease; }

@media (max-width: 575.98px) {
    .kpi-value { font-size: 1.25rem; }
    .thumb { width: 96px; }
    .slide-nav { width: 36px; height: 36px; }
    .action-bar .btn-lg { --bs-btn-padding-x: 1rem; --bs-btn-font-size: 1.05rem; }
}

/* Signed-in user menu (white navbar) */
.user-btn { color: var(--thn-navy); border: 1px solid #D5DEE8; border-radius: 999px; padding: .2rem .7rem .2rem .25rem; background: #fff; font-weight: 500; }
.user-btn:hover, .user-btn:focus, .user-btn.show { color: var(--thn-navy); background: var(--thn-blue-soft); border-color: var(--thn-blue-line); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, #1070B8, #38B0D0); color: #fff; font-weight: 700; font-size: .8rem; }
.dropdown-item:active { background-color: var(--thn-blue); }

/* Admin · users */
.users-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 600; background: #f8fafc; }
.users-table td, .users-table th { padding: .85rem 1rem; }
.users-table .user-avatar.is-admin { background: linear-gradient(135deg, #E86018, #F5A623); color: #fff; }
.min-w-0 { min-width: 0; }
.temp-pw-card { background: #f0fdf4; }
.temp-pw { font-size: 1.15rem; padding: .35rem .7rem; background: #fff; border: 1px dashed #86efac; border-radius: .5rem; color: #14532d; letter-spacing: .04em; user-select: all; }
@media (max-width: 575.98px) { .users-table td, .users-table th { padding: .7rem .6rem; } .users-table .user-avatar { display: none; } }
