/* =====================================================================
   Staff Portal UI (batch 26)
   Green + white, frosted glass and "water" surfaces, light and dark.
   Loaded after the compiled Tailwind file and staff-theme-gen.css, so
   everything here wins without rebuilding the CSS bundle.
   ===================================================================== */

@font-face {
    font-family: 'Manrope';
    src: url('../fonts/manrope-latin-wght-normal.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --st-leaf: #138a52;
    --st-leaf-2: #0f7044;
    --st-canopy: #0c3a27;
    --st-lagoon: #12a594;
    --st-mint: #effcf4;
    --st-mint-2: #d7f7e5;
    --st-paper: #ffffff;
    --st-ink: #10251b;
    --st-ink-2: #3d5247;
    --st-muted: #6b7f74;
    --st-line: rgba(15, 112, 68, 0.12);
    --st-glass: rgba(255, 255, 255, 0.66);
    --st-glass-strong: rgba(255, 255, 255, 0.86);
    --st-glass-card: rgba(255, 255, 255, 0.74);
    --st-glass-line: rgba(255, 255, 255, 0.75);
    --st-shadow: 0 1px 2px rgba(12, 58, 39, 0.05), 0 10px 30px -12px rgba(12, 58, 39, 0.18);
    --st-shadow-lg: 0 24px 60px -20px rgba(12, 58, 39, 0.35);
    --st-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.55) 45%, rgba(236, 253, 245, 0.55) 100%);
    --st-page: #f3faf6;
    --st-radius: 18px;
    --st-radius-sm: 12px;
    --st-focus: 0 0 0 3px rgba(31, 168, 101, 0.28);
    color-scheme: light;
}

html.dark {
    --st-leaf: #34c27d;
    --st-leaf-2: #1fa865;
    --st-canopy: #e6f4ec;
    --st-lagoon: #2cc2ae;
    --st-mint: #10241a;
    --st-mint-2: #173426;
    --st-paper: #0c1912;
    --st-ink: #e8f2ec;
    --st-ink-2: #b9cbc0;
    --st-muted: #8aa294;
    --st-line: rgba(255, 255, 255, 0.08);
    --st-glass: rgba(15, 33, 24, 0.62);
    --st-glass-strong: rgba(13, 28, 20, 0.92);
    --st-glass-card: rgba(16, 34, 25, 0.78);
    --st-glass-line: rgba(255, 255, 255, 0.08);
    --st-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
    --st-shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
    --st-sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(52, 194, 125, 0.05) 100%);
    --st-page: #07120c;
    --st-focus: 0 0 0 3px rgba(52, 194, 125, 0.35);
    color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
.st-body, .admin-scope, .worker-scope {
    font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-feature-settings: 'tnum' 1, 'cv11' 1;
    color: var(--st-ink);
    background: var(--st-page) !important;
    letter-spacing: -0.005em;
}
.admin-scope h1, .admin-scope h2, .admin-scope h3, .worker-scope h1, .worker-scope h2, .worker-scope h3 { letter-spacing: -0.02em; }
html.dark body { background: var(--st-page) !important; }

/* The "water" backdrop: two slow caustic pools behind every page. */
.st-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(18, 165, 148, 0.16), transparent 60%),
        radial-gradient(900px 520px at -10% 110%, rgba(31, 168, 101, 0.16), transparent 60%),
        var(--st-page);
}
.st-bg::before, .st-bg::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.st-bg::before { width: 420px; height: 420px; top: 12%; left: 58%; background: radial-gradient(circle at 30% 30%, rgba(125, 220, 170, 0.55), rgba(125, 220, 170, 0) 70%); }
.st-bg::after { width: 360px; height: 360px; bottom: 6%; left: 18%; background: radial-gradient(circle at 60% 40%, rgba(95, 220, 200, 0.4), rgba(95, 220, 200, 0) 70%); }
html.dark .st-bg::before { opacity: .22; }
html.dark .st-bg::after { opacity: .18; }

