/* Ultra Modern Beautiful Portal - Premium Design */

/* ===== GLOBAL RESET & TYPOGRAPHY ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Remove ALL browser default styling */
input,
select,
textarea,
button,
label {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    border-image: none;
}

*:focus,
*:active,
*:focus-visible {
    outline: none !important;
    outline-width: 0 !important;
    outline-color: transparent !important;
}

label {
    outline: none !important;
    border: none !important;
    border-left: none !important;
    background: none !important;
    box-shadow: none !important;
}

:root {
    --primary-color: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #f97316;
    --secondary-color: #1e293b;
    --success-color: #047857;
    --warning-color: #b45309;
    --danger-color: #b91c1c;
    /* High contrast — dark ink on white (avoid grey-on-white) */
    --text-primary: #0a0f1a;
    --text-secondary: #1e293b;
    --text-muted: #334155;
    --bg-main: linear-gradient(145deg, #fff7ed 0%, #ffedd5 55%, #fed7aa 100%);
    --bg-card: #ffffff;
    --border-color: #fb923c;
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(234, 88, 12, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.14), 0 10px 10px -5px rgba(234, 88, 12, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.22);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* Dropdown Menu Styles */
nav li {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 8px;
    z-index: 9999;
    border: 1px solid var(--border-color);
    margin-top: 10px;
    /* Give some space but bridge it */
}

/* Invisible bridge to prevent closing */
nav li:hover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px;
    /* Height of the gap */
    background: transparent;
    z-index: 999;
}

nav li:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-content a {
    padding: 10px 16px;
    display: block;
    color: #1e293b;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 2px;
}

.dropdown-content a:hover {
    color: var(--primary-dark);
    background: #fff7ed;
}

/* Nav links with dropdown arrow */
.nav-link-dropdown {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding-right: 24px !important;
    /* Space for arrow */
}

.nav-link-dropdown::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transform: translateY(-50%);
    opacity: 0.6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive for dropdowns */
@media (max-width: 768px) {
    nav li {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        background: transparent;
        margin-top: 0;
    }

    /* On mobile, we might want click instead of hover, 
       but for now let's keep it simple. Hover on mobile 
       often works as "tap once". */
    nav li:hover .dropdown-content {
        display: block;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: #0a0f1a;
    line-height: 1.4;
    font-size: 13px;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Force readable body copy — no pale grey on white.
   Do NOT style all spans forever — chips/badges need their own colors. */
p, li, td, .card p, .form-help, small, label, .instruction-preview {
    color: #1e293b;
}
/* Generic spans only when not a chip/badge/nav control */
span:not(.chip):not(.badge):not(.sb-badge):not(.sb-label):not(.sb-ico):not([class*="badge"]) {
    color: inherit;
}

strong, b, h1, h2, h3, h4, h5, h6 {
    color: #0a0f1a;
}

/* Utility: still dark enough to read */
.text-muted {
    color: #334155 !important;
    font-weight: 500;
}

a {
    color: #c2410c;
    font-weight: 600;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 247, 237, 0.95) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

header h1 {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-primary);
}

.user-info span {
    padding: 4px 8px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: #0f172a;
    box-shadow: none;
    border: 1px solid #fed7aa;
    font-size: 11px;
}

/* ===== NAVIGATION ===== */
nav {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    position: relative;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    color: #1e293b;
    text-decoration: none;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
    color: var(--primary-color);
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    transform: none;
}

nav a:hover::before {
    transform: scaleX(1);
}

nav a.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
}

nav a.active::before {
    display: none;
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 10px 0;
    min-height: calc(100vh - 160px);
}

/* ===== PAGE HEADER ===== */
.page-header {
    text-align: left;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.page-header p {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    max-width: none;
    margin: 0;
    line-height: 1.4;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(249, 115, 22, 0.28);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

/* .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s;
} */

.card:hover {
    box-shadow: var(--shadow-md);
    transform: none;
    border-color: var(--primary-light);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card p,
.card li,
.card td,
.card small {
    color: #1e293b;
    font-weight: 500;
}

.card strong {
    color: #0a0f1a;
    font-weight: 700;
}

/* ===== STATISTICS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 247, 237, 0.95) 100%);
    padding: 8px 6px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid rgba(249, 115, 22, 0.25);
    transition: border-color 0.15s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* .stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    transition: all 0.3s;
    opacity: 0;
} */

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
    border-color: var(--primary-light);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    line-height: 1.15;
}

.stat-label {
    color: #0f172a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 1;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    padding: 0;
    border: none;
    border-left: none;
    background: transparent;
}

.form-group label::before,
.form-group label::after,
label::before,
label::after {
    display: none;
    content: none;
}

label {
    border: none;
    border-left: none;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="month"],
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: #0f172a;
    background: #ffffff;
    font-weight: 500;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
    transform: none;
}

.form-group textarea {
    min-height: 72px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #475569;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    line-height: 1.3;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #475569 100%);
    color: white;
}

.btn-secondary:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    opacity: 0.95;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

.btn-sm {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-lg {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: none;
    transition: none;
    line-height: 1.3;
}

.badge:hover {
    transform: none;
}

.badge-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.badge-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-orange {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #9a3412;
    border: 1px solid #fb923c;
}

.badge-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.badge-secondary {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #475569;
    border: 1px solid #94a3b8;
}

.badge-purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    color: #6b21a8;
    border: 1px solid #c084fc;
}

.badge-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== ALERTS ===== */
.alert {
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    border-left: 3px solid;
    font-size: 12px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: skewX(-15deg) translateX(100%);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: var(--success-color);
    color: #065f46;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: var(--primary-color);
    color: #1e40af;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
}

.data-table th {
    padding: 6px 8px;
    text-align: left;
    font-weight: 800;
    color: #0f172a;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--primary-light);
}

.data-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 500;
    transition: background-color 0.12s;
    line-height: 1.35;
}

.data-table td strong {
    color: #0a0f1a;
    font-weight: 800;
}

.data-table td small {
    color: #1e293b;
    font-weight: 600;
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%);
    transform: none;
    box-shadow: none;
}

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

/* Table Column Alignment - Following Best Practices */
.data-table th:first-child,
.data-table td:first-child {
    text-align: left;
    /* First column (names, descriptions) always left */
}

/* Numeric columns - right aligned for easy comparison */
.data-table td[data-type="number"],
.data-table td.number,
.data-table td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    /* Monospaced numbers for better alignment */
}

/* Center alignment for icons, badges, and actions */
.data-table td[data-type="icon"],
.data-table td[data-type="badge"],
.data-table td[data-type="action"],
.data-table td.center {
    text-align: center;
}

