:root {
    --brand: #117ab2;
    --brand-dark: #0a5680;
    --brand-deep: #083b59;
    --brand-soft: #eaf6fc;
    --gold: #fca802;
    --gold-soft: #fff3cf;
    --ink: #102333;
    --muted: #627486;
    --line: rgba(16, 35, 51, 0.1);
    --paper: #ffffff;
    --cream: #f6f9fc;
    --success: #0f9f6e;
    --danger: #b42318;
    --radius: 22px;
    --shadow-app: 0 24px 70px rgba(16, 35, 51, 0.14);
    --shadow-card: 0 14px 34px rgba(16, 35, 51, 0.08);
    --shadow-blue: 0 16px 38px rgba(17, 122, 178, 0.22);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 10% -5%, rgba(252, 168, 2, 0.22), transparent 24rem),
        radial-gradient(circle at 92% 0%, rgba(17, 122, 178, 0.2), transparent 30rem),
        linear-gradient(180deg, #f8fbff 0%, #edf6fc 48%, #f7fafc 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Local utility layer used by the PHP templates. This replaces Tailwind CDN for production/PWA use. */
.min-h-screen { min-height: 100vh; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-6xl { max-width: 72rem; }
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1 1 0%; }
.block { display: block; }
.hidden { display: none; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shrink-0 { flex-shrink: 0; }
.relative { position: relative; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }
.z-\[1\] { z-index: 1; }
.overflow-x-auto { overflow-x: auto; }
.backdrop-blur { backdrop-filter: blur(18px); }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-1 { margin-left: 0.25rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 999px; }
.border { border: 1px solid var(--line); }
.border-b { border-bottom: 1px solid var(--line); }
.border-t { border-top: 1px solid var(--line); }
.border-slate-300 { border-color: rgba(100, 116, 139, 0.35) !important; }
.border-slate-900\/10 { border-color: rgba(15, 23, 42, 0.1) !important; }
.border-red-200 { border-color: #fecaca !important; }
.border-sky-200 { border-color: #bae6fd !important; }
.bg-white { background: #fff; }
.bg-white\/10 { background: rgba(255, 255, 255, 0.1); }
.bg-white\/95 { background: rgba(255, 255, 255, 0.95); }
.bg-cream { background: var(--cream); }
.bg-brand { background: var(--brand) !important; }
.bg-sky-50 { background: #f0f9ff; }
.bg-sky-100 { background: #e0f2fe; }
.bg-blue-50 { background: #eff6ff; }
.bg-blue-100 { background: #dbeafe; }
.bg-amber-50 { background: #fffbeb; }
.bg-amber-100 { background: #fef3c7; }
.bg-slate-100 { background: #f1f5f9; }
.bg-red-50 { background: #fef2f2; }
.text-center { text-align: center; }
.text-white { color: #fff !important; }
.text-ink { color: var(--ink); }
.text-brand { color: var(--brand) !important; }
.text-sky-50 { color: #f0f9ff; }
.text-sky-100 { color: #e0f2fe; }
.text-sky-700 { color: #0369a1; }
.text-sky-800 { color: #075985; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-red-700 { color: #b91c1c; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }
.leading-5 { line-height: 1.25rem; }
.leading-6 { line-height: 1.5rem; }
.leading-tight { line-height: 1.08; }
.shadow-app { box-shadow: var(--shadow-app); }
.shadow-lg { box-shadow: 0 10px 24px rgba(16, 35, 51, 0.12); }
.shadow-sm { box-shadow: 0 5px 14px rgba(16, 35, 51, 0.08); }
.outline-none { outline: none; }
.opacity-75 { opacity: 0.75; }

/* App shell */
.app-shell {
    border: 1px solid rgba(16, 35, 51, 0.08);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
}

.app-header {
    box-shadow: 0 1px 0 rgba(16, 35, 51, 0.06);
}

.app-header-row,
.brand-link,
.header-actions {
    display: flex;
    align-items: center;
}

.app-header-row {
    justify-content: space-between;
    gap: 0.75rem;
}

.brand-link {
    gap: 0.65rem;
}

.brand-mark {
    box-shadow: 0 10px 24px rgba(17, 122, 178, 0.2);
}

.brand-title {
    letter-spacing: -0.02em;
}

.header-actions {
    gap: 0.5rem;
}

.logout-btn {
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(16, 35, 51, 0.16);
}

.app-main {
    min-height: calc(100vh - 68px);
    background:
        linear-gradient(180deg, rgba(246, 249, 252, 0.96), rgba(255, 255, 255, 0) 300px),
        var(--paper);
}

.has-bottom-nav .app-main {
    padding-bottom: 7.5rem;
}

/* Product surfaces */
.hero-card,
.staff-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    background:
        radial-gradient(circle at 88% 8%, rgba(252, 168, 2, 0.9), transparent 7rem),
        linear-gradient(142deg, #117ab2 0%, #0a5680 50%, #102333 100%);
    box-shadow: var(--shadow-blue);
}

.hero-card::after,
.staff-hero::after {
    content: "";
    position: absolute;
    right: -72px;
    bottom: -86px;
    width: 190px;
    height: 190px;
    border: 34px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.hero-card > *,
.staff-hero > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.panel,
.surface-card,
.metric-card,
.panel-muted {
    border: 1px solid rgba(16, 35, 51, 0.09);
    border-radius: var(--radius);
}

.panel {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-card);
}

.surface-card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 38px rgba(16, 35, 51, 0.08);
}

.metric-card {
    box-shadow: var(--shadow-card);
}

.panel-muted {
    background: linear-gradient(135deg, #fff8e8, #edf7fd);
}

.card-list > * {
    border-color: var(--line) !important;
    box-shadow: var(--shadow-card);
}

/* Forms */
label span {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(16, 35, 51, 0.14);
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.focus\:border-brand:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 4px rgba(17, 122, 178, 0.13);
}

button,
.btn-primary,
.btn-secondary {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:active,
.btn-primary:active,
.btn-secondary:active {
    transform: translateY(1px);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark)) !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 32px rgba(17, 122, 178, 0.26);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1689c8, var(--brand-dark)) !important;
    box-shadow: 0 16px 38px rgba(17, 122, 178, 0.32);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(17, 122, 178, 0.14);
    border-radius: 18px;
    background: #fff;
    color: var(--brand) !important;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(16, 35, 51, 0.06);
}

/* Navigation */
.app-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 0 -0.25rem 1.5rem;
    overflow-x: auto;
    padding: 0 0.25rem 0.6rem;
}

.nav-chip {
    flex: 0 0 auto;
    border: 1px solid rgba(17, 122, 178, 0.15);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    padding: 0.58rem 1rem;
    font-size: 0.875rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(16, 35, 51, 0.06);
}

.nav-chip:hover,
.nav-chip-active {
    background: var(--brand);
    color: #fff;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 40;
    display: flex;
    gap: 0.35rem;
    width: min(calc(100vw - 24px), 560px);
    transform: translateX(-50%);
    overflow-x: auto;
    border: 1px solid rgba(16, 35, 51, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.45rem;
    box-shadow: 0 18px 45px rgba(16, 35, 51, 0.18);
    backdrop-filter: blur(18px);
}

.bottom-nav-item {
    display: flex;
    min-width: 78px;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 18px;
    color: var(--muted);
    padding: 0.45rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.bottom-nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(98, 116, 134, 0.38);
}

.bottom-nav-active {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.bottom-nav-active .bottom-nav-dot {
    background: var(--gold);
}

/* Badges and chips */
.gold-pill {
    background: rgba(252, 168, 2, 0.16);
    color: #835700;
}

.category-badge {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid rgba(17, 122, 178, 0.12);
}

/* Login and offline screens */
.login-layout {
    display: grid;
    gap: 1.125rem;
}

.login-brand-card {
    min-height: 320px;
}

.feature-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.feature-dot {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(252, 168, 2, 0.16);
    color: #8a5c00;
    font-weight: 900;
}

.offline-screen {
    display: grid;
    min-height: 100vh;
    place-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.offline-screen h1 {
    margin: 0;
    font-size: 2rem;
}

.offline-screen p {
    max-width: 420px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.6;
}

.offline-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 22px;
    box-shadow: var(--shadow-blue);
}

.offline-btn {
    margin: 0.75rem auto 0;
    padding: 0.9rem 1.4rem;
}

@media (min-width: 640px) {
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:inline { display: inline; }
}

@media (min-width: 768px) {
    .md\:my-5 { margin-top: 1.25rem; margin-bottom: 1.25rem; }
    .md\:p-6 { padding: 1.5rem; }
    .md\:p-8 { padding: 2rem; }
    .md\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .md\:py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    .md\:rounded-\[1\.75rem\] { border-radius: 1.75rem; }
    .md\:rounded-t-\[1\.75rem\] { border-top-left-radius: 1.75rem; border-top-right-radius: 1.75rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .app-shell {
        min-height: calc(100vh - 40px);
        border-radius: 1.75rem;
    }
    .app-header {
        border-top-left-radius: 1.75rem;
        border-top-right-radius: 1.75rem;
    }
    .bottom-nav { display: none; }
    .has-bottom-nav .app-main { padding-bottom: 1.5rem; }
    .staff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem; }
    .login-layout { grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.8fr); align-items: stretch; }
}