/* ---------------------------------------------------------------- glass surfaces */
.st-glass,
.admin-card, .admin-stat-card, .admin-stat-card-compact, .dashboard-chart-card,
.w-card, .worker-stat-card,
.admin-scope main .bg-white.rounded-xl, .admin-scope main .bg-white.rounded-2xl, .admin-scope main .bg-white.rounded-lg,
.worker-scope main .bg-white.rounded-xl, .worker-scope main .bg-white.rounded-2xl, .worker-scope main .bg-white.rounded-lg {
    /* No backdrop-filter here on purpose: it would trap pop-up windows
       (position: fixed) that live inside cards. The sheen gives the glass look. */
    background: var(--st-sheen), var(--st-glass-card) !important;
    border: 1px solid var(--st-glass-line) !important;
    box-shadow: var(--st-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
    border-radius: var(--st-radius) !important;
}
html.dark .st-glass, html.dark .admin-card, html.dark .admin-stat-card, html.dark .admin-stat-card-compact, html.dark .dashboard-chart-card,
html.dark .w-card, html.dark .worker-stat-card,
html.dark .admin-scope main .bg-white.rounded-xl, html.dark .admin-scope main .bg-white.rounded-2xl, html.dark .admin-scope main .bg-white.rounded-lg,
html.dark .worker-scope main .bg-white.rounded-xl, html.dark .worker-scope main .bg-white.rounded-2xl, html.dark .worker-scope main .bg-white.rounded-lg {
    box-shadow: var(--st-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}
.admin-stat-card::before { height: 3px; background: linear-gradient(90deg, var(--st-leaf), var(--st-lagoon)) !important; }
.admin-stat-card, .admin-stat-card-compact, .worker-stat-card { transition: transform .2s ease, box-shadow .2s ease; }
.admin-stat-card:hover, .admin-stat-card-compact:hover { transform: translateY(-2px); }

/* A "water" hero container: glass with a liquid wave at its foot. */
.st-water {
    position: relative; overflow: hidden; isolation: isolate;
    color: #fff;
    background: linear-gradient(135deg, #0f7044 0%, #138a52 45%, #12a594 100%) !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 40px -18px rgba(15, 112, 68, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.st-water::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(600px 200px at 85% -20%, rgba(255, 255, 255, 0.35), transparent 60%),
                radial-gradient(300px 140px at 0% 0%, rgba(255, 255, 255, 0.18), transparent 70%);
}
.st-water::after {
    content: ''; position: absolute; left: -10%; right: -10%; bottom: -1px; height: 46px; z-index: -1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C150 0 300 60 450 30 C600 0 750 60 900 30 C1050 0 1200 60 1350 30 L1350 60 L0 60 Z' fill='white' fill-opacity='0.16'/%3E%3Cpath d='M0 40 C200 15 350 60 600 38 C850 15 1000 60 1200 40 L1200 60 L0 60 Z' fill='white' fill-opacity='0.12'/%3E%3C/svg%3E") repeat-x;
    background-size: 600px 46px;
    animation: stWave 9s linear infinite;
}
@keyframes stWave { from { background-position-x: 0; } to { background-position-x: 600px; } }
@media (prefers-reduced-motion: reduce) { .st-water::after { animation: none; } }

/* ---------------------------------------------------------------- admin shell */
.admin-sidebar {
    background: linear-gradient(180deg, rgba(12, 72, 47, 0.96) 0%, rgba(15, 112, 68, 0.94) 55%, rgba(14, 106, 98, 0.94) 100%) !important;
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px -18px rgba(12, 72, 47, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px !important;
}
html.dark .admin-sidebar { background: linear-gradient(180deg, rgba(10, 30, 20, 0.92), rgba(12, 44, 30, 0.9)) !important; border-color: rgba(255,255,255,0.06); }
.admin-sidebar .nav-link.active, .nav-sublink.active {
    background: linear-gradient(120deg, #ffffff, #e7fbf1) !important;
    color: #0f5838 !important;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.35), inset 0 1px 0 #fff;
}
html.dark .admin-sidebar .nav-link.active, html.dark .nav-sublink.active { background: linear-gradient(120deg, rgba(52,194,125,.24), rgba(44,194,174,.18)) !important; color: #e8f2ec !important; box-shadow: inset 0 0 0 1px rgba(52,194,125,.35); }
.nav-group-header, .admin-sidebar .nav-link { border-radius: 12px !important; }
.nav-sublink { border-radius: 10px !important; }
.sidebar-toggle-btn { background: #fff !important; color: var(--st-leaf-2) !important; }
html.dark .sidebar-toggle-btn { background: #173426 !important; color: #b1edcd !important; }
.st-nav-section { padding: 14px 16px 6px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.5); letter-spacing: .02em; }
.admin-sidebar.collapsed .st-nav-section { display: none; }

.admin-topbar {
    background: var(--st-glass-strong) !important;
    -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--st-line) !important;
    border-image: none !important;
    box-shadow: 0 8px 24px -18px rgba(12, 58, 39, 0.4) !important;
}
@media (min-width: 1024px) { .admin-topbar { margin: 12px 12px 0 0; border-radius: 18px; border: 1px solid var(--st-glass-line) !important; } }
.admin-topbar h1 { color: var(--st-ink) !important; font-weight: 800 !important; }
.header-user-btn { background: var(--st-mint) !important; color: var(--st-leaf-2) !important; }
.st-icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 12px; color: var(--st-leaf-2);
    background: var(--st-mint); border: 1px solid var(--st-line); transition: background .15s, transform .15s;
}
.st-icon-btn:hover { background: var(--st-mint-2); }
.st-icon-btn:active { transform: scale(.96); }
.st-icon-btn svg { width: 19px; height: 19px; }
.st-dot {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: #e5484d; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--st-paper);
}
.st-menu {
    position: absolute; right: 0; top: calc(100% + 8px); width: 230px; z-index: 60; padding: 6px;
    background: var(--st-glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--st-glass-line); border-radius: 16px; box-shadow: var(--st-shadow-lg);
}
.st-menu a, .st-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--st-ink); text-align: left; }
.st-menu a:hover, .st-menu button:hover { background: var(--st-mint); }
.st-menu .danger { color: #d33; }
.header-user-menu-item { color: var(--st-ink) !important; }

/* ---------------------------------------------------------------- buttons */
.btn-brand, .w-btn-primary, .st-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, #1fa865 0%, #138a52 100%) !important;
    color: #fff !important; border: 0 !important;
    border-radius: 12px !important; font-weight: 700 !important;
    box-shadow: 0 8px 18px -10px rgba(19, 138, 82, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease !important;
}
.st-btn { padding: 10px 18px; font-size: 14px; }
.btn-brand:hover, .w-btn-primary:hover, .st-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-brand:active, .w-btn-primary:active, .st-btn:active { transform: translateY(0); }
.btn-brand:disabled, .w-btn-primary:disabled, .st-btn:disabled { opacity: .55; transform: none; }
.btn-brand-outline, .w-btn-outline, .st-btn-ghost {
    border-radius: 12px !important; border: 1.5px solid rgba(19, 138, 82, 0.45) !important; color: var(--st-leaf-2) !important;
    background: rgba(255, 255, 255, 0.4) !important; font-weight: 700 !important;
}
.st-btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; font-size: 14px; }
html.dark .btn-brand-outline, html.dark .w-btn-outline, html.dark .st-btn-ghost { background: rgba(255,255,255,0.03) !important; color: #7ddcaa !important; }
.btn-danger-soft { border-radius: 10px !important; }
.st-btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; font-size: 14px; font-weight: 700; color: #fff; border-radius: 12px; background: linear-gradient(180deg, #e5484d, #c9343a); box-shadow: 0 8px 18px -10px rgba(201, 52, 58, .8); }

/* ---------------------------------------------------------------- forms */
.admin-scope input[type=text], .admin-scope input[type=email], .admin-scope input[type=password], .admin-scope input[type=number],
.admin-scope input[type=date], .admin-scope input[type=time], .admin-scope input[type=datetime-local], .admin-scope input[type=url], .admin-scope input[type=tel], .admin-scope input[type=search],
.admin-scope select, .admin-scope textarea, .form-input, .w-form-input, .w-form-select, .w-form-textarea,
.worker-scope input[type=text], .worker-scope input[type=email], .worker-scope input[type=password], .worker-scope input[type=number], .worker-scope input[type=date], .worker-scope input[type=time], .worker-scope input[type=tel],
.worker-scope select, .worker-scope textarea {
    border-radius: 12px !important;
    border: 1px solid rgba(15, 112, 68, 0.18) !important;
    background-color: rgba(255, 255, 255, 0.78) !important;
    color: var(--st-ink) !important;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
html.dark .admin-scope input[type=text], html.dark .admin-scope input[type=email], html.dark .admin-scope input[type=password], html.dark .admin-scope input[type=number],
html.dark .admin-scope input[type=date], html.dark .admin-scope input[type=time], html.dark .admin-scope input[type=datetime-local], html.dark .admin-scope input[type=url], html.dark .admin-scope input[type=tel], html.dark .admin-scope input[type=search],
html.dark .admin-scope select, html.dark .admin-scope textarea, html.dark .form-input, html.dark .w-form-input, html.dark .w-form-select, html.dark .w-form-textarea,
html.dark .worker-scope input[type=text], html.dark .worker-scope input[type=email], html.dark .worker-scope input[type=password], html.dark .worker-scope input[type=number], html.dark .worker-scope input[type=date], html.dark .worker-scope input[type=time], html.dark .worker-scope input[type=tel],
html.dark .worker-scope select, html.dark .worker-scope textarea {
    background-color: rgba(255, 255, 255, 0.04) !important; border-color: rgba(255, 255, 255, 0.12) !important;
}
.admin-scope input:focus, .admin-scope select:focus, .admin-scope textarea:focus, .worker-scope input:focus, .worker-scope select:focus, .worker-scope textarea:focus {
    outline: none !important; border-color: var(--st-leaf) !important; box-shadow: var(--st-focus) !important;
}
.admin-scope ::placeholder, .worker-scope ::placeholder { color: var(--st-muted) !important; opacity: .8; }
html.dark select option { background: #0f2219; color: #e8f2ec; }
.form-label, .w-form-label { color: var(--st-ink-2) !important; font-weight: 600 !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--st-leaf); }

/* toggles */
.toggle-pill[data-on="true"] { background: linear-gradient(180deg, #1fa865, #138a52) !important; }

/* ---------------------------------------------------------------- tables */
.admin-table thead th, table thead th { color: var(--st-muted); }
.admin-table tbody tr:hover, .admin-scope table tbody tr:hover { background: rgba(31, 168, 101, 0.05); }
html.dark .admin-scope table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
html.dark .admin-scope thead tr, html.dark .admin-scope thead { background: rgba(255,255,255,0.03) !important; }

/* ---------------------------------------------------------------- modals */
.admin-scope [id^="modal-"] > .relative, .worker-scope [id^="modal-"] > .relative {
    background: var(--st-glass-strong) !important;
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid var(--st-glass-line);
    border-radius: 22px !important;
}
.admin-scope [id^="modal-"] > .relative > .sticky { background: transparent !important; }
.admin-scope [id^="modal-"] > .fixed.inset-0, .worker-scope [id^="modal-"] > .fixed.inset-0 { background: rgba(4, 20, 12, 0.45) !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ---------------------------------------------------------------- worker shell */
.st-whead {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; margin: 0;
    background: var(--st-glass-strong);
    -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--st-line);
}
.st-whead .st-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; color: var(--st-ink); }
.st-whead .st-brand .st-logo { background: linear-gradient(135deg, #138a52, #12a594); color: #fff; }
.st-avatar { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; border: 2px solid var(--st-paper); box-shadow: 0 0 0 1px var(--st-line); background: var(--st-mint); }

.st-wlayout { display: block; }
.st-wside { display: none; }
@media (min-width: 1024px) {
    .st-wlayout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 20px; max-width: 1360px; margin: 0 auto; padding: 18px 20px 0; }
    .st-wside {
        display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; align-self: start;
        max-height: calc(100vh - 100px); overflow-y: auto; padding: 14px;
        background: var(--st-sheen), var(--st-glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
        border: 1px solid var(--st-glass-line); border-radius: 22px; box-shadow: var(--st-shadow);
        scrollbar-width: thin;
    }
    .st-wside a, .st-wside button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--st-ink-2); transition: background .15s, color .15s; width: 100%; text-align: left; }
    .st-wside a svg, .st-wside button svg { width: 19px; height: 19px; flex-shrink: 0; }
    .st-wside a:hover, .st-wside button:hover { background: var(--st-mint); color: var(--st-leaf-2); }
    .st-wside a.active { color: #fff; background: linear-gradient(135deg, #138a52, #12a594); box-shadow: 0 10px 22px -12px rgba(19, 138, 82, 0.9); }
    .st-wside .st-side-label { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; color: var(--st-muted); }
    .st-wside .st-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
    .st-wlayout main { max-width: none !important; margin: 0 !important; padding: 0 0 32px !important; }
    .worker-bottom-nav { display: none !important; }
    .st-only-mobile { display: none !important; }
}
.st-wmain { max-width: 48rem; margin: 0 auto; padding: 16px; }
@media (min-width: 1024px) { .st-wmain { max-width: none; } }

/* Bottom nav: smaller, glass pill (phones and tablets only). */
.worker-bottom-nav {
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    padding: 5px !important; gap: 2px !important;
    background: var(--st-glass-strong) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%) !important; backdrop-filter: blur(18px) saturate(160%) !important;
    border: 1px solid var(--st-glass-line) !important;
    box-shadow: 0 14px 34px -14px rgba(12, 58, 39, 0.45) !important;
    width: max-content; max-width: calc(100vw - 20px);
}
.worker-nav-link { padding: 7px 11px !important; font-size: 10px !important; gap: 2px !important; color: var(--st-muted) !important; border-radius: 999px !important; position: relative; }
.worker-nav-link svg { width: 18px !important; height: 18px !important; }
.worker-nav-link.active { color: #fff !important; background: linear-gradient(135deg, #138a52, #12a594) !important; box-shadow: 0 8px 18px -10px rgba(19, 138, 82, 0.9); }
.worker-nav-link .st-count { position: absolute; top: 1px; right: 4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
@media (max-width: 360px) { .worker-nav-link { padding: 6px 8px !important; font-size: 9px !important; } }

/* ---------------------------------------------------------------- page bits */
.st-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.st-page-head h1 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; color: var(--st-ink); letter-spacing: -0.025em; line-height: 1.15; }
.st-page-head p { color: var(--st-muted); font-size: 14px; margin-top: 4px; }
.st-card { padding: 18px; }
.st-card-title { font-size: 15px; font-weight: 800; color: var(--st-ink); margin-bottom: 12px; }
.st-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .st-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .st-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .st-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.st-muted { color: var(--st-muted); }
.st-ink { color: var(--st-ink); }
.st-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--st-mint); color: var(--st-leaf-2); border: 1px solid var(--st-line); white-space: nowrap; }
.st-pill.warn { background: rgba(245, 158, 11, .12); color: #a16207; border-color: rgba(245, 158, 11, .25); }
.st-pill.bad { background: rgba(229, 72, 77, .1); color: #c9343a; border-color: rgba(229, 72, 77, .25); }
.st-pill.info { background: rgba(18, 165, 148, .1); color: #0e6a62; border-color: rgba(18, 165, 148, .25); }
.st-pill.grey { background: rgba(107, 127, 116, .1); color: var(--st-muted); }
html.dark .st-pill.warn { color: #fbbf24; } html.dark .st-pill.bad { color: #ff8b8f; } html.dark .st-pill.info { color: #5fdcc8; }
.st-empty { text-align: center; padding: 36px 16px; color: var(--st-muted); }
.st-empty svg { width: 44px; height: 44px; margin: 0 auto 10px; opacity: .55; }
.st-alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; border: 1px solid; }
.st-alert.ok { background: rgba(31, 168, 101, .1); border-color: rgba(31, 168, 101, .3); color: #0f5838; }
.st-alert.err { background: rgba(229, 72, 77, .08); border-color: rgba(229, 72, 77, .3); color: #a42a2f; }
.st-alert.warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .3); color: #8a5300; }
html.dark .st-alert.ok { color: #9be8c0; } html.dark .st-alert.err { color: #ffadb0; } html.dark .st-alert.warn { color: #fcd38a; }
.st-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.st-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--st-muted); padding: 10px 12px; border-bottom: 1px solid var(--st-line); white-space: nowrap; }
.st-table td { padding: 12px; border-bottom: 1px solid var(--st-line); color: var(--st-ink); vertical-align: top; }
.st-table tr:last-child td { border-bottom: 0; }
.st-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; border-radius: 14px; background: var(--st-mint); border: 1px solid var(--st-line); scrollbar-width: none; }
.st-tabs a, .st-tabs button { flex-shrink: 0; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--st-ink-2); }
.st-tabs a.active, .st-tabs button.active { background: var(--st-paper); color: var(--st-leaf-2); box-shadow: var(--st-shadow); }
html.dark .st-tabs a.active, html.dark .st-tabs button.active { background: rgba(52,194,125,.18); color: #e8f2ec; }
.st-field { display: block; margin-bottom: 14px; }
.st-field > span { display: block; font-size: 13px; font-weight: 700; color: var(--st-ink-2); margin-bottom: 6px; }
.st-field small { display: block; font-size: 12px; color: var(--st-muted); margin-top: 4px; }
.st-input { width: 100%; padding: 10px 12px; font-size: 14px; }
.st-stat { padding: 16px; }
.st-stat .n { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--st-ink); line-height: 1.1; }
.st-stat .l { font-size: 12.5px; font-weight: 600; color: var(--st-muted); margin-top: 4px; }
.st-progress { height: 8px; border-radius: 999px; background: var(--st-mint-2); overflow: hidden; }
.st-progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1fa865, #12a594); transition: width .5s ease; }

/* Profile link buttons: three per row. */
.st-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-links a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 6px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--st-ink); border-radius: 16px; position: relative; }
.st-links a svg { width: 24px; height: 24px; color: var(--st-leaf); }
.st-links a:hover { transform: translateY(-2px); }
.st-links .st-count { position: absolute; top: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.st-line-links a, .st-line-links button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; font-size: 14.5px; font-weight: 700; color: var(--st-ink); text-align: left; }
.st-line-links .danger { color: #d33; }

/* ---------------------------------------------------------------- skeletons + loader */
.st-skel { position: relative; overflow: hidden; background: rgba(15, 112, 68, 0.08); border-radius: 10px; }
html.dark .st-skel { background: rgba(255, 255, 255, 0.05); }
.st-skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: stShimmer 1.3s infinite; }
html.dark .st-skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); }
@keyframes stShimmer { to { transform: translateX(100%); } }
.st-page-skeleton { position: fixed; inset: 0; z-index: 80; background: var(--st-page); padding: 90px 20px 20px; display: none; }
.st-page-skeleton.on { display: block; }
.st-page-skeleton .wrap { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; }
@media (prefers-reduced-motion: reduce) { .st-skel::after { animation: none; } }

/* The loading mark: a droplet filling with water. */
.st-loader { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; }
.st-drop { width: 64px; height: 64px; position: relative; }
.st-drop svg { width: 100%; height: 100%; overflow: visible; }
.st-drop .fill { animation: stFill 1.6s ease-in-out infinite; transform-origin: 32px 64px; }
@keyframes stFill { 0% { transform: translateY(26px); } 50% { transform: translateY(6px); } 100% { transform: translateY(26px); } }
.st-drop .ripple { animation: stRipple 1.6s ease-out infinite; transform-origin: center; }
@keyframes stRipple { from { opacity: .6; transform: scale(.6); } to { opacity: 0; transform: scale(1.5); } }
.st-loader-text { font-weight: 700; color: var(--st-ink-2); font-size: 14px; }
.st-busy { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; background: rgba(243, 250, 246, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html.dark .st-busy { background: rgba(7, 18, 12, 0.72); }
.st-busy.on { display: flex; }
.worker-loading-overlay, .admin-loading-overlay { background: rgba(243, 250, 246, 0.82) !important; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html.dark .worker-loading-overlay, html.dark .admin-loading-overlay { background: rgba(7, 18, 12, 0.82) !important; }

/* top progress line on navigation */
.st-topline { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 500; background: linear-gradient(90deg, #1fa865, #12a594, #7ddcaa); box-shadow: 0 0 10px rgba(31,168,101,.6); transition: width .3s ease, opacity .3s ease; }

/* ---------------------------------------------------------------- welcome splash after login */
.st-welcome { position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: radial-gradient(800px 500px at 50% 120%, #12a594 0%, transparent 60%), linear-gradient(160deg, #0c3a27 0%, #0f7044 55%, #138a52 100%); color: #fff; }
.st-welcome .halo { position: relative; width: 104px; height: 104px; margin: 0 auto 18px; }
.st-welcome .halo .photo { position: relative; margin: 0; }
.st-welcome .ring { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45) !important; box-sizing: border-box; animation: stRing 2.2s ease-out infinite; }
.st-welcome .ring:nth-child(2) { animation-delay: .5s; } .st-welcome .ring:nth-child(3) { animation-delay: 1s; }
@keyframes stRing { from { transform: scale(.6); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.st-welcome .inner { position: relative; text-align: center; padding: 24px; animation: stRise .7s cubic-bezier(.2,.9,.3,1.1) both; }
.st-welcome .photo { width: 104px; height: 104px; border-radius: 30px; object-fit: cover; margin: 0 auto 18px; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 20px 40px -12px rgba(0,0,0,.5); }
.st-welcome h2 { font-size: clamp(24px, 5vw, 34px); font-weight: 800; letter-spacing: -0.03em; }
.st-welcome p { opacity: .85; margin-top: 6px; font-size: 15px; }
.st-welcome .wave { position: absolute; left: 0; right: 0; bottom: 0; height: 140px; opacity: .5;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 60 C200 10 400 110 600 60 C800 10 1000 110 1200 60 L1200 120 L0 120 Z' fill='white' fill-opacity='0.14'/%3E%3C/svg%3E") repeat-x; background-size: 1200px 140px; animation: stWave 6s linear infinite; }
.st-welcome.out { animation: stFadeOut .45s ease forwards; }
@keyframes stRise { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes stFadeOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .st-welcome .ring, .st-welcome .wave, .st-welcome .inner { animation: none; } }

/* ---------------------------------------------------------------- theme chooser */
.st-theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.st-theme-opt { cursor: pointer; border-radius: 18px; padding: 10px; border: 2px solid transparent; text-align: center; font-weight: 700; font-size: 14px; color: var(--st-ink); }
.st-theme-opt.on { border-color: var(--st-leaf); box-shadow: var(--st-focus); }
.st-theme-opt .pv { height: 92px; border-radius: 12px; margin-bottom: 10px; position: relative; overflow: hidden; border: 1px solid var(--st-line); }
.st-theme-opt .pv.light { background: linear-gradient(160deg, #f3faf6, #ffffff); }
.st-theme-opt .pv.dark { background: linear-gradient(160deg, #07120c, #10241a); }
.st-theme-opt .pv.system { background: linear-gradient(90deg, #f3faf6 50%, #07120c 50%); }
.st-theme-opt .pv i { position: absolute; left: 10px; right: 10px; height: 12px; border-radius: 6px; }
.st-theme-opt .pv i:nth-child(1) { top: 12px; width: 40%; background: #138a52; }
.st-theme-opt .pv i:nth-child(2) { top: 34px; background: rgba(125, 220, 170, .5); }
.st-theme-opt .pv i:nth-child(3) { top: 54px; width: 60%; background: rgba(125, 220, 170, .35); }

/* ---------------------------------------------------------------- dark fixes for common hand-styled bits */
html.dark .text-gray-800, html.dark .text-gray-900, html.dark .text-gray-700 { color: var(--st-ink) !important; }
html.dark .bg-white { background-color: rgba(15, 33, 24, 0.7) !important; }
html.dark .shadow-sm, html.dark .shadow, html.dark .shadow-md { box-shadow: var(--st-shadow) !important; }
html.dark .ql-toolbar.ql-snow, html.dark .ql-container.ql-snow { border-color: rgba(255,255,255,.12) !important; }
html.dark .ql-snow .ql-stroke { stroke: #b9cbc0 !important; } html.dark .ql-snow .ql-fill { fill: #b9cbc0 !important; } html.dark .ql-snow .ql-picker { color: #b9cbc0 !important; }
html.dark .ql-editor { color: var(--st-ink); }
html.dark img.st-keep-light, html.dark .st-keep-light { filter: none; }

/* scrollbars */
.admin-scope, .worker-scope { scrollbar-color: #7ddcaa transparent !important; }
.admin-scope ::-webkit-scrollbar-thumb, .worker-scope ::-webkit-scrollbar-thumb { background-color: #7ddcaa !important; border-color: transparent !important; }
.admin-scope ::-webkit-scrollbar-track, .worker-scope ::-webkit-scrollbar-track { background: transparent !important; }
html.dark .admin-scope ::-webkit-scrollbar-thumb, html.dark .worker-scope ::-webkit-scrollbar-thumb { background-color: #1f5c40 !important; }

/* focus visibility everywhere */
.admin-scope a:focus-visible, .admin-scope button:focus-visible, .worker-scope a:focus-visible, .worker-scope button:focus-visible { outline: 2px solid var(--st-leaf); outline-offset: 2px; }

@media print { .st-bg, .st-whead, .st-wside, .worker-bottom-nav, .admin-sidebar, .admin-topbar { display: none !important; } }

/* answers to dynamic forms */
.st-answers { display: grid; gap: 8px; }
.st-answers > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(15, 112, 68, 0.04); border: 1px solid var(--st-line); }
html.dark .st-answers > div { background: rgba(255, 255, 255, 0.03); }
.st-answers dt { font-size: 12.5px; font-weight: 700; color: var(--st-muted); }
.st-answers dd { font-size: 14px; color: var(--st-ink); word-break: break-word; }
.st-answers dd .t { white-space: pre-line; }
.st-sig { max-height: 80px; max-width: 100%; background: #fff; border-radius: 8px; border: 1px solid var(--st-line); }
.st-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; display: inline-block; margin: 0 6px 6px 0; }
.st-filelink { color: var(--st-leaf-2); font-weight: 700; text-decoration: underline; margin-right: 10px; }
@media (max-width: 520px) { .st-answers > div { grid-template-columns: 1fr; gap: 2px; } }
@media (max-width: 520px) { .st-stat { padding: 12px; } .st-stat .n { font-size: 20px; } .st-stat .l { font-size: 11.5px; } }
/* history timeline */
.st-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.st-timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, #1fa865, #12a594); opacity: .35; border-radius: 2px; }
.st-timeline li { position: relative; padding: 0 0 14px 10px; }
.st-timeline li::before { content: ''; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--st-paper); border: 2px solid #1fa865; }
.st-timeline b { display: block; font-size: 14px; color: var(--st-ink); }
.st-timeline small { font-size: 12px; color: var(--st-muted); }
.st-timeline p { font-size: 13.5px; color: var(--st-ink-2); margin-top: 2px; white-space: pre-line; }
/* pop-up windows opened from table cells */
.admin-scope [id^="modal-"] > .relative, .worker-scope [id^="modal-"] > .relative { text-align: left; }
.ql-snow .ql-picker.ql-header, .ql-snow .ql-picker.ql-size { width: 112px !important; }
.ql-snow .ql-picker-label { padding-right: 20px !important; }

/* worker dashboard hero balance */
.st-dash-bal { text-align: right; }
@media (max-width: 640px) { .st-dash-bal { text-align: left; } }

/* ---------------------------------------------------------------- upload + signature fields (ST-A8) */
.st-up { outline: none; }
.st-up-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px 14px; border: 1.5px dashed rgba(15, 112, 68, .35); border-radius: 16px; background: var(--st-mint); color: var(--st-leaf-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .15s; }
.st-up-drop svg { width: 26px; height: 26px; }
.st-up-drop b { font-size: 14px; color: var(--st-ink); }
.st-up-drop small { font-size: 12px; color: var(--st-muted); }
.st-up-drop:hover, .st-up-drop:focus-visible { border-color: var(--st-leaf); }
.st-up-drop.drag { border-color: var(--st-leaf); background: rgba(31, 168, 101, .14); transform: scale(1.01); }
.st-up-drop.full { cursor: default; opacity: .7; }
.st-up-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.st-up-quick button { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--st-line); background: var(--st-glass-card, #fff); color: var(--st-leaf-2); }
.st-up-notice { font-size: 12.5px; color: #a16207; margin-top: 6px; }
.st-up-item { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--st-line); background: var(--st-glass-card, #fff); }
.st-up-item.error { border-color: rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .05); }
.st-up-thumb { position: relative; width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: var(--st-mint); color: var(--st-leaf-2); font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.st-up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-up-play { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.st-up-play::after { content: ''; position: absolute; left: 6px; top: 4px; border-left: 6px solid #fff; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.st-up-body { flex: 1; min-width: 0; }
.st-up-name { font-size: 13px; font-weight: 700; color: var(--st-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-up-bar { height: 5px; border-radius: 9px; background: var(--st-line); margin-top: 5px; overflow: hidden; }
.st-up-bar span { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #1fa865, #12a594); transition: width .15s; }
.st-up-item.error .st-up-bar span { background: #e5484d; }
.st-up-state { font-size: 12px; color: var(--st-muted); margin-top: 3px; }
.st-up-item.error .st-up-state { color: #c9343a; }
.st-up-acts { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.st-up-acts button { font-size: 12px; font-weight: 700; color: var(--st-leaf-2); padding: 4px 8px; border-radius: 8px; }
.st-up-acts button.danger { color: #c9343a; }
.st-up-viewer { position: fixed; inset: 0; z-index: 700; background: rgba(5, 15, 10, .97); display: flex; flex-direction: column; }
.st-up-viewer-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; font-size: 13.5px; font-weight: 700; }
.st-up-viewer-bar button { color: #fff; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 12.5px; }
.st-up-viewer-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 12px; }
.st-up-viewer-body img { max-width: 92vw; max-height: 82vh; object-fit: contain; transition: transform .2s; transform-origin: center; cursor: zoom-in; }
.st-up-viewer-body video { max-width: 92vw; max-height: 82vh; border-radius: 12px; }

.st-sig-pad { position: relative; border: 1px solid var(--st-line); border-radius: 16px; background: #fff; overflow: hidden; }
.st-sig-line { position: absolute; left: 20px; right: 20px; bottom: 38px; border-bottom: 1.5px dashed #c6dccf; pointer-events: none; }
.st-sig-hint { position: absolute; left: 22px; bottom: 44px; font-size: 13px; color: #9bb3a6; pointer-events: none; }
.st-sig-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.st-sig-pens { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--st-mint); }
.st-sig-pens button { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.st-sig-pens button i { display: block; border-radius: 50%; background: var(--st-ink); }
.st-sig-pens button.on { background: var(--st-glass-card, #fff); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.st-sig-btn { font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--st-line); color: var(--st-leaf-2); }
.st-sig-btn.danger { color: #c9343a; }
.st-sig-btn:disabled { opacity: .45; cursor: default; }
.ql-editor.st-drop-on { outline: 2px dashed var(--st-leaf); outline-offset: -6px; background: rgba(31, 168, 101, .06); }

/* ---------------------------------------------------------------- sign-in pages */
.st-auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.st-auth-side { border-radius: 0 36px 36px 0 !important; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 40px 60px; min-height: 100%; }
.st-auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.st-auth-copy h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: #fff; }
.st-auth-copy p { font-size: 16px; opacity: .9; margin-top: 10px; max-width: 34ch; color: #fff; }
.st-auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 14px; }
.st-auth-card { width: 100%; max-width: 430px; padding: 28px 26px; border-radius: 26px; }
.st-auth-foot { font-size: 12px; color: var(--st-muted); }
@media (max-width: 860px) {
    .st-auth { grid-template-columns: 1fr; }
    .st-auth-side { border-radius: 0 0 30px 30px !important; padding: 22px 20px 58px; min-height: 0 !important; gap: 22px; justify-content: flex-start; }
    .st-auth-copy h1 { font-size: 28px; }
    .st-auth-copy p { font-size: 14px; }
    .st-auth-main { justify-content: flex-start; margin-top: -34px; padding: 0 16px 24px; position: relative; z-index: 2; }
    .st-auth-card { padding: 22px 18px; }
}