/* Status badges in tables should be centered */
.data-table td .badge {
    display: inline-block;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 10px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 100px;
    overflow: hidden;
    margin: 10px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 100px 100px 0 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-card);
    color: var(--text-secondary);
    text-align: center;
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    nav ul {
        flex-direction: column;
    }

    nav a {
        border-bottom: 1px solid var(--border-color);
        border-left: 2px solid transparent;
    }

    nav a.active {
        border-left-color: var(--primary-color);
        border-bottom-color: var(--border-color);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .page-header h2 {
        font-size: 15px;
    }

    .stat-value {
        font-size: 16px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

/* ===== ENHANCED ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

/* ===== GLASSMORPHISM EFFECT ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== ENHANCED PAGE HEADER ===== */
.page-header {
    text-align: left;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.page-header::after {
    display: none;
}

/* ===== FLOATING LABELS ===== */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating select,
.form-floating textarea {
    padding-top: 20px;
}

.form-floating label {
    position: absolute;
    top: 12px;
    left: 16px;
    transition: all 0.2s;
    pointer-events: none;
    color: var(--text-secondary);
}

.form-floating input:focus~label,
.form-floating input:not(:placeholder-shown)~label,
.form-floating select:focus~label,
.form-floating textarea:focus~label {
    top: 4px;
    font-size: 11px;
    color: var(--primary-color);
}

/* ===== TOOLTIPS ===== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-primary) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .stat-card {
        padding: 8px 6px;
    }

    .stat-value {
        font-size: 16px;
    }

    .card {
        padding: 10px;
    }

    nav a {
        padding: 6px 10px;
    }

    .data-table th,
    .data-table td {
        padding: 5px 6px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }

    header,
    nav,
    footer,
    .btn {
        display: none;
    }

    .card,
    .stat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== FILTER GRID & FORM ROW ===== */
.filter-grid,
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: end;
    width: 100%;
}

.filter-grid .form-group,
.form-row .form-group {
    margin-bottom: 0;
}

.filter-grid .form-group label,
.form-row .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ===== BULK ACTIONS ===== */
.bulk-actions {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    align-items: center;
}

/* ===== FILTER SECTION HEADER ===== */
.filter-section-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

@media (max-width: 768px) {

    .filter-grid,
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ===== MISSING UTILITIES ===== */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-info:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

/* Badge aliases for config.php compatibility */
.badge-green {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.badge-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-red {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    /* High z-index to sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 6% auto;
    padding: 14px 16px;
    border: 1px solid #888;
    width: 90%;
    max-width: 520px;
    border-radius: 8px;
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideDown 0.2s ease-out;
}

.close {
    color: #aaa;
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
/* ===== WORK PERKS ===== */
.perk-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.perk-page-header h2 {
    margin-bottom: 4px;
}

.perk-back {
    margin-bottom: 6px !important;
    font-size: 13px;
}

.perk-back a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.perk-header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.perk-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.perk-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.perk-card-head h3 {
    margin: 0;
}

.section-help {
    color: #334155;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.55;
}

.perk-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 720px) {
    .perk-form-grid {
        grid-template-columns: 1fr;
    }
}

.perk-task-picker {
    margin-top: 8px;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fffbf5 0%, #ffffff 40%);
    padding: 16px;
}

.perk-task-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.perk-task-picker-head h4 {
    margin: 0;
    font-size: 15px;
}

.perk-task-group {
    margin-bottom: 18px;
}

.perk-task-group:last-child {
    margin-bottom: 0;
}

.perk-task-group-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9a3412;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.perk-task-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.perk-task-option {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: #fff;
    padding: 12px 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.perk-task-option.is-selected {
    border-color: var(--primary-color);
    background: #fff7ed;
    box-shadow: var(--shadow-sm);
}

.perk-check-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.perk-check-row input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.perk-check-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.perk-check-label strong {
    font-size: 14px;
    color: #0a0f1a;
}

.perk-check-label small {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
}

.perk-task-extra {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #fdba74;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perk-target-row {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 220px;
}

.perk-target-row label {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

.perk-target-input {
    max-width: 100px;
}

.perk-form-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
}

/* Overview list */
.perk-overview-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perk-overview-item {
    display: block;
    text-decoration: none !important;
    color: inherit;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    background: #fff;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.perk-overview-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.perk-overview-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.perk-overview-title {
    font-size: 15px;
    color: #0a0f1a;
    display: block;
    margin-bottom: 4px;
}

.perk-overview-meta {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
}

.perk-overview-meta .dot {
    margin: 0 4px;
    opacity: 0.5;
}

.perk-overview-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #334155;
    font-weight: 600;
    margin-top: 8px;
}

.perk-progress-bar {
    height: 8px;
    background: #ffedd5;
    border-radius: 999px;
    overflow: hidden;
}

.perk-progress-bar-lg {
    height: 12px;
}

.perk-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 55%, #c2410c 100%);
    border-radius: 999px;
    min-width: 0;
    transition: width 0.35s ease;
}

.perk-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.perk-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.perk-empty {
    text-align: center;
    padding: 40px 20px;
    color: #334155;
}

.perk-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Worker cards */
.perk-section-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a3412;
    margin: 0 0 14px;
}

.perk-worker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.perk-worker-card {
    text-decoration: none !important;
    color: inherit;
    display: block;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid #fed7aa;
}

.perk-worker-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.perk-big-progress {
    margin: 8px 0 14px;
}

.perk-big-pct {
    font-size: 28px;
    font-weight: 800;
    color: #c2410c;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.perk-task-mini-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.perk-task-mini {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 10px;
    background: #fff7ed;
    border-radius: 8px;
    color: #1e293b;
}

.perk-card-cta {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Detail — dense worker view */
.perk-detail-grid,
.pv-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 10px;
    align-items: start;
}

@media (max-width: 900px) {
    .perk-detail-grid,
    .pv-layout {
        grid-template-columns: 1fr;
    }
}

.perk-detail-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.perk-detail-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 72px;
}

.pv-head .perk-back {
    margin-bottom: 2px !important;
    font-size: 12px;
}
.pv-brief-bar {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #9a3412;
}
.pv-brief-bar strong {
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.pv-edit {
    margin-bottom: 10px;
    padding: 0;
}
.pv-edit-sum {
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 10px;
    list-style: none;
}
.pv-edit-sum::-webkit-details-marker { display: none; }
.pv-edit-form { padding: 0 10px 10px; }
.pv-edit-meta {
    display: grid;
    grid-template-columns: 1fr 120px 120px;
    gap: 8px;
}
@media (max-width: 720px) {
    .pv-edit-meta { grid-template-columns: 1fr 1fr; }
}
.pv-edit-label {
    margin: 10px 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}
.pv-edit-tasks { display: flex; flex-direction: column; gap: 8px; }
.pv-edit-task {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 8px;
    background: #f8fafc;
}
.pv-edit-task-top {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pv-edit-task-top input[type="text"] { flex: 1; min-width: 0; }
.pv-edit-done { font-size: 11px; white-space: nowrap; }
.pv-edit-remove {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: #b91c1c;
}
.pv-edit-remove.is-off { color: #94a3b8; }
.pv-edit-items { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.pv-edit-item { display: flex; gap: 6px; align-items: center; }
.pv-edit-item input { flex: 1; }
.pv-edit-add {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
    margin-bottom: 6px;
}
@media (max-width: 720px) {
    .pv-edit-add { grid-template-columns: 1fr; }
}
.pv-edit-add-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.pv-edit-add-row span { flex: 1; min-width: 0; }
.pv-edit-custom { display: flex; gap: 6px; margin: 6px 0; }
.pv-edit-custom input[type="text"] { flex: 1; }
.pv-edit-actions { margin-top: 8px; }
.pv-progress-slim {
    margin-bottom: 10px;
}
.pv-progress-slim .perk-progress-bar-lg {
    height: 8px !important;
}

.pv-task-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
@media (max-width: 720px) {
    .pv-task-grid {
        grid-template-columns: 1fr;
    }
}

.pv-task {
    padding: 10px !important;
    margin-bottom: 0 !important;
}
.pv-task-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.pv-task-title-row h3 {
    margin: 0;
    font-size: 13px !important;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pv-train {
    font-size: 12px;
    text-decoration: none;
    color: #c2410c;
    font-weight: 700;
}
.pv-hint {
    margin: 0 0 6px;
    font-size: 11px;
    color: #64748b;
}
.pv-items {
    margin: 6px 0 !important;
    padding: 6px 8px !important;
}
.pv-items-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 4px;
}
.pv-items ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pv-items li {
    display: flex;
    gap: 6px;
    padding: 2px 0 !important;
    font-size: 11px !important;
    border-bottom: none !important;
}

.perk-brief {
    margin-top: 8px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 6px;
    border: 1px solid #fed7aa;
}

.perk-brief h4 {
    margin: 0 0 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9a3412;
}

.perk-brief p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.perk-task-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.perk-task-card-head h3 {
    margin: 0;
    font-size: 14px;
}

.perk-task-stats {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}
.perk-task-stats strong {
    font-size: 12px;
}

.perk-items-list {
    margin: 8px 0;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.perk-items-list h4 {
    margin: 0 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.perk-items-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.perk-items-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
}

.perk-items-list li:last-child {
    border-bottom: none;
}

.perk-items-list li.is-done {
    color: #047857;
}

.perk-report-drawer summary {
    font-size: 12px;
    font-weight: 700;
    color: #c2410c;
    cursor: pointer;
    padding: 4px 0;
}
.perk-report-drawer .form-group {
    margin-bottom: 8px !important;
}
.pv-hist-item {
    padding: 8px !important;
    margin-bottom: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}
.pv-hist-label {
    font-size: 12px;
    color: #c2410c !important;
}
.pv-hist-title {
    font-size: 11px;
    color: #334155;
    margin: 2px 0 4px;
}
.pv-hist-btn {
    margin-top: 4px;
    display: inline-block;
}
.pv-hist-note {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.perk-item-check {
    font-weight: 800;
    width: 16px;
    flex-shrink: 0;
}

.perk-report-drawer {
    margin-top: 14px;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-md);
    background: #fffbf5;
    padding: 0 14px;
}

.perk-report-drawer summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 12px 0;
    list-style: none;
}

.perk-report-drawer summary::-webkit-details-marker {
    display: none;
}

.perk-report-form {
    padding-bottom: 16px;
}

.perk-report-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
}

.perk-report-item {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: #fff;
}

.perk-report-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 4px;
}

.perk-report-item-top strong {
    font-size: 13px;
}

.perk-report-link {
    display: inline-block;
    font-size: 12px;
    margin: 4px 0;
    word-break: break-all;
}

.badge-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.badge-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #334155;
    border: 1px solid #cbd5e1;
}

.badge-orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #9a3412;
    border: 1px solid #fb923c;
}

/* ===== PERKS: compact side-by-side ===== */
.perk-page-header-compact {
    margin-bottom: 8px;
}
.perk-page-header-compact h2 {
    font-size: 16px;
}
.perk-page-header-compact p {
    font-size: 12px;
    margin: 0;
}

.perk-split {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 10px;
    align-items: start;
}
@media (max-width: 900px) {
    .perk-split {
        grid-template-columns: 1fr;
    }
}

.perk-create-compact,
.perk-list-compact {
    padding: 10px 12px !important;
}

.perk-create-compact .form-group {
    margin-bottom: 10px;
}
.perk-create-compact label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.form-control-sm {
    padding: 8px 10px !important;
    font-size: 13px !important;
    min-height: 0 !important;
}

.perk-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.perk-mini-grid .perk-span-2 {
    grid-column: 1 / -1;
}

.perk-packs-compact {
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fffbf7;
    padding: 10px 12px;
    margin: 8px 0 12px;
}
.perk-packs-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}
.perk-packs-head strong {
    font-size: 13px;
    color: #9a3412;
}
.perk-packs-head span {
    color: #64748b;
    font-weight: 600;
}

.perk-pack-group-compact {
    margin-bottom: 8px;
}
.perk-pack-group-compact:last-child {
    margin-bottom: 0;
}
.perk-pack-group-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9a3412;
    margin-bottom: 6px;
}

.perk-pack-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.perk-chip-toggle {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
}
.perk-chip-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.perk-chip-body {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    transition: all 0.15s;
}
.perk-chip-toggle:hover .perk-chip-body {
    border-color: #fb923c;
}
.perk-chip-toggle.is-on .perk-chip-body,
.perk-chip-toggle input:checked + .perk-chip-body {
    border-color: #ea580c;
    background: #fff7ed;
    color: #9a3412;
    box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.15);
}
.perk-chip-name {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.perk-chip-qty {
    width: 42px !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
    border: 1px solid #fdba74 !important;
    background: #fff !important;
    text-align: center;
    -webkit-appearance: textfield !important;
    appearance: textfield !important;
}

.perk-topics-box {
    margin-bottom: 8px !important;
}
.perk-form-actions-compact {
    margin-top: 8px;
    justify-content: flex-start;
}

.perk-empty-sm {
    padding: 24px 12px;
}
.perk-overview-dense {
    gap: 8px;
    max-height: 70vh;
    overflow-y: auto;
}
.perk-overview-item-sm {
    padding: 10px 12px !important;
}
.perk-overview-item-sm .perk-overview-title {
    font-size: 13px;
}
.perk-overview-item-sm .perk-overview-top {
    margin-bottom: 8px;
}
.perk-overview-item-sm .perk-progress-bar {
    height: 6px;
}

/* Sheet + shuffle */
.perk-sheet-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    font-size: 12px;
}
.perk-sheet-banner strong {
    color: #1e40af;
}
.perk-shuffle-row {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    font-size: 12px;
    cursor: pointer;
    border-left: none !important;
    box-shadow: none !important;
}
.perk-shuffle-row input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

/* Pack rows: FULL names visible (no L… / M… ellipsis), tiny qty */
.perk-pack-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.perk-pack-rows.perk-pack-grid {
    display: grid;
    /* 2 cols max on create form so labels stay readable */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
@media (max-width: 720px) {
    .perk-pack-rows.perk-pack-grid {
        grid-template-columns: 1fr;
    }
}
.perk-pack-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 4px 6px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
}
.perk-custom-grid {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
    align-items: center;
}
.perk-pack-row.is-on {
    border-color: #ea580c;
    background: #fff7ed;
}
.perk-pack-row-main {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    min-width: 0;
}
.perk-pack-row-main input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}
.perk-pack-row-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    /* Allow wrap — never L… / M… truncation */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
    hyphens: auto;
}
.perk-pack-qty-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.perk-pack-qty-label {
    display: none; /* # is noise; qty field is enough */
}
.perk-pack-qty-input {
    width: 40px !important;
    max-width: 40px !important;
    min-width: 36px !important;
    padding: 2px 3px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    border: 1px solid #fb923c !important;
    border-radius: 6px !important;
    background: #fff !important;
    min-height: 26px !important;
    height: 26px !important;
    -webkit-appearance: textfield !important;
    appearance: textfield !important;
}
.perk-pack-qty-input::-webkit-outer-spin-button,
.perk-pack-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.perk-pack-row .perk-tip {
    flex-shrink: 0;
}
.perk-pack-row .perk-tip-q {
    width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 14px;
}
/* Hover / focus tooltips for pack ? — light card, high contrast (never dark-on-dark) */
.perk-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 20;
}
.perk-tip-q {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
    cursor: help;
    user-select: none;
    box-sizing: border-box;
}
.perk-tip:hover .perk-tip-q,
.perk-tip:focus-within .perk-tip-q {
    background: #fff7ed;
    border-color: #ea580c;
    color: #c2410c;
}
.perk-tip-bubble {
    display: none;
    position: absolute;
    /* Always open to the RIGHT of ? so it never slides under the left sidebar */
    left: calc(100% + 10px);
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: min(280px, 56vw);
    max-width: 280px;
    padding: 10px 12px;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #fdba74;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    z-index: 6000;
    pointer-events: none;
    text-align: left;
    white-space: normal;
    letter-spacing: 0;
}
.perk-tip-bubble,
.perk-tip-bubble * {
    color: #0f172a !important;
}
.perk-tip-bubble::before {
    content: '';
    position: absolute;
    right: 100%;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-right-color: #fdba74;
}
.perk-tip-bubble::after {
    content: '';
    position: absolute;
    right: 100%;
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    margin-right: -1px;
    border: 6px solid transparent;
    border-right-color: #ffffff;
}
.perk-tip:hover .perk-tip-bubble,
.perk-tip:focus-within .perk-tip-bubble {
    display: block;
    pointer-events: auto;
}
/* Right-side cards: open tip to the LEFT so it stays on screen */
.pv-task:nth-child(3n) .perk-tip-bubble,
.perk-pack-row:nth-child(3n) .perk-tip-bubble {
    left: auto;
    right: calc(100% + 10px);
    transform: translateY(-50%);
}
.pv-task:nth-child(3n) .perk-tip-bubble::before,
.perk-pack-row:nth-child(3n) .perk-tip-bubble::before {
    right: auto;
    left: 100%;
    border: 7px solid transparent;
    border-left-color: #fdba74;
    border-right-color: transparent;
}
.pv-task:nth-child(3n) .perk-tip-bubble::after,
.perk-pack-row:nth-child(3n) .perk-tip-bubble::after {
    right: auto;
    left: 100%;
    margin-right: 0;
    margin-left: -1px;
    border: 6px solid transparent;
    border-left-color: #ffffff;
    border-right-color: transparent;
}
.perk-tip-link {
    color: #c2410c !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-decoration: underline;
}

/* Branded blogs / branded posts explainer */
.perk-branded-info {
    margin: 0 0 12px;
    border: 1px solid #fdba74;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff7ed 0%, #fff 70%);
    padding: 0;
}
.perk-branded-info > summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 12px;
    font-size: 13px;
    color: #9a3412;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.perk-branded-info > summary::-webkit-details-marker { display: none; }
.perk-branded-info > summary::before {
    content: '▸';
    font-size: 11px;
    color: #ea580c;
}
.perk-branded-info[open] > summary::before { content: '▾'; }
.perk-branded-body {
    padding: 0 12px 12px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.45;
}
.perk-branded-body p { margin: 0 0 8px; }
.perk-branded-body ul {
    margin: 0 0 8px;
    padding-left: 18px;
}
.perk-branded-body li { margin-bottom: 4px; }
.perk-branded-core {
    color: #c2410c !important;
    font-size: 12px !important;
}
.perk-branded-sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.perk-branded-site-card {
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.perk-branded-site-card a {
    font-weight: 700;
    color: #c2410c;
    text-decoration: none;
    font-size: 13px;
}
.perk-branded-site-card a:hover { text-decoration: underline; }
.perk-branded-looks {
    font-size: 11px;
    font-weight: 600;
    color: #0f172a;
}
.perk-branded-why {
    font-size: 11px;
    color: #64748b;
    line-height: 1.35;
}
.pv-branded-help {
    margin: 6px 0 10px;
    font-size: 12px;
    color: #475569;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 6px 10px;
}
.pv-branded-help summary {
    cursor: pointer;
    font-weight: 700;
    color: #c2410c;
}
.pv-branded-help p { margin: 6px 0; }
.pv-branded-help ul { margin: 4px 0 8px; padding-left: 16px; }
.pv-branded-mini-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.pv-branded-chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.pv-branded-chip:hover { background: #ffedd5; }
.perk-info-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #94a3b8;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    cursor: help;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.perk-info-wrap {
    display: flex;
    align-items: center;
    position: relative;
}
.perk-training-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #fdba74;
    font-size: 12px;
}
.perk-training-label {
    font-weight: 800;
    color: #9a3412;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
}
.perk-training-bar a {
    font-weight: 700;
    color: #c2410c;
}
.perk-training-bar a:hover {
    text-decoration: underline;
}
/* Worker-facing help stack (My Perks + perk detail) */
.pv-worker-help {
    margin: 0 0 12px;
}
.pv-worker-help .perk-sheet-banner {
    margin-bottom: 8px;
}
.pv-worker-help .perk-training-bar {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-top: none;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
}
.pv-worker-help .perk-branded-info {
    margin-bottom: 0;
}
.perk-branded-howto {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #c2410c !important;
    text-decoration: none;
}
.perk-branded-howto:hover {
    text-decoration: underline;
}
.perk-create-compact {
    position: relative;
}
.perk-shuffle-row .perk-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0 4px;
}

@media (max-width: 520px) {
    .perk-pack-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }
    .perk-pack-qty-wrap {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

/* ===== SITE-WIDE COMPACT UI (toolbar / KPI / page head) ===== */
.ui-page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.ui-page-head h2 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.ui-page-head p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ui-chip {
    display: inline-block;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 999px;
}
.ui-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ui-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.ui-field label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
}
.ui-field select,
.ui-field input[type="date"],
.ui-field input[type="text"] {
    height: 32px;
    min-width: 120px;
    max-width: 200px;
    padding: 4px 28px 4px 8px !important;
    font-size: 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background: #fff !important;
    width: auto !important;
}
.ui-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.ui-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}
.ui-kpi strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: #c2410c;
    line-height: 1.15;
}
.ui-kpi span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
}
.ui-kpi-accent {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border-color: #fdba74;
}
.ui-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ui-footnote {
    margin: 10px 0 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}
.ui-dash-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Assign task compact form */
.assign-compact h3 {
    margin-bottom: 10px;
    font-size: 14px;
}
.assign-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
.assign-form-grid .assign-span-2 {
    grid-column: 1 / -1;
}
.assign-form-grid .assign-actions {
    grid-column: 1 / -1;
}
.assign-form-grid .form-group {
    margin-bottom: 0 !important;
}
@media (max-width: 800px) {
    .assign-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 520px) {
    .assign-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Force-fullwidth: don't stretch toolbar selects to 100% */
.ui-toolbar .ui-field select,
.ui-toolbar .ui-field input,
.filters-form .filter-group select,
.filters-form .filter-group input {
    width: auto !important;
    max-width: 220px !important;
}

/* Multi-URL report rows + history polish (workers & TL same) */
.pv-report-summary {
    font-weight: 700 !important;
    color: #c2410c !important;
    cursor: pointer;
    list-style: none;
}
.pv-report-summary::-webkit-details-marker { display: none; }
.pv-urls-block { margin-bottom: 8px; }
.pv-url-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.pv-url-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pv-url-row input { flex: 1; min-width: 0; }
.pv-url-remove {
    flex-shrink: 0;
    width: 32px;
    padding: 0 !important;
    font-size: 16px;
    line-height: 1;
}
.pv-add-url { margin-top: 2px; }
.pv-hist-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
}
.pv-hist-label {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #c2410c !important;
}
.pv-hist-num {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
}
.pv-hist-btn {
    margin-top: 8px !important;
    width: 100%;
    text-align: center;
    font-weight: 700 !important;
}
.pv-history-card h3 { margin-bottom: 10px; }
.perk-report-drawer {
    margin-top: 10px;
    border: 1px solid #fdba74;
    border-radius: 10px;
    background: #fff7ed;
    padding: 8px 10px;
}
.perk-report-drawer[open] { background: #fff; }
/* Keep tips above sidebar / cards */
.pv-task, .perk-task-card { overflow: visible !important; }
.pv-task-title-row { position: relative; z-index: 2; }
.perk-tip { z-index: 30; }

/* —— 2026-08-11: perk reports, pacing, ZeroRank priority, branded collapsed —— */
.pv-priority-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: linear-gradient(90deg, #fff7ed, #fff);
    border: 1px solid #fdba74;
    border-radius: 10px;
    font-size: 13px;
    color: #9a3412;
    line-height: 1.4;
}
.pv-task-zr {
    border-color: #fdba74 !important;
    box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.12);
}
.pv-zr-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #c2410c;
    color: #fff;
    padding: 2px 7px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}
.pv-pace-hint {
    margin: 8px 0;
    padding: 8px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 12.5px;
    color: #1e40af;
    line-height: 1.4;
}
.pv-hint-pace { color: #64748b !important; }
.pv-hist-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.pv-hist-head h3 { margin: 0 !important; }
.pv-hist-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-hist-grouped { display: flex; flex-direction: column; gap: 10px; }
.pv-hist-group {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.pv-hist-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #fff7ed;
    font-size: 12px;
    font-weight: 800;
    color: #9a3412;
    border-bottom: 1px solid #fed7aa;
}
.pv-hist-group-count {
    background: #fff;
    border: 1px solid #fdba74;
    color: #c2410c;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
}
.pv-hist-mini {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.pv-hist-mini li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    font-size: 12px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 32px;
}
.pv-hist-mini li:last-child { border-bottom: 0; }
.pv-hist-mini-body { min-width: 0; }
.pv-hist-mini a {
    display: block;
    min-width: 0;
    color: #c2410c;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.pv-hist-mini a:hover { text-decoration: underline; }
.pv-hist-mini-label {
    display: block;
    margin-top: 1px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}
.pv-hist-mini-n { color: #94a3b8; font-weight: 700; font-size: 11px; }
.pv-hist-mini-date { color: #94a3b8; font-size: 10px; white-space: nowrap; }
.pv-hist-foot {
    margin: 10px 0 0;
    font-size: 12px;
    text-align: center;
}
.pv-hist-foot a { color: #c2410c; font-weight: 700; }

/* Full client report page */
.pr-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.pr-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.pr-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.pr-summary-chip strong {
    background: #c2410c;
    color: #fff;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
}
.pr-section { margin-bottom: 16px; padding: 14px 16px; }
.pr-section h2 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #c2410c;
}
.pr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-table th, .pr-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.pr-table th { background: #fff7ed; color: #9a3412; font-size: 12px; }
.pr-table a { color: #1d4ed8; word-break: break-all; font-size: 12px; }
.pr-notes { margin-top: 4px; font-size: 11px; color: #64748b; }
.pr-print-header { margin-bottom: 12px; }
.pr-print-header h1 { font-size: 20px; margin: 0 0 6px; }
.pr-print-header .pr-meta { font-size: 13px; color: #475569; }
.pr-footer-note { font-size: 12px; color: #64748b; margin-top: 16px; }

/* Branded panel: never force open height; only expand when [open] */
.perk-branded-info:not([open]) .perk-branded-body { display: none; }
.perk-branded-info > summary { user-select: none; }
/* AdSense-inspired shell: left nav + top bar
   Accents: orange (brand). Text: dark like Google (#202124). */

:root {
    --sb-width: 256px;
    --sb-bg: #ffffff;
    --sb-border: #e8eaed;
    --sb-text: #202124;
    --sb-text-sec: #5f6368;
    --sb-hover: #f1f3f4;
    --sb-active-bg: #fff7ed;
    --sb-active: #c2410c;
    --sb-active-bar: #ea580c;
    --topbar-h: 56px;
    --font-ui: "Google Sans", Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
}

body.has-sidebar {
    margin: 0;
    background: #f8f9fa !important;
    font-family: var(--font-ui) !important;
    color: var(--sb-text) !important;
    overflow-x: hidden;
}

/* Kill old top header/nav when sidebar layout is active */
body.has-sidebar > header,
body.has-sidebar > nav {
    display: none !important;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sb-width);
    min-width: var(--sb-width);
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1200;
    overflow: hidden;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 16px;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}
.sb-collapse {
    margin-left: auto;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    background: #fff;
    color: #c2410c;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.sb-collapse:hover {
    background: #fff7ed;
    border-color: #d6d3d1;
}
.sb-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sb-brand-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--sb-text);
    line-height: 1.2;
}
.sb-brand-sub {
    font-size: 12px;
    color: var(--sb-text-sec);
    font-weight: 400;
}

.sb-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px 16px;
}

.sb-link,
.sb-group-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    margin: 1px 0;
    border: none;
    background: transparent;
    border-radius: 0 20px 20px 0;
    margin-right: 8px;
    width: calc(100% - 8px);
    color: var(--sb-text) !important;
    font-family: var(--font-ui) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    text-align: left;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    line-height: 1.25;
}
.sb-link:hover,
.sb-group-btn:hover {
    background: var(--sb-hover) !important;
    color: var(--sb-text) !important;
    transform: none !important;
}
.sb-link.is-active {
    background: var(--sb-active-bg) !important;
    color: var(--sb-active) !important;
}
.sb-link.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--sb-active-bar);
}

.sb-ico {
    width: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.9;
}
.sb-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sb-chevron {
    font-size: 10px;
    color: var(--sb-text-sec);
    transition: transform 0.15s ease;
}
.sb-group.is-open > .sb-group-btn .sb-chevron {
    transform: rotate(180deg);
}

.sb-sub {
    display: none;
    padding: 2px 0 6px 0;
}
.sb-group.is-open > .sb-sub {
    display: block;
}
.sb-sub .sb-link {
    min-height: 36px;
    padding-left: 44px;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #3c4043 !important;
}
.sb-sub .sb-link.is-active {
    color: var(--sb-active) !important;
    font-weight: 500 !important;
}
.sb-sub .sb-ico {
    display: none;
}

.sb-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ea580c;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sb-link.sb-inbox-hot .sb-badge {
    background: #b91c1c;
}
.topbar-inbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3c4043 !important;
    -webkit-text-fill-color: #3c4043 !important;
    text-decoration: none !important;
}
.topbar-inbox.is-hot {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
}
.topbar-inbox-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #b91c1c;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sb-footer {
    border-top: 1px solid var(--sb-border);
    padding: 12px;
    flex-shrink: 0;
}
.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.sb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sb-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-text);
}
.sb-user-role {
    font-size: 12px;
    color: var(--sb-text-sec);
}
.sb-logout {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-active) !important;
    text-decoration: none !important;
    padding: 6px 4px;
}

/* ===== MAIN + TOPBAR ===== */
.app-main {
    flex: 1;
    margin-left: var(--sb-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.sb-menu-btn {
    display: none;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--sb-text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.sb-menu-btn:hover {
    background: var(--sb-hover);
}
.topbar-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--sb-text);
    flex: 1;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-user {
    font-size: 13px;
    color: var(--sb-text-sec);
    font-weight: 500;
}
.topbar-logout {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-active) !important;
    text-decoration: none !important;
}

.content.container,
body.has-sidebar main.content.container,
body.has-sidebar .app-main main.container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 16px 24px 32px !important;
    flex: 1;
    box-sizing: border-box;
}

.app-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--sb-border);
    background: #fff;
    font-size: 12px;
    color: var(--sb-text-sec);
}
.app-footer p {
    margin: 0;
}

/* Typography alignment with Google-ish density */
body.has-sidebar h1,
body.has-sidebar h2 {
    color: var(--sb-text) !important;
    font-weight: 500 !important;
}
body.has-sidebar .ui-page-head h2 {
    font-size: 22px !important;
    font-weight: 400 !important;
    letter-spacing: 0;
    color: #202124 !important;
}
body.has-sidebar .ui-page-head p,
body.has-sidebar .form-help,
body.has-sidebar .text-muted {
    color: #5f6368 !important;
}
body.has-sidebar,
body.has-sidebar p,
body.has-sidebar td,
body.has-sidebar label,
body.has-sidebar span,
body.has-sidebar li {
    color: #3c4043;
}
body.has-sidebar strong,
body.has-sidebar b {
    color: #202124;
}

/* Backdrop for mobile */
.sb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.4);
    z-index: 1100;
}

/* Mobile */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    }
    body.sb-open .sidebar {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .sb-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .sb-collapse {
        display: none;
    }
    .content.container,
    body.has-sidebar main.content.container {
        padding: 12px 14px 24px !important;
    }
}

/* Login page keeps simple centered layout */
body.is-login {
    background: #f8f9fa !important;
}
body.is-login .login-main {
    max-width: 480px !important;
    margin: 48px auto !important;
    padding: 24px !important;
}

/* Desktop only: icons, flyout for groups, remembered in localStorage. */
@media (min-width: 961px) {
    html.sb-collapsed .sidebar {
        width: 64px;
        min-width: 64px;
    }
    html.sb-collapsed .app-main {
        margin-left: 64px;
    }
    html.sb-collapsed .sb-brand {
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        height: auto;
        min-height: var(--topbar-h);
        padding: 8px 6px;
    }
    html.sb-collapsed .sb-collapse {
        margin-left: 0;
    }
    html.sb-collapsed .sb-brand-text,
    html.sb-collapsed .sb-label,
    html.sb-collapsed .sb-user-meta,
    html.sb-collapsed .sb-chevron {
        display: none !important;
    }
    html.sb-collapsed .sb-nav {
        padding: 8px 4px 12px;
    }
    html.sb-collapsed .sb-link,
    html.sb-collapsed .sb-group-btn {
        justify-content: center;
        gap: 0;
        padding: 0;
        width: calc(100% - 4px);
        margin-right: 0;
        border-radius: 8px;
    }
    html.sb-collapsed .sb-link {
        position: relative;
    }
    html.sb-collapsed .sb-badge {
        position: absolute;
        top: 2px;
        right: 4px;
        min-width: 14px;
        height: 14px;
        padding: 0 3px;
        font-size: 9px;
    }
    html.sb-collapsed .sb-group {
        position: relative;
    }
    html.sb-collapsed .sb-group.is-open > .sb-sub {
        display: block;
        position: absolute;
        left: calc(100% + 6px);
        top: 0;
        min-width: 200px;
        background: #fff;
        border: 1px solid #e8eaed;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(60, 64, 67, 0.12);
        z-index: 1400;
        padding: 6px;
    }
    html.sb-collapsed .sb-sub .sb-link {
        justify-content: flex-start;
        padding: 0 12px;
        width: 100%;
    }
    html.sb-collapsed .sb-sub .sb-label {
        display: block !important;
    }
    html.sb-collapsed .sb-footer {
        padding: 8px 6px;
    }
    html.sb-collapsed .sb-user {
        justify-content: center;
        margin-bottom: 4px;
    }
    html.sb-collapsed .sb-logout {
        text-align: center;
        font-size: 0 !important;
        padding: 6px 0;
    }
    html.sb-collapsed .sb-logout::before {
        content: "↪";
        font-size: 16px;
    }
}
/* Shared UI tokens and components.
   Colours are sampled from style.css :root and sidebar.css.
   Orange #ea580c / #c2410c, navy #1e293b, sand #fff7ed.
   Loaded last so one product wins over older one-off sheets. */

:root {
    --color-primary: #ea580c;
    --color-primary-dark: #c2410c;
    --color-primary-light: #f97316;
    --color-navy: #1e293b;
    --color-navy-soft: #334155;
    --color-ink: #0a0f1a;
    --color-muted: #5f6368;
    --color-line: #e8eaed;
    --color-line-strong: #cbd5e1;
    --color-sand: #fff7ed;
    --color-sand-2: #ffedd5;
    --color-peach: #fed7aa;
    --color-card: #ffffff;
    --color-danger: #b91c1c;
    --color-ok: #047857;
    --color-zebra: #fff7ed;
    --color-page: #f8f9fa;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;

    --radius-1: 4px;
    --radius-2: 6px;
    --radius-3: 8px;
    --radius-4: 12px;

    --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-2: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-3: 0 12px 28px rgba(15, 23, 42, 0.12);

    --text-xs: 10px;
    --text-sm: 12px;
    --text-md: 13px;
    --text-lg: 16px;
    --text-xl: 18px;

    --font-ui: "Google Sans", Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;

    --primary-color: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #f97316;
    --secondary-color: #1e293b;
    --danger-color: #b91c1c;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* ===== Buttons: primary, secondary, danger ===== */
.btn,
a.btn,
button.btn {
    display: inline-block !important;
    padding: 5px 10px !important;
    font-family: var(--font-ui) !important;
    font-size: var(--text-sm) !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: var(--radius-2) !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    box-shadow: none !important;
    background-image: none !important;
    transform: none !important;
}

.btn::before,
.btn::after {
    display: none !important;
    content: none !important;
}

.btn-sm {
    padding: 3px 8px !important;
    font-size: 11px !important;
}

.btn-primary,
a.btn-primary,
button.btn-primary {
    background: var(--color-primary) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: var(--color-primary-dark) !important;
}

.btn-primary:hover {
    background: var(--color-primary-dark) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.btn-success,
a.btn-success,
button.btn-success {
    background: #047857 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: #065f46 !important;
}

.btn-success:hover {
    background: #065f46 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.btn-secondary,
.btn-info,
.btn-warning,
.btn-outline,
a.btn-secondary,
a.btn-info,
a.btn-warning,
a.btn-outline,
button.btn-secondary,
button.btn-info,
button.btn-warning,
button.btn-outline {
    background: #fff !important;
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    border: 1px solid #e8eaed !important;
}

.btn-secondary:hover,
.btn-info:hover,
.btn-warning:hover,
.btn-outline:hover {
    background: #fff7ed !important;
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    border-color: #d6d3d1 !important;
}

.btn-danger,
a.btn-danger,
button.btn-danger {
    background: var(--color-danger) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: #991b1b !important;
}

.btn-danger:hover {
    background: #991b1b !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.btn-stack {
    display: block !important;
    margin-top: var(--space-1) !important;
}

.ui-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* ===== Page chrome shared by dashboard, reports, perks ===== */
body.has-sidebar .ui-page-head,
body.has-sidebar .perk-page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-2) var(--space-3);
    margin: 0 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-line);
}

body.has-sidebar .ui-page-head h2,
body.has-sidebar .perk-page-header h2,
body.has-sidebar .pv-head h2 {
    margin: 0 0 2px;
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-ink) !important;
    -webkit-text-fill-color: var(--color-ink) !important;
}

body.has-sidebar .ui-page-head p,
body.has-sidebar .perk-page-header p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-muted) !important;
    -webkit-text-fill-color: var(--color-muted) !important;
}

body.has-sidebar .card {
    background: var(--color-card) !important;
    border: 1px solid var(--color-line) !important;
    border-radius: var(--radius-3) !important;
    box-shadow: var(--shadow-1) !important;
}

body.has-sidebar .ui-kpis {
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

body.has-sidebar .ui-kpi {
    background: var(--color-card);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-1);
    padding: var(--space-2) var(--space-1);
}

body.has-sidebar .ui-kpi strong {
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
    font-size: var(--text-lg);
}

body.has-sidebar .ui-kpi a {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    text-decoration: none;
}

.wd-card-head h3 {
    margin: 0;
    font-size: var(--text-md);
}

body.has-sidebar .ui-kpi-accent {
    background: var(--color-sand);
    border-color: var(--color-peach);
}

body.has-sidebar .ui-toolbar {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-3);
    box-shadow: var(--shadow-1);
}

/* ===== Tables: sand header, zebra, stacked under 700px ===== */
body.has-sidebar table thead,
body.has-sidebar table th {
    background: #fff7ed !important;
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
}

table.data-table thead,
table.wd-pace-table thead,
table.pr-table thead,
table.ar-table thead {
    background: #fff7ed !important;
}

table.data-table th,
table.wd-pace-table th,
table.pr-table th,
table.ar-table th {
    background: #fff7ed !important;
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
    font-size: var(--text-xs) !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    padding: 6px 8px !important;
    border: none !important;
    border-bottom: 1px solid #e8eaed !important;
}

table.data-table tbody tr:nth-child(even) td,
table.wd-pace-table tbody tr:nth-child(even) td,
table.pr-table tbody tr:nth-child(even) td,
table.ar-table tbody tr:nth-child(even) td {
    background: var(--color-zebra) !important;
}

table.data-table tbody tr:hover td,
table.wd-pace-table tbody tr:hover td,
table.pr-table tbody tr:hover td,
table.ar-table tbody tr:hover td {
    background: var(--color-sand-2) !important;
}

table.data-table tr.wd-pace-me td,
table.wd-pace-table tr.wd-pace-me td {
    background: var(--color-sand-2) !important;
}

table.data-table tr.worker-separator td,
table.ar-table tr.worker-separator td {
    background: var(--color-sand-2) !important;
    color: var(--color-ink) !important;
    -webkit-text-fill-color: var(--color-ink) !important;
}

.ar-proof-n {
    background: #fff7ed !important;
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    border: 1px solid #e8eaed !important;
}

.ar-proof-n:hover {
    background: #ffedd5 !important;
    border-color: #d6d3d1 !important;
}

.pk-empty,
.pv-clear {
    text-align: center;
    padding: var(--space-4);
    color: var(--color-navy-soft);
    font-size: var(--text-sm);
}

@media (max-width: 700px) {
    .table-container,
    .table-responsive,
    .ar-table-wrap,
    .wd-pace-scroll {
        overflow-x: visible !important;
        border: none !important;
        box-shadow: none !important;
    }

    table.data-table,
    table.wd-pace-table,
    table.pr-table,
    table.ar-table {
        min-width: 0 !important;
        width: 100% !important;
        display: block !important;
        table-layout: auto !important;
        border: none !important;
    }

    table.data-table thead,
    table.wd-pace-table thead,
    table.pr-table thead,
    table.ar-table thead {
        display: none !important;
    }

    table.data-table tbody,
    table.wd-pace-table tbody,
    table.pr-table tbody,
    table.ar-table tbody,
    table.data-table tr,
    table.wd-pace-table tr,
    table.pr-table tr,
    table.ar-table tr {
        display: block !important;
        width: 100% !important;
    }

    table.data-table tr,
    table.wd-pace-table tr,
    table.pr-table tr,
    table.ar-table tr {
        margin: 0 0 var(--space-2) !important;
        padding: 2px 0 !important;
        border: 1px solid var(--color-line) !important;
        border-radius: var(--radius-2) !important;
        background: #fff !important;
    }

    table.data-table td,
    table.wd-pace-table td,
    table.pr-table td,
    table.ar-table td {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        text-align: right !important;
        white-space: normal !important;
        word-break: break-word !important;
        position: relative !important;
        padding: 6px 10px 6px 42% !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        background: transparent !important;
    }

    table.data-table td:last-child,
    table.wd-pace-table td:last-child,
    table.pr-table td:last-child,
    table.ar-table td:last-child {
        border-bottom: none !important;
    }

    table.data-table td[data-label]::before,
    table.wd-pace-table td[data-label]::before,
    table.pr-table td[data-label]::before,
    table.ar-table td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 6px;
        width: 38%;
        text-align: left;
        font-size: var(--text-xs);
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--color-navy) !important;
        -webkit-text-fill-color: var(--color-navy) !important;
    }

    table.data-table td[colspan],
    table.wd-pace-table td[colspan],
    table.pr-table td[colspan],
    table.ar-table td[colspan],
    table.data-table tr.worker-separator td,
    table.ar-table tr.worker-separator td {
        padding-left: 10px !important;
        text-align: left !important;
    }

    table.data-table td[colspan]::before,
    table.ar-table tr.worker-separator td::before {
        content: none !important;
        display: none !important;
    }

    .ar-when,
    .ar-time,
    .ar-proof,
    .ar-worker,
    .ar-details-cell,
    .ar-proj-task {
        white-space: normal !important;
        max-width: none !important;
        width: auto !important;
    }
}

/* ===== Work perks ===== */
.perk-split {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
    gap: var(--space-3) !important;
    align-items: start !important;
}

.perk-header-badges,
.pr-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.perk-back {
    margin: 0 0 2px;
    font-size: var(--text-sm);
}

.perk-back a {
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
    text-decoration: none;
    font-weight: 600;
}

.pv-progress {
    margin: 0 0 var(--space-3);
}

.pv-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: 4px;
    font-size: var(--text-sm);
    color: var(--color-navy-soft);
}

.pv-progress-meta strong {
    font-size: var(--text-lg);
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
}

.pv-brief-bar {
    margin-bottom: var(--space-3);
}

.pv-guides {
    margin: 0 0 var(--space-3);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-3);
    background: #fff;
    padding: 0 var(--space-3);
}

.pv-guides > summary {
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-navy);
    padding: var(--space-2) 0;
    list-style: none;
}

.pv-guides > summary::-webkit-details-marker {
    display: none;
}

.pv-guides > summary::before {
    content: "▸ ";
    color: var(--color-primary);
}

.pv-guides[open] > summary::before {
    content: "▾ ";
}

.pv-section {
    margin: 0 0 var(--space-4);
}

.pv-section-head {
    margin: 0 0 var(--space-2);
}

.pv-section-head h3,
.perk-section-title {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
}

.pv-section-head h3 {
    margin: 0;
}

.pv-section-note {
    margin: 0 0 var(--space-2);
    font-size: 11px;
    color: var(--color-muted);
}

.pv-task-grid,
.pk-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2);
}

.pv-task {
    padding: var(--space-3) !important;
    margin: 0 !important;
}

.perk-task-card-head,
.pv-section-head,
.pk-card-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 6px;
}

.pv-task-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pv-task-title-row h3 {
    margin: 0;
    font-size: var(--text-md) !important;
    font-weight: 700;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    color: var(--color-ink) !important;
}

.pv-remain {
    flex-shrink: 0;
    background: var(--color-sand);
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
    border: 1px solid var(--color-peach);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: var(--text-sm);
    font-weight: 800;
    white-space: nowrap;
}

.pv-remain.is-done {
    background: #ecfdf5;
    color: var(--color-ok) !important;
    -webkit-text-fill-color: var(--color-ok) !important;
    border-color: #a7f3d0;
}

.pv-zr-badge {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.perk-report-drawer {
    margin: 0 0 var(--space-2);
    padding: 0;
    border: none;
    background: transparent;
}

.perk-report-drawer > summary.btn {
    display: inline-block !important;
    width: auto !important;
    list-style: none !important;
    cursor: pointer;
}

.perk-report-drawer > summary.btn::-webkit-details-marker {
    display: none;
}

.perk-report-drawer[open] .perk-report-form {
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-3);
    border: 1px solid var(--color-peach);
    border-radius: var(--radius-2);
    background: var(--color-sand);
}

.pv-share-note {
    display: block;
    color: var(--color-primary-dark);
    font-weight: 600;
}

.pv-item-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 6px;
}

.pv-item-card {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-2);
    background: #fff;
    font-size: var(--text-sm);
    line-height: 1.35;
    color: var(--color-ink);
}

.pv-item-card.is-done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: var(--color-ok);
}

.pv-done {
    margin: 0 0 var(--space-4);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-3);
    background: #fff;
    padding: 0 var(--space-3) var(--space-2);
}

.pv-done > summary {
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-navy);
    padding: var(--space-2) 0;
    list-style: none;
}

.pv-done > summary::-webkit-details-marker {
    display: none;
}

.pv-history {
    margin: 0 0 var(--space-4);
    padding: var(--space-3) !important;
}

.pv-hist-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.pv-hist-head h3 {
    margin: 0;
    font-size: var(--text-md);
}

.pv-hist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pv-hist-group {
    margin-bottom: var(--space-2);
}

.pv-hist-group-title {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    margin-bottom: 4px;
}

.pv-hist-group-count {
    background: var(--color-sand);
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
    border-radius: 999px;
    padding: 0 7px;
    font-size: 11px;
}

.pv-hist-mini {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pv-hist-grouped {
    max-height: none;
    overflow: visible;
}

.pv-hist-mini li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 32px;
    padding: 6px 8px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-2);
    background: #fff;
    font-size: var(--text-sm);
}

.pv-hist-mini-body {
    min-width: 0;
}

.pv-hist-mini a {
    display: block;
    min-width: 0;
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pv-hist-mini-label {
    display: block;
    margin-top: 1px;
    color: var(--color-muted) !important;
    -webkit-text-fill-color: var(--color-muted) !important;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
}

.pv-hist-mini-n,
.pv-hist-mini-date {
    color: var(--color-muted) !important;
    -webkit-text-fill-color: var(--color-muted) !important;
    font-size: 11px;
    white-space: nowrap;
}

.pv-hist-foot {
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
}

.pv-edit {
    margin: 0 0 var(--space-3);
    padding: 0 !important;
}

.pv-edit-sum {
    cursor: pointer;
    font-weight: 700;
    font-size: var(--text-md);
    padding: var(--space-2) var(--space-3);
    list-style: none;
}

.pv-edit-sum::-webkit-details-marker {
    display: none;
}

.pv-edit-form,
.perk-status-form {
    padding: 0 var(--space-3) var(--space-3);
}

.pv-edit-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 130px;
    gap: var(--space-2);
}

.pv-status-block {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-line);
}

.perk-pack-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px !important;
}

.perk-pack-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center;
    gap: 4px 6px;
    min-width: 0;
    background: #fff !important;
    border: 1px solid var(--color-line) !important;
    border-radius: var(--radius-2) !important;
    padding: 6px 8px !important;
}

.perk-pack-row.is-on {
    border-color: var(--color-primary) !important;
    background: var(--color-sand) !important;
}

.perk-pack-row-label {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    font-size: var(--text-sm) !important;
    line-height: 1.3 !important;
}

.perk-pack-qty-label {
    display: none !important;
}

.perk-pack-qty-input {
    width: 44px !important;
    max-width: 44px !important;
    padding: 2px 4px !important;
}

.perk-overview-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.perk-overview-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
    font-size: 11px;
}

.perk-sheet-banner {
    background: var(--color-sand) !important;
    border: 1px solid var(--color-peach) !important;
    border-radius: var(--radius-2) !important;
}

.perk-sheet-banner strong {
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
}

.perk-overview-item {
    display: block;
    text-decoration: none !important;
    color: inherit;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-2);
    padding: 8px 10px;
    background: #fff;
}

.perk-overview-item:hover {
    border-color: var(--color-peach);
    background: var(--color-sand);
}

.perk-branded-foot {
    margin: 8px 0 0;
    font-size: var(--text-sm);
}

/* My perks cards */
.pk-card {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    padding: var(--space-3) !important;
}

.pk-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-2);
}

.pk-card-title {
    display: block;
    font-size: var(--text-md);
    color: var(--color-ink) !important;
    -webkit-text-fill-color: var(--color-ink) !important;
}

.pk-card-meta,
.pk-next,
.pk-days {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--color-muted) !important;
    -webkit-text-fill-color: var(--color-muted) !important;
}

.pk-next {
    margin-top: var(--space-2);
    color: var(--color-navy) !important;
    -webkit-text-fill-color: var(--color-navy) !important;
    font-weight: 600;
}

.pk-ring {
    --pct: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) calc(var(--pct) * 1%), var(--color-sand-2) 0);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.pk-ring span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--color-primary-dark) !important;
    -webkit-text-fill-color: var(--color-primary-dark) !important;
}

.pk-card-foot {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: 11px;
    color: var(--color-navy-soft) !important;
}

@media (min-width: 701px) {
    .pv-item-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .pv-task-grid,
    .pk-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .perk-split,
    .perk-mini-grid,
    .pv-edit-meta,
    .perk-pack-grid,
    .mr-row {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .perk-header-badges,
    .ui-page-head .ui-actions,
    .ui-toolbar {
        width: 100%;
    }

    .pv-edit-task-top,
    .pv-hist-mini li {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .ui-field select,
    .ui-field input[type="date"],
    .ui-field input[type="text"] {
        max-width: none;
        width: 100% !important;
    }

    table.data-table td.rw-cell,
    table.ar-table td.rw-cell {
        padding: 8px 10px 12px !important;
        text-align: left !important;
    }

    table.data-table td.rw-cell::before,
    table.ar-table td.rw-cell::before {
        content: none !important;
        display: none !important;
    }

    table.data-table tr.rw-hold,
    table.ar-table tr.rw-hold {
        border: none !important;
        background: transparent !important;
        margin-top: -6px !important;
        padding: 0 !important;
    }
}

/* Where the time went — task report window. Readable at 390px. */
.rw {
    margin: 0;
    max-width: 100%;
}
.rw-toggle {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.rw-toggle::before {
    content: "▸ ";
}
.rw-toggle[aria-expanded="true"]::before {
    content: "▾ ";
}
.rw-body {
    margin-top: 6px;
    max-width: 100%;
}
.rw-window,
.rw-note,
.rw-empty {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    margin: 0 0 4px;
    word-break: break-word;
}
.rw-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    margin: 0 0 6px;
    color: #3c4043;
}
.rw-flag {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
}
.rw-stack {
    display: flex;
    height: 10px;
    border-radius: 99px;
    overflow: hidden;
    background: #e2e8f0;
    margin: 0 0 8px;
}
.rw-stack span {
    display: block;
    height: 100%;
}
.rw-domain {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 8px;
    margin: 0 0 7px;
    align-items: baseline;
}
.rw-domain-name {
    font-weight: 700;
    font-size: 12px;
    color: #3c4043;
    word-break: break-word;
}
.rw-mins {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}
.rw-domain-meta {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
}
.rw-bar {
    grid-column: 1 / -1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.rw-bar > span {
    display: block;
    height: 100%;
}
.rw-off {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: #7f1d1d;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    vertical-align: 1px;
}
.rw-shots {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    padding: 2px 0 6px;
    -webkit-overflow-scrolling: touch;
}
.rw-shots a {
    flex: 0 0 auto;
}
.rw-shots img {
    width: 96px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    display: block;
    background: #f8fafc;
}
.rw-cell {
    text-align: left !important;
    padding-top: 0 !important;
}
@media (max-width: 420px) {
    .rw-shots img {
        width: 84px;
        height: 52px;
    }
    .rw-mins {
        white-space: normal;
    }
}

.ri-block {
    margin: 6px 0;
}
.ri-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #9a3412;
    margin: 0 0 3px;
}
.ri-count {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    font-weight: 800;
    color: #9a3412;
}
.ri-drop {
    position: relative;
    border: 1px dashed #fdba74;
    background: #fff7ed;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
}
.ri-drop.is-over {
    border-color: #ea580c;
    background: #ffedd5;
}
.ri-drop-copy {
    font-size: 12px;
    line-height: 1.35;
    color: #9a3412;
}
.ri-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.ri-camera-btn {
    display: none !important;
    margin-left: 6px !important;
    vertical-align: 0 !important;
}
@media (max-width: 800px), (pointer: coarse) {
    .ri-camera-btn {
        display: inline-flex !important;
    }
}
.ri-tiles {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    margin-top: 6px;
    -webkit-overflow-scrolling: touch;
}
.ri-tiles:empty {
    display: none;
}
.ri-tile {
    position: relative;
    flex: 0 0 auto;
    width: 96px;
}
.ri-tile img {
    width: 96px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    display: block;
    background: #f8fafc;
}
.ri-tile.is-bad img {
    border-color: #fca5a5;
    opacity: 0.55;
}
.ri-x {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 99px !important;
    background: #7f1d1d !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 18px !important;
    cursor: pointer;
}
.ri-bar {
    height: 3px;
    margin-top: 3px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.ri-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #ea580c;
}
.ri-state {
    font-size: 10px;
    font-weight: 700;
    color: #9a3412;
    line-height: 1.2;
    min-height: 0;
}
.ri-tile.is-bad .ri-state {
    color: #b91c1c;
}
.ri-note {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
}
.ri-lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 12px 12px;
    background: rgba(15, 23, 42, 0.86);
}
.ri-lightbox img {
    max-width: min(1100px, 96vw);
    max-height: 90vh;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.ri-lightbox-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border: 1px solid #e8eaed !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer;
}
.ri-review-label {
    display: block;
    margin: 8px 0 4px;
    font-size: 12px;
    font-weight: 700;
}
.ri-manager .ri-label {
    color: #9f1239;
}
.ri-manager .rw-shots img {
    border-color: #fecaca;
}
.rw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 4600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 52px 44px;
    background: rgba(15, 23, 42, 0.92);
    touch-action: none;
}
.rw-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #0f172a;
}
.rw-lightbox-x,
.rw-lightbox-nav {
    position: absolute;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 44px !important;
    text-align: center !important;
    cursor: pointer;
}
.rw-lightbox-x { top: 8px; right: 8px; }
.rw-lightbox-prev { left: 6px; top: 50%; margin-top: -22px; }
.rw-lightbox-next { right: 6px; top: 50%; margin-top: -22px; }
.rw-lightbox-nav[hidden] { display: none !important; }
.rw-lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}
.rw-lightbox-cap {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    text-align: center;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 13px;
    font-weight: 700;
}
@media (max-width: 420px) {
    .ri-tile,
    .ri-tile img {
        width: 84px;
    }
    .ri-tile img {
        height: 52px;
    }
}

/* Card headers were a dark blue bar. Sand, warm text. */
body.has-sidebar .card-header {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border-bottom: 1px solid #e8eaed !important;
}
body.has-sidebar .card-header h2,
body.has-sidebar .card-header h3 {
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
}

/* One collapse control for any [data-fold] panel. */
.fold-head {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.fold-title {
    font-size: 12px;
    font-weight: 700;
    color: #9a3412;
}
.fold-btn {
    margin-left: auto !important;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    padding: 0 !important;
    border: 1px solid #e8eaed !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer;
    box-shadow: none !important;
}
.fold-btn:hover {
    background: #fff7ed !important;
    border-color: #d6d3d1 !important;
}
.perk-task-card-head.fold-head,
.pv-section-head.fold-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
}
.perk-task-card-head.fold-head .fold-btn,
.pv-section-head.fold-head .fold-btn {
    margin-left: 0 !important;
}
.ui-kpis > .fold-head,
.an-kpis > .fold-head {
    grid-column: 1 / -1;
}
h2.fold-head,
h3.fold-head,
summary.fold-head {
    display: flex !important;
    align-items: center;
    gap: 8px;
}
summary.fold-head::before,
summary.fold-head::-webkit-details-marker {
    content: none !important;
    display: none !important;
}
[data-fold-start="closed"]:not(.fold-ready) > :nth-child(n + 2) {
    display: none;
}
[data-fold].is-folded > :not(.fold-head) {
    display: none !important;
}
.perk-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.pk-done {
    margin-top: 16px;
}
.pk-month {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fff;
    margin: 0 0 8px;
    padding: 0 10px 10px;
}
.pk-month.is-folded {
    padding-bottom: 0;
}
.pk-month-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    font-size: 13px;
    font-weight: 700;
    color: #9a3412;
    cursor: pointer;
}
@media (max-width: 420px) {
    .fold-btn,
    .sb-collapse {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }
    .pk-month-head {
        font-size: 13px;
    }
}
@media print {
    [data-fold].is-folded > :not(.fold-head) {
        display: revert !important;
    }
}

/* Review list: resubmitted badge, in-place approve edge, toast. No dark fills. */
.badge-resub {
    display: inline-block;
    margin-top: 3px;
    background: #ea580c !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    line-height: 1.4;
}
.tr-drill {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #3c4043;
}
.tr-drill a {
    color: #c2410c;
    font-weight: 700;
}

.ar-asked {
    margin-top: 3px;
    max-width: 150px;
    font-size: 10px;
    line-height: 1.3;
    color: #9a3412;
}
.rv-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.rv-done {
    font-size: 12px;
    font-weight: 700;
}
.rv-done-ok { color: #047857; }
.rv-done-no { color: #b91c1c; }
.rv-undo {
    padding: 2px 6px !important;
    min-height: 22px !important;
    font-size: 11px !important;
}
.rv-error,
.rv-form-error {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
    margin: 4px 0 0;
}
tr.rv-edge-ok td {
    background: #f0fdf4 !important;
}
tr.rv-edge-ok td:first-child {
    box-shadow: inset 3px 0 0 #047857;
}
tr.rv-edge-no td {
    background: #fef2f2 !important;
}
tr.rv-edge-no td:first-child {
    box-shadow: inset 3px 0 0 #b91c1c;
}
.ddr-tile.rv-edge-ok {
    background: #f0fdf4;
    box-shadow: inset 3px 0 0 #047857;
}
.ddr-tile.rv-edge-no {
    background: #fef2f2;
    box-shadow: inset 3px 0 0 #b91c1c;
}
.rv-toast {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 4000;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.rv-toast[hidden] { display: none; }

/* Checkboxes stay visible. style.css strips appearance from every input. */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    width: 14px;
    height: 14px;
    margin: 0 4px 0 0;
    vertical-align: middle;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.time-spent-cell { font-weight: 700; }
.time-spent-cell.under-expected { color: #047857; }
.time-spent-cell.at-expected { color: #c2410c; }
.time-spent-cell.over-expected { color: #b91c1c; }
.traqq-score {
    font-weight: 700;
    display: inline-block;
    min-width: 42px;
    text-align: center;
    border-radius: 4px;
    padding: 1px 6px;
}
.traqq-excellent { background: #d1fae5; color: #065f46; }
.traqq-good { background: #ffedd5; color: #9a3412; }
.traqq-warning { background: #fef3c7; color: #92400e; }

/* Perk help opens beside the mark, not under the sidebar. */
.perk-tip { position: relative !important; z-index: 40 !important; }
.perk-tip-bubble,
.card .perk-tip-bubble,
.pv-task .perk-tip-bubble,
.perk-pack-row .perk-tip-bubble {
    display: none;
    position: absolute !important;
    left: calc(100% + 10px) !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    background: #fff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    border: 1px solid #fb923c !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    padding: 10px 12px !important;
    max-width: 280px !important;
    width: min(280px, 70vw) !important;
    z-index: 8000 !important;
    white-space: normal !important;
    text-align: left !important;
}
.perk-tip:hover .perk-tip-bubble,
.perk-tip:focus-within .perk-tip-bubble { display: block !important; }
.perk-tip-bubble,
.perk-tip-bubble * {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}
.perk-tip-bubble a,
.perk-tip-bubble .perk-tip-link {
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
    font-weight: 700 !important;
}

/* The page itself never scrolls sideways. Tables wrap or stack. */
html,
body,
.app-shell,
.app-main,
main.content,
main.container {
    max-width: 100%;
    overflow-x: hidden;
}
.app-main,
main.content,
.card,
.set-card,
.modal-content,
.ui-toolbar,
.ui-page-head,
form {
    min-width: 0;
}
img, svg, video, canvas, iframe, pre, code, table {
    max-width: 100%;
}
.table-container,
.table-responsive,
.ar-table-wrap,
.an-table-wrap {
    overflow-x: hidden !important;
    max-width: 100%;
}
table,
.data-table,
.reports-table,
.users-table,
.projects-table,
.tasks-table,
.ddr-task-table,
.mdr-task-table {
    min-width: 0 !important;
    width: 100%;
}
main th,
main td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.topbar {
    min-width: 0;
    max-width: 100%;
}
.topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-right {
    flex-shrink: 0;
    min-width: 0;
}
.modal-content {
    max-width: min(520px, calc(100vw - 24px));
    box-sizing: border-box;
}

/* Settings cards. */
.settings-page { max-width: 100%; }
.set-lead, .set-help {
    margin: 2px 0 8px;
    color: #5f6368;
    font-size: 12px;
    line-height: 1.4;
    max-width: 70ch;
}
.set-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 12px;
    margin: 0 0 12px;
    max-width: 100%;
}
.set-card h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}
.set-card-head, .set-actions, .set-inline, .set-row-actions, .set-danger-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.set-card-head, .set-danger-row { justify-content: space-between; align-items: flex-start; }
.set-sub { margin: 14px 0 4px; font-size: 13px; color: #1e293b; }
.set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 10px;
}
.set-field { min-width: 0; margin: 0 0 8px; }
.set-field label, .set-check label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 2px;
}
.set-check { margin: 0 0 8px; }
.set-check label { font-weight: 600; }
.set-field .form-control,
.set-inline .form-control,
.set-danger select.form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.set-mins { width: 88px !important; max-width: 88px !important; }
.set-days { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.set-days label { font-size: 13px; font-weight: 500; margin: 0; }
.set-code {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-all;
    font-size: 12px;
}
.set-danger {
    border-color: #fecaca;
    border-left: 4px solid #b91c1c;
    background: #fff;
}
.set-danger h3 { color: #991b1b; }
.set-danger-row {
    border-top: 1px solid #fecaca;
    padding: 10px 0;
}
.set-danger-row h4 { margin: 0 0 2px; font-size: 13px; }

/* Screen Options. */
.so-wrap { position: relative; display: inline-flex; }
.so-btn {
    border: 1px solid #e8eaed;
    background: #fff;
    color: #c2410c;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1.3;
}
.so-btn:hover { background: #fff7ed; }
.so-panel {
    position: fixed;
    top: 52px;
    right: 8px;
    width: min(300px, calc(100vw - 16px));
    max-height: calc(100vh - 68px);
    overflow: auto;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 4000;
    padding: 8px 10px 10px;
}
.so-panel[hidden] { display: none !important; }
.so-group { padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.so-group:last-child { border-bottom: 0; }
.so-group strong { display: block; font-size: 12px; margin: 0 0 4px; color: #1e293b; }
.so-check {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 4px;
    color: #1e293b;
}
.so-rows {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
}
.so-rows select { max-width: 90px; }
th.so-off, td.so-off, tr.so-off { display: none !important; }

a.sb-link.sb-primary {
    font-weight: 800 !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    box-shadow: inset 3px 0 0 #ea580c;
}
a.sb-link.sb-primary .sb-label { font-weight: 800 !important; }
a.sb-link.sb-primary.is-active { background: #ffedd5 !important; }

@media (max-width: 700px) {
    .topbar { padding: 0 8px; gap: 6px; }
    .topbar-user { display: none; }
    .topbar-right { gap: 6px; }
    main table {
        min-width: 0 !important;
        width: 100% !important;
        display: block !important;
    }
    main table thead { display: none !important; }
    main table tbody,
    main table tr,
    main table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
    main table tr {
        margin: 0 0 8px !important;
        padding: 2px 0 !important;
        border: 1px solid #e8eaed !important;
        border-radius: 6px !important;
        background: #fff !important;
    }
    main table td {
        text-align: right !important;
        padding: 6px 10px 6px 42% !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        position: relative !important;
    }
    main table td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 6px;
        width: 38%;
        text-align: left;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #1e293b;
        white-space: normal;
    }
    main table td[colspan],
    main table tr.worker-separator td {
        padding-left: 10px !important;
        text-align: left !important;
    }
    main table td[colspan]::before,
    main table tr.worker-separator td::before {
        content: none !important;
        display: none !important;
    }
    main table tr.so-off,
    main table td.so-off,
    main table th.so-off { display: none !important; }
    .perk-tip-bubble,
    .card .perk-tip-bubble {
        left: 0 !important;
        top: calc(100% + 6px) !important;
        transform: none !important;
        width: min(280px, calc(100vw - 32px)) !important;
    }
}

/* Custom range. .ui-field is display:flex, which would ignore the hidden attribute. */
.ui-field[hidden],
.js-period-date[hidden],
.an-custom[hidden] {
    display: none !important;
}
.period-error {
    margin: 0 0 10px;
    padding: 8px 10px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Submit task report. Small columns. The page does not stretch across the screen. */
.sr-page {
    max-width: 720px;
}
.card.sr-card {
    overflow: visible;
}
.sr-cols {
    display: grid;
    grid-template-columns: 9.2rem minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 8px 10px;
    margin-bottom: 8px;
}
.sr-pair {
    display: grid;
    grid-template-columns: 4.6rem 5.6rem;
    gap: 8px 10px;
    margin: 8px 0 4px;
}
.sr-page .form-group {
    margin-bottom: 8px;
    min-width: 0;
}
.sr-cols .form-group,
.sr-pair .form-group {
    margin-bottom: 0;
}
.sr-page .form-control,
.sr-page select.form-control,
.sr-page input.form-control {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
}
.sr-cols input[type="date"] {
    min-width: 0;
    width: 100%;
}
.sr-page textarea.form-control {
    min-height: 48px;
    max-height: 110px;
}
.sr-mins {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
}
.sr-page .form-help,
.sr-page .form-group small {
    margin-top: 2px;
    font-size: 11px;
}
.sr-page #time-status-display {
    margin: 4px 0 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}
.sr-page #task-link-requirements,
.sr-page #google-sheets-reminder {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
}
.sr-page #add-link-btn {
    margin-top: 6px;
}
.sr-page .form-actions {
    margin-top: 4px;
}
@media (max-width: 700px) {
    .sr-cols {
        grid-template-columns: 1fr 1fr;
    }
    .sr-cols .form-group:last-child {
        grid-column: 1 / -1;
    }
}

/* SOP reading page and acceptance gate */
.sop-meta {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}
.sop-status {
    margin: 6px 0 0;
    font-weight: 700;
    color: #1e293b;
}
.sop-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 42rem);
    gap: 20px;
    align-items: start;
    margin: 0 0 16px;
}
.sop-toc {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 10px 12px;
}
.sop-toc-toggle {
    display: none;
}
.sop-toc ol {
    margin: 0;
    padding-left: 18px;
}
.sop-toc li {
    margin: 4px 0;
    font-size: 13px;
}
.sop-toc a {
    color: #9a3412;
    text-decoration: none;
}
.sop-toc a:hover {
    text-decoration: underline;
}
.sop-search-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
}
.sop-search {
    max-width: 42rem;
    margin: 0 0 12px;
}
.sop-prose {
    max-width: 42rem;
    line-height: 1.6;
    color: #1e293b;
    font-size: 15px;
}
.sop-prose h2 {
    margin: 1.4em 0 0.4em;
    font-size: 1.25rem;
    color: #1e293b;
}
.sop-prose h3 {
    margin: 1.1em 0 0.3em;
    font-size: 1.05rem;
    color: #9a3412;
}
.sop-prose p,
.sop-prose li {
    margin: 0.4em 0;
}
.sop-prose ul,
.sop-prose ol {
    padding-left: 1.3em;
}
.sop-block[hidden],
.sop-toc li[hidden],
#sop-body[hidden] {
    display: none !important;
}
.sop-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.sop-table th,
.sop-table td {
    border: 1px solid #e8eaed;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.sop-table th {
    background: #fff7ed;
}
.sop-history {
    margin: 0;
    padding-left: 18px;
}
.sop-history li {
    margin: 0 0 8px;
}
.sop-note {
    display: block;
    color: #475569;
    font-size: 13px;
}
.sop-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 700;
}
.sop-editor {
    min-height: 280px;
    max-height: 480px;
    overflow: auto;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    margin: 0 0 12px;
}
.sop-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
}
.sop-choice {
    display: block;
    margin: 6px 0;
    font-weight: 600;
}
.sop-remind {
    display: inline;
    margin-left: 6px;
}
.sop-rule-link {
    font-weight: 700;
}
.sop-gate {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    padding: 16px;
}
.sop-gate-card {
    background: #fff;
    margin: auto;
    width: min(920px, 100%);
    height: min(100%, 920px);
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    border-top: 4px solid #ea580c;
}
.sop-gate-head {
    padding: 12px 16px 8px;
    background: #fff7ed;
    border-bottom: 1px solid #fdba74;
}
.sop-gate-head h2 {
    margin: 0;
    font-size: 1.15rem;
}
.sop-change {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #fdba74;
    border-radius: 6px;
}
.sop-change p {
    margin: 4px 0 0;
}
.sop-scroll-hint {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 700;
}
.sop-gate-scroll {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px 20px;
}
.sop-gate-end {
    margin: 16px 0 0;
    padding-top: 8px;
    border-top: 1px dashed #fdba74;
    color: #9a3412;
    font-weight: 700;
    font-size: 13px;
}
.sop-gate-foot {
    border-top: 1px solid #e8eaed;
    padding: 12px 16px;
    background: #fff;
}
.sop-agree {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 700;
    margin: 0 0 8px;
}
.sop-name {
    display: block;
    font-weight: 700;
    margin: 0 0 4px;
}
body.sop-has-gate {
    overflow: hidden;
}
@media (max-width: 800px) {
    .sop-layout {
        grid-template-columns: 1fr;
    }
    .sop-toc {
        position: static;
        max-height: none;
    }
    .sop-toc-toggle {
        display: inline-flex;
    }
    .sop-toc-list {
        display: none;
        margin-top: 8px;
    }
    .sop-toc.is-open .sop-toc-list {
        display: block;
    }
}
@media (max-width: 700px) {
    .sop-prose .sop-table,
    .sop-gate .sop-table {
        display: block;
        width: 100%;
    }
    .sop-prose .sop-table thead,
    .sop-gate .sop-table thead {
        display: none;
    }
    .sop-prose .sop-table tbody,
    .sop-prose .sop-table tr,
    .sop-prose .sop-table td,
    .sop-gate .sop-table tbody,
    .sop-gate .sop-table tr,
    .sop-gate .sop-table td {
        display: block;
        width: auto;
    }
    .sop-prose .sop-table tr,
    .sop-gate .sop-table tr {
        border: 1px solid #e8eaed;
        border-radius: 6px;
        margin: 0 0 8px;
        padding: 6px 8px;
    }
    .sop-prose .sop-table td,
    .sop-gate .sop-table td {
        border: 0;
        padding: 3px 0;
    }
    .sop-prose .sop-table td::before,
    .sop-gate .sop-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: #9a3412;
    }
}
@media print {
    .sidebar,
    .app-footer,
    .sb-backdrop,
    .sop-toc,
    .sop-search,
    .sop-search-label,
    .sop-toolbar,
    .sop-gate-foot,
    .ui-actions,
    .fold-btn {
        display: none !important;
    }
    .sop-layout {
        display: block;
    }
    .sop-prose {
        max-width: none;
    }
    .sop-gate {
        position: static;
        background: #fff;
        padding: 0;
    }
    .sop-gate-card {
        height: auto;
        width: auto;
        border: 0;
    }
    .sop-gate-scroll {
        overflow: visible;
    }
    body.sop-has-gate {
        overflow: visible;
    }
}

/* --------------------------------- Rejected reports banner (21 Oct 2026) */
.rej-banner {
    border: 1px solid #fca5a5;
    border-left: 5px solid #b91c1c;
    background: #fef2f2;
    border-radius: var(--radius-4, 12px);
    padding: 14px 16px;
    margin: 0 0 18px;
}
.rej-banner-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.rej-banner-head strong { color: #991b1b; font-size: 1.02rem; }
.rej-banner-head span { color: #7f1d1d; font-size: 0.84rem; }
.rej-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rej-list li {
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}
.rej-what { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; flex: 1 1 auto; }
.rej-date { font-weight: 600; color: #0f172a; font-size: 0.86rem; }
.rej-task { color: #b91c1c; font-size: 0.86rem; }
.rej-proj { color: #64748b; font-size: 0.8rem; }
.rej-why { flex: 1 1 100%; color: #475569; font-size: 0.82rem; line-height: 1.4; }
.rej-list .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
    .rej-list li { flex-direction: column; align-items: stretch; }
    .rej-list .btn { width: 100%; text-align: center; }
}

/* Assign Tasks: tick one or more people. Global label rules strip border and background. */
.assign-people {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.assign-form-grid .form-group label.assign-person {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    color: #1e293b;
}
.assign-form-grid .form-group label.assign-person:has(input:checked) {
    border-color: #ea580c !important;
    background: #fff7ed !important;
    color: #c2410c;
}
.assign-form-grid .form-group label.assign-person-all {
    background: #fff7ed !important;
}
.assign-form-grid .form-group label.assign-person em {
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
}
.assign-form-grid .form-group label.assign-person input {
    width: 14px;
    height: 14px;
    margin: 0;
}

/* Inbox notes and message rows. The red count is the sidebar rule .sb-inbox-hot. */
.inbox-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.inbox-note {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-left: 3px solid #b91c1c;
    border-radius: 6px;
    background: #fff7f7;
    font-size: 13px;
    line-height: 1.35;
}
.inbox-note a {
    font-weight: 700;
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
    text-decoration: none !important;
}
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inbox-item {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
}
.inbox-item.is-new {
    border-color: #fecaca;
    background: #fff7f7;
}
.inbox-item-head {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
    font-size: 12px;
    color: #5f6368;
}
.inbox-item-head strong {
    color: #1e293b;
    font-size: 13px;
}
.inbox-new {
    background: #b91c1c;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    padding: 1px 6px;
}
.inbox-body {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    color: #1e293b;
}
.inbox-empty {
    margin: 0;
    color: #5f6368;
    font-size: 13px;
}

/* Perk urgency, skip request, and next-month clone. Dense. No near-black fills. */
.pv-pill {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 11px !important;
    white-space: normal !important;
    vertical-align: middle;
    margin-left: 4px;
}
.pv-line-red,
.pk-urge-red {
    color: #991b1b !important;
    -webkit-text-fill-color: #991b1b !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0;
}
.pv-line-amber,
.pk-urge-amber {
    color: #92400e !important;
    -webkit-text-fill-color: #92400e !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0;
}
.pk-urge {
    margin: 2px 0 0;
}
.pv-skip {
    margin: 4px 0 0;
}
.pv-skip > summary {
    cursor: pointer;
    color: #c2410c;
    font-size: 12px;
    font-weight: 700;
    list-style: none;
}
.pv-skip > summary::-webkit-details-marker {
    display: none;
}
.pv-skip-step {
    margin-top: 6px;
}
.pv-skip-step label,
.perk-clone-panel p,
.perk-skip-queue td {
    font-size: 12px;
}
.pv-wa,
.pv-skip textarea,
.pv-skip input[type="date"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.perk-overview-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}
.perk-clone-btn {
    align-self: flex-start;
}
.perk-ns {
    font-weight: 700;
    color: #9a3412 !important;
    -webkit-text-fill-color: #9a3412 !important;
}
.perk-clone-panel,
.perk-skip-queue {
    margin: 0 0 10px;
    padding: 10px;
}
.perk-clone-lead {
    margin: 0 0 4px;
}
.perk-clone-actions,
.perk-skip-reject {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}
.perk-skip-queue td {
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}
.perk-skip-queue .form-control {
    min-width: 0;
    width: 100%;
    max-width: 220px;
}
@media (max-width: 700px) {
    .perk-clone-actions .btn,
    .perk-skip-reject .btn,
    .perk-clone-btn,
    .perk-skip-queue .form-control {
        width: 100%;
        max-width: none;
    }
}
