/* Custom CSS for TechOne Team Portal — shell comes from erp.css */
:root {
    --portal-bg: #f1f5f9;
    --portal-panel: #ffffff;
    --portal-ink: #0f172a;
    --portal-muted: #64748b;
    --portal-line: #e2e8f0;
    --portal-brand: #1e3a5f;
    --portal-teal: #0ea5a4;
    --portal-sidebar: #0b1c2c;
    --portal-radius: 12px;
    --portal-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* When portal uses ERP shell classes */
body.erp-body.admin-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}
.admin-wrapper, .erp-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}
.erp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
body.erp-body.admin-body .erp-content.main-content {
    padding: 16px 24px 36px;
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
body.erp-body.admin-body .erp-nav.sidebar-menu {
    flex: 1;
}
body.erp-body.admin-body .erp-user .online-dot {
    color: #4ade80;
}
@media (max-width: 900px) {
    body.erp-body.admin-body .erp-content.main-content {
        padding-top: 12px;
        padding-left: max(10px, env(safe-area-inset-left, 0px));
        padding-right: max(10px, env(safe-area-inset-right, 0px));
        padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }
}

@media (max-width: 700px) {
    .ops-col,
    .kanban-col {
        padding: 14px !important;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }
    .ops-col-head {
        gap: 10px;
        padding: 2px 0 12px;
        align-items: flex-start;
    }
    .ops-col-head > div { min-width: 0; flex: 1 1 auto; }
    .ops-col-count { flex: 0 0 auto; margin-left: 4px; }
    .ops-empty,
    .ops-card {
        padding: 14px 12px;
    }
    .live-board-stamp {
        margin: 0 0 12px;
        padding: 0 2px;
    }
    .card-custom {
        padding: 16px 14px !important;
        box-sizing: border-box;
    }
    .stat-card {
        padding: 14px 14px;
    }
    .kanban-board.ops-kanban,
    .ops-kanban {
        gap: 12px;
        margin-top: 8px;
    }
}

body {
    background-color: var(--portal-bg);
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--portal-ink);
    margin: 0;
}

/* Auth Portal */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(900px 400px at 10% -10%, rgba(14, 165, 164, 0.22), transparent 55%),
        linear-gradient(145deg, #0b1c2c 0%, #123047 55%, #1e3a5f 100%);
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--portal-radius);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-card h2 {
    color: var(--portal-ink);
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.02em;
}

/* Dashboard Layout */
.admin-body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(14, 165, 164, 0.12), transparent 55%),
        radial-gradient(900px 400px at 100% 0%, rgba(30, 58, 95, 0.10), transparent 50%),
        var(--portal-bg);
    color: var(--portal-ink);
    font-family: "Segoe UI", system-ui, sans-serif;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, #0b1c2c 0%, #123047 100%);
    color: #cbd5e1;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px 18px;
    margin-bottom: 14px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sidebar-header h2,
.sidebar-brand strong {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.35;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 20px;
    padding: 6px;
    cursor: pointer;
}

.sidebar-user {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: left;
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 8px;
}

.sidebar-user .online-dot {
    color: #4ade80;
}

.sidebar h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #fff;
    text-align: left;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-menu a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu a i {
    width: 18px;
    text-align: center;
    opacity: 0.9;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-menu li.active a {
    background: linear-gradient(90deg, rgba(14, 165, 164, 0.28), rgba(14, 165, 164, 0.08));
    color: #ffffff;
    box-shadow: inset 3px 0 0 #0ea5a4;
}

.sidebar-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.sidebar-menu li.sidebar-link a {
    background: rgba(14, 165, 164, 0.15);
    color: #5eead4;
    border: 1px solid rgba(14, 165, 164, 0.25);
}

.sidebar-menu li.sidebar-link a:hover {
    background: rgba(14, 165, 164, 0.28);
    color: #ffffff;
    transform: none;
}

.sidebar-logout a {
    color: #f87171 !important;
}

/* Mobile top bar + hamburger */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1040;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    background: #0b1c2c;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.mobile-menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-topbar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-topbar-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-topbar-user {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1045;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 28px 32px 40px;
    overflow-y: visible;
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
}

/* Grid & Column Layout Helpers for Bootstrap 3 / Portal compatibility */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -8px;
    margin-left: -8px;
}
.row > [class*="col-"] {
    padding-right: 8px;
    padding-left: 8px;
    box-sizing: border-box;
}
.col-6, .col-xs-6 {
    flex: 0 0 50%;
    max-width: 50%;
    width: 50%;
}
.col-12, .col-xs-12 {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
}

/* Cards & Tabs */
.card-custom {
    background: var(--portal-panel);
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-line);
    padding: 24px;
    box-shadow: var(--portal-shadow);
    margin-bottom: 20px;
}

.card-custom > h3:first-child {
    letter-spacing: -0.02em;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: portalFadeUp 0.35s ease both;
}

@keyframes portalFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles — Sleek & Compact */
.form-group-admin {
    margin-bottom: 12px;
}

.form-group-admin label {
    display: block;
    font-weight: 600;
    font-size: 0.76rem;
    color: var(--portal-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control-admin {
    width: 100%;
    max-width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    font-size: 14px;
    min-height: 38px;
    transition: border-color 0.2s, outline 0.2s;
    background: #ffffff;
    color: var(--portal-ink);
    box-sizing: border-box;
}

.form-control-admin:focus {
    border-color: var(--portal-teal);
    outline: 2px solid rgba(14, 165, 164, 0.25);
}

/* Table Form Controls — Prevent dropdown squishing & text clipping */
.table-admin select.form-control-admin,
.table-admin td select,
.table-admin select {
    min-width: 125px !important;
    width: 100% !important;
    padding: 5px 24px 5px 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 7px !important;
    height: 34px !important;
    min-height: 34px !important;
    box-sizing: border-box !important;
    display: inline-block !important;
}

.table-admin th,
.table-admin td {
    vertical-align: middle !important;
}

/* Show / hide password */
.password-field {
    position: relative;
    display: block;
    width: 100%;
}
.password-field .form-control-admin {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.password-toggle:hover,
.password-toggle:focus {
    color: var(--portal-brand, #1e3a5f);
    background: rgba(15, 23, 42, 0.06);
    outline: none;
}
.password-toggle[aria-pressed="true"] {
    color: var(--portal-teal, #0ea5a4);
}

.btn-admin {
    background: var(--portal-brand);
    color: #ffffff;
    padding: 9px 16px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn-admin:hover {
    background: #16304f;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.btn-admin.btn-teal,
.btn-admin-teal {
    background: var(--portal-teal);
}

.btn-admin.btn-teal:hover,
.btn-admin-teal:hover {
    background: #0d9488;
}

/* Kanban & Action Table Buttons (.kanban-btn) */
.kanban-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 7px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
}

.kanban-btn:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

.kanban-btn[style*="color:#b91c1c"],
.kanban-btn[style*="color: #b91c1c"],
.kanban-btn.btn-danger-link {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
}

.kanban-btn[style*="color:#b91c1c"]:hover,
.kanban-btn[style*="color: #b91c1c"]:hover,
.kanban-btn.btn-danger-link:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
}

/* Letter Preview Pane */
.document-preview-container {
    background: #f1f5f9;
    padding: 40px 20px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.letterhead-preview {
    background: #ffffff;
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    height: auto;
    padding: 18mm 16mm 16mm;
    box-sizing: border-box;
    box-shadow: none;
    border: none;
    outline: none;
    position: relative;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    line-height: 1.55;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.letterhead-preview .letterhead-header,
.letterhead-preview .lh-header {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.letterhead-preview .letterhead-header,
.letterhead-preview .lh-header,
.letterhead-preview .lh-brand,
.letterhead-preview .lh-tag,
.letterhead-preview .lh-office,
.letterhead-preview .lh-meta {
    text-align: left !important;
}

.letterhead-preview .lh-auth-bar {
    display: none !important; /* legacy orange badge — removed */
}

.letterhead-preview .lh-logo {
    width: 44px !important;
    max-width: 44px !important;
    height: auto !important;
}

.letterhead-preview .letterhead-header h1 {
    font-size: 16px !important;
    text-align: left !important;
    margin: 0 !important;
}

.letterhead-body,
.lh-body {
    flex: 1 1 auto;
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.letterhead-body p,
.lh-body p {
    margin: 0 0 10px;
}

.doc-details {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12.5px;
}

.doc-details th,
.doc-details td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}

.doc-details th {
    width: 36%;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.doc-subject {
    margin: 10px 0 8px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    text-decoration: underline;
}

.letterhead-footer,
.lh-footer {
    position: static !important;
    margin-top: auto !important;
    border: none !important;
    border-top: none !important;
    padding-top: 10px !important;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9.5px;
    color: #64748b;
    line-height: 1.45;
}

.lh-msme {
    color: #475569;
    font-weight: 600;
}

/* Table Style */
.table-admin {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table-admin th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
}

.table-admin td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    color: #334155;
    vertical-align: top;
}

/* Alert Boxes */
.alert-admin {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    font-size: 14px;
}

.alert-admin-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-admin-danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
}

.alert-admin-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #b45309;
}

/* Print CSS — true multi-page A4 (no absolute one-page lock / no table jump gaps) */
@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    html, body {
        background: #fff !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .d-print-none {
        display: none !important;
    }

    /* Unlock scroll containers that otherwise clip print to one viewport */
    .admin-wrapper,
    .main-content,
    .content-area,
    .erp-main,
    .erp-content,
    .document-preview-container,
    .letter-print-card,
    .card-custom.letter-print-card,
    #docs-tab {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        transform: none !important;
    }

    .tab-content {
        display: none !important;
    }
    #docs-tab {
        display: block !important;
    }

    .letterhead-preview {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        outline: none !important;
        overflow: visible !important;
        flex-direction: unset !important;
    }

    .letterhead-body,
    .lh-body {
        flex: none !important;
        display: block !important;
        overflow: visible !important;
    }

    .letterhead-header,
    .lh-header,
    .letterhead-footer,
    .lh-footer,
    .document-preview-container,
    .letter-print-card,
    .card-custom.letter-print-card {
        border: none !important;
        border-top: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        outline: none !important;
    }

    .letterhead-footer,
    .lh-footer {
        margin-top: 14px !important;
        padding-top: 8px !important;
        /* no line above footer */
        border-top: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .lh-header,
    .letterhead-header {
        page-break-after: avoid;
        break-after: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* IMPORTANT: do NOT avoid breaks inside the employment table —
       that pushed the whole table to page 2 and left a large blank gap. */
    .doc-details {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    .doc-details tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .lh-logo {
        width: 44px !important;
        max-width: 44px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    p, li, ul {
        orphans: 2;
        widows: 2;
    }
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .mobile-topbar {
        display: flex;
    }

    .admin-wrapper {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        height: 100dvh;
        width: min(300px, 88vw);
        min-width: 0;
        z-index: 1050;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        padding: 16px 14px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-menu {
        flex-direction: column;
        gap: 4px;
    }

    .sidebar-menu a {
        padding: 12px 14px;
        font-size: 14px;
    }

    .main-content {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .card-custom {
        padding: 18px 14px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

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

    .table-admin {
        font-size: 12px;
    }

    .table-admin th,
    .table-admin td {
        padding: 10px 8px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .document-preview-container {
        padding: 10px;
        margin-top: 15px;
        overflow-x: auto;
    }

    .letterhead-preview {
        padding: 30px 20px;
        min-height: auto;
        font-size: 13.5px;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .letterhead-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .letterhead-header h1 {
        font-size: 16px;
    }

    .letterhead-footer {
        position: static;
        margin-top: 14px;
        padding-top: 8px;
    }

    .login-container {
        align-items: flex-start;
        overflow-y: auto;
        padding: 24px 0 32px;
    }

    .login-card {
        padding: 28px 20px;
        margin: 16px;
        border-radius: 14px;
    }

    .perf-bar-wrap {
        flex-wrap: wrap;
    }

    .btn-admin {
        width: 100%;
    }

    .kanban-board {
        flex-direction: column;
        gap: 12px;
    }

    .kanban-col {
        min-height: auto;
        padding: 14px 12px;
    }
}

@media (max-width: 575.98px) {
    .mobile-topbar-title {
        font-size: 15px;
    }

    .card-custom h3 {
        font-size: 17px;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }

    .row > [class*="col-"] {
        margin-bottom: 8px;
        padding-left: 0;
        padding-right: 0;
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
}

/* Kanban Board — Operations Board (modern shell) */
.ops-board-shell { margin-top: 4px; }
.ops-board-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 18px;
    margin-bottom: 14px;
}
.ops-board-heading { flex: 1 1 220px; min-width: 0; }
.ops-board-heading h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ops-board-heading h2 i { color: #0ea5a4; }
.ops-board-heading p { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.ops-board-stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ops-mini-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 68px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.ops-mini-stat span { display: block; font-size: 1.1rem; font-weight: 800; color: #0f172a; line-height: 1.1; }
.ops-mini-stat small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; font-weight: 700; }
.ops-mini-stat.is-blue span { color: #2563eb; }
.ops-mini-stat.is-green span { color: #059669; }
.ops-mini-stat.is-red span { color: #dc2626; }
.ops-new-btn {
    border: none;
    background: linear-gradient(135deg, #0ea5a4, #0f766e);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(14, 165, 164, 0.25);
}
.ops-new-btn:hover { filter: brightness(1.05); }
.ops-new-btn.is-open { background: #334155; box-shadow: none; }
.ops-board-note {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.ops-create-panel {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 16px 18px 18px;
    margin-bottom: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.ops-create-panel[hidden] { display: none !important; }
.ops-create-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.ops-create-head h3 { margin: 0; font-size: 1rem; font-weight: 800; color: #0f172a; }
.ops-create-head p { margin: 4px 0 0; font-size: 12px; color: #64748b; }
.ops-create-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.ops-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ops-field-wide { grid-column: 1 / -1; }
.ops-field label { font-size: 11px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; }
.ops-field label span { color: #0ea5a4; }
.ops-field input,
.ops-field select,
.ops-readonly {
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13px;
    background: #fff;
    color: #0f172a;
    width: 100%;
}
.ops-field input:focus,
.ops-field select:focus {
    outline: none;
    border-color: #0ea5a4;
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15);
}
.ops-readonly { background: #f8fafc; color: #475569; }
.ops-field-hint.warn { color: #b45309; font-size: 12px; }
.ops-field-check { justify-content: flex-end; }
.ops-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    cursor: pointer;
}
.ops-create-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.kanban-board.ops-kanban,
.ops-kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 4px;
    align-items: start;
}
.ops-col {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    min-height: 420px;
}
.ops-col-slate { background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%); }
.ops-col-blue { background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%); border-color: #dbeafe; }
.ops-col-green { background: linear-gradient(180deg, #f7fdf9 0%, #ecfdf5 100%); border-color: #d1fae5; }
.ops-col-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
.ops-col-head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ops-col-head p { margin: 3px 0 0; font-size: 11px; color: #94a3b8; font-weight: 500; text-transform: none; letter-spacing: 0; }
.ops-col-count {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #334155;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}
.ops-card-list { display: flex; flex-direction: column; gap: 10px; }
.ops-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 28px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    background: rgba(255,255,255,0.55);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.ops-empty i { opacity: 0.55; }

.ops-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
    border-left: 4px solid #94a3b8;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ops-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}
.ops-card.priority-urgent,
.ops-card.priority-high { border-left-color: #ef4444; }
.ops-card.priority-medium { border-left-color: #f59e0b; }
.ops-card.priority-low { border-left-color: #3b82f6; }
.ops-card.is-overdue { background: #fff7f7; border-color: #fecaca; }
.ops-card-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ops-prio {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 999px;
}
.ops-prio-urgent, .ops-prio-high { background: #fee2e2; color: #b91c1c; }
.ops-prio-medium { background: #fef3c7; color: #b45309; }
.ops-prio-low { background: #dbeafe; color: #1d4ed8; }
.ops-flag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.ops-flag-danger { background: #fee2e2; color: #b91c1c; }
.ops-flag-warn { background: #ffedd5; color: #c2410c; }
.ops-card-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}
.ops-card-desc {
    margin: 0 0 8px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}
.ops-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ops-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}
.ops-tag-project { background: #e0e7ff; color: #4338ca; }
.ops-card-people {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.ops-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5a4, #1e3a5f);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.ops-people-meta { min-width: 0; }
.ops-people-meta strong { display: block; font-size: 12px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-people-meta span { font-size: 11px; color: #64748b; }

.ops-assign {
    margin: 0 0 10px;
}
.ops-assign label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}
.ops-assign span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.ops-assign select {
    width: 100%;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 12px;
    background: #f8fafc;
    color: #0f172a;
}
.ops-assign select:focus {
    outline: none;
    border-color: #0ea5a4;
    background: #fff;
}

.ops-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}
.ops-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.ops-btn:hover { background: #f8fafc; }
.ops-btn-primary {
    background: #0ea5a4;
    border-color: #0ea5a4;
    color: #fff;
}
.ops-btn-primary:hover { filter: brightness(1.05); background: #0ea5a4; }
.ops-btn-success {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
.ops-btn-success:hover { filter: brightness(1.05); background: #059669; }
.ops-btn-ghost { background: #fff; }
.ops-btn-danger { color: #dc2626; border-color: #fecaca; }
.ops-btn-danger:hover { background: #fef2f2; }
.ops-btn-lg { padding: 10px 16px; font-size: 13px; }

/* Legacy class hooks still used by live-board stamp placement */
.kanban-board {
    display: flex;
    gap: 20px;
    margin-top: 25px;
}
.kanban-board.ops-kanban { display: grid; margin-top: 4px; }

@media (max-width: 1100px) {
    .ops-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kanban-board.ops-kanban,
    .ops-kanban { grid-template-columns: 1fr; }
    .ops-col { min-height: auto; }
}

@media (max-width: 700px) {
    .ops-create-grid { grid-template-columns: 1fr; }
    .ops-board-toolbar { align-items: stretch; }
    .ops-new-btn { width: 100%; justify-content: center; }
}

@media (max-width: 900px) {
    .kanban-board:not(.ops-kanban) {
        flex-direction: column;
        gap: 12px;
    }
    .kanban-col {
        min-height: auto;
        padding: 14px 12px;
    }
}

/* Team performance dashboard */
.stat-card {
    background: #fff;
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-line);
    padding: 16px 18px;
    border-left: 3px solid #0ea5a4;
    box-shadow: var(--portal-shadow);
    height: 100%;
}

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--portal-muted);
}

.stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--portal-ink);
    margin: 8px 0 4px;
    letter-spacing: -0.02em;
}

.stat-hint {
    font-size: 12px;
    color: #94a3b8;
}

.dept-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.dept-card-header {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dept-card-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.dept-card-body {
    padding: 14px 16px;
    font-size: 14px;
}

.dept-pill {
    background: #ccfbf1;
    color: #0f766e;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.status-online {
    color: #10b981;
    font-size: 12px;
    font-weight: 600;
}

.status-online i {
    font-size: 8px;
}

.status-offline {
    color: #94a3b8;
    font-size: 12px;
}

.perf-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.perf-bar-wrap span {
    font-size: 12px;
    font-weight: 700;
    min-width: 36px;
}

.perf-bar {
    height: 8px;
    border-radius: 4px;
    flex: 1;
    max-width: 80px;
    background: #e2e8f0;
}

.team-table td {
    vertical-align: middle;
}

.sidebar-monitor-note {
    font-size: 12px;
    font-weight: 400;
    color: #cbd5e1;
    text-align: left;
    margin: 0 0 12px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    line-height: 1.45;
}

.lazy-tab-placeholder {
    text-align: center;
    color: #64748b;
    padding: 36px 16px;
    font-size: 14px;
}
.lazy-tab-placeholder .fa-spinner {
    margin-right: 8px;
    color: #0ea5a4;
}
.js-lazy-shot:not([src]) {
    background: #e2e8f0;
    display: block;
}
.activity-range-btns .js-activity-range.is-on {
    background: #0ea5a4 !important;
}

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

.screenshot-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.screenshot-thumb-wrap {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f1f5f9;
}

.screenshot-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain; /* full frame — cover was cropping and looked "half" */
    object-position: center;
    transition: transform 0.2s;
}

.screenshot-thumb-wrap:hover .screenshot-thumb {
    transform: scale(1.03);
}

.screenshot-meta {
    padding: 10px 12px;
    font-size: 11px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.screenshot-meta strong {
    color: #1e293b;
    font-size: 13px;
}

.access-list {
    font-size: 13px;
    color: #475569;
    padding-left: 18px;
    margin: 0;
    line-height: 1.7;
}

.access-allow li::marker {
    color: #10b981;
}

.access-deny li::marker {
    color: #ef4444;
}

@media (max-width: 991.98px) {
    .screenshot-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

.work-policy-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 13px;
    margin-bottom: 16px;
}

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

.compliance-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.compliance-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.compliance-card-head strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
}

.compliance-dept {
    font-size: 12px;
    color: #64748b;
}

.compliance-score {
    font-size: 18px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.compliance-score.score-ok {
    background: #ecfdf5;
    color: #047857;
}

.compliance-score.score-warn {
    background: #fffbeb;
    color: #b45309;
}

.compliance-score.score-bad {
    background: #fef2f2;
    color: #b91c1c;
}

.compliance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.compliance-stats .label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.compliance-stats .value {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.compliance-stats .value.text-warn {
    color: #b45309;
}

.badge-online {
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 6px;
}

.badge-offline {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.compliance-flags {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    font-size: 12px;
}

.compliance-flags li {
    padding: 6px 0;
    border-top: 1px solid #f1f5f9;
}

.compliance-flags li i {
    margin-right: 6px;
}

.compliance-flags .flag-ok {
    color: #047857;
}

.compliance-flags .flag-warning {
    color: #b45309;
}

.compliance-flags .flag-danger {
    color: #b91c1c;
}

.compliance-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-compliance-link {
    font-size: 12px;
    font-weight: 600;
    color: #0ea5a4;
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.btn-compliance-link:hover {
    background: #f1f5f9;
    color: #0f766e;
    text-decoration: none;
}

/* ------------------------------------------------------------------
   Portal UX layer: grouped sidebar, compact density, sticky context bar,
   collapsible sections, global find, back-to-top (see js/admin-ux.js)
   ------------------------------------------------------------------ */
.erp-nav .erp-nav-group {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.85);
    padding: 12px 12px 4px;
    margin-top: 4px;
    pointer-events: none;
}
.erp-nav .erp-nav-group:first-child { margin-top: 0; padding-top: 4px; }

/* The window is the scroller; an overflow:auto main would trap the sticky bar. Body still clips x-overflow. */
.main-content,
body.erp-body.admin-body .erp-content.main-content { padding-top: 20px; overflow: visible; }
.card-custom { padding: 20px 22px; margin-bottom: 16px; }
.table-admin th { padding: 10px 14px; font-size: 13px; }
.table-admin td { padding: 10px 14px; font-size: 13.5px; }
.table-admin { margin-top: 8px; }
.alert-admin { margin-bottom: 16px; position: relative; padding-right: 44px; }

.ux-context-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 10px 14px;
    margin: 0 0 16px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--portal-line);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
.ux-bar-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; flex: 1 1 320px; }
.ux-bar-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--portal-ink);
    letter-spacing: -0.01em;
    white-space: nowrap;
    padding-right: 10px;
    border-right: 1px solid var(--portal-line);
    margin-right: 2px;
}
.ux-bar-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ux-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--portal-line);
    background: #f8fafc;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.ux-pill i { color: var(--portal-teal); font-size: 11px; }
.ux-pill:hover { background: #ecfeff; border-color: #99f6e4; color: #0f766e; }
.ux-pill.is-collapsed { color: #64748b; background: #fff; border-style: dashed; }
.ux-pill.is-collapsed i { color: #94a3b8; }

.ux-find { position: relative; flex: 0 1 320px; min-width: 200px; }
.ux-find > i.fa-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 12px; pointer-events: none; }
.ux-find input {
    width: 100%;
    padding: 8px 40px 8px 34px;
    border: 1px solid #d5dbe3;
    border-radius: 10px;
    font-size: 13.5px;
    background: #fff;
    color: var(--portal-ink);
}
.ux-find input:focus { outline: none; border-color: var(--portal-teal); box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15); }
.ux-find kbd {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 6px;
    pointer-events: none;
}
.ux-find-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    min-width: 320px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    z-index: 60;
    padding: 6px;
}
.ux-find-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.ux-find-item > i { margin-top: 3px; color: var(--portal-teal); width: 14px; text-align: center; font-size: 12px; }
.ux-find-item.ux-type-row > i { color: #94a3b8; }
.ux-find-item:hover, .ux-find-item.is-active { background: #f1f5f9; }
.ux-find-title { font-size: 13.5px; font-weight: 600; color: var(--portal-ink); }
.ux-find-sub { font-size: 12px; color: #64748b; margin-top: 1px; }
.ux-find-empty { padding: 12px; font-size: 13px; color: #64748b; text-align: center; }

.ux-section-header { position: relative; cursor: pointer; }
.ux-section > h3.ux-section-header, .ux-section > h4.ux-section-header, .ux-section > h2.ux-section-header,
.ux-section > div.ux-section-header { padding-right: 40px; }
.ux-collapse-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--portal-line);
    background: #fff;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background 0.12s ease, color 0.12s ease;
}
.ux-collapse-btn:hover { background: #ecfeff; color: #0f766e; border-color: #99f6e4; }
.ux-collapse-btn i { transition: transform 0.18s ease; }
.ux-collapsed .ux-collapse-btn i { transform: rotate(180deg); }
.ux-section.ux-collapsed > *:not(.ux-section-header) { display: none !important; }
.ux-section.ux-collapsed { padding-top: 14px; padding-bottom: 14px; }
.ux-section.ux-collapsed > .ux-section-header { margin-bottom: 0 !important; }
.ux-section.ux-collapsed > .ux-section-header::after {
    content: 'Click to expand';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11.5px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}
.ux-section.ux-collapsed > div.ux-section-header::after { display: none; }
.ux-section.ux-collapsed > div.ux-section-header { margin-bottom: 0 !important; padding-right: 40px; }

@keyframes uxFlash {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 164, 0.55); }
    100% { box-shadow: 0 0 0 14px rgba(14, 165, 164, 0); }
}
.ux-flash { animation: uxFlash 1.6s ease-out 1; }
tr.ux-flash td { background: #ecfeff !important; transition: background 1.6s ease; }

.ux-alert-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.ux-alert-close:hover { opacity: 1; }
.ux-alert-fade { opacity: 0; transition: opacity 0.9s ease; }

.ux-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--portal-brand);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 35;
}
.ux-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ux-top:hover { background: var(--portal-teal); }

@media (max-width: 900px) {
    .ux-context-bar {
        position: relative !important;
        top: 0 !important;
        z-index: 1 !important;
        border-radius: 12px;
        padding: 10px 12px;
        margin: 0 0 16px 0;
        background: #ffffff;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .ux-bar-left {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }
    .ux-bar-title {
        border-right: 0;
        padding-right: 0;
        font-size: 0.95rem;
        font-weight: 700;
        color: #0f172a;
        width: 100%;
        margin-bottom: 2px;
    }
    .ux-bar-pills {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        width: 100%;
        max-width: 100%;
        padding-bottom: 6px;
        gap: 6px;
    }
    .ux-pill {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 12px;
        padding: 5px 11px;
    }
    .ux-find {
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
    }
    .ux-find-results {
        min-width: 0;
        max-width: 100%;
    }
    .ux-section.ux-collapsed > .ux-section-header::after { display: none; }
}

@media print {
    .ux-context-bar, .ux-top, .ux-collapse-btn, .ux-alert-close, .erp-mobile-bar, .mobile-topbar, .erp-topbar, .erp-sidebar, .sidebar-container, .erp-actions, .slip-actions, .d-print-none, .no-print, .print-hidden { display: none !important; }
    .ux-section.ux-collapsed > *:not(.ux-section-header) { display: revert !important; }
}

.portal-reminder-modal {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    padding: 20px;
}
.portal-reminder-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
    text-align: center;
}
.portal-reminder-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #ecfeff;
    color: #0ea5a4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.portal-reminder-card h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #0f172a;
}
.portal-reminder-sub {
    margin: 0 0 16px;
    font-size: 13px;
    color: #64748b;
}
.portal-reminder-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    text-align: left;
}
.portal-reminder-list li {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.portal-reminder-list strong { display: block; color: #0f172a; }
.portal-reminder-list span { display: block; font-size: 13px; color: #0ea5a4; font-weight: 600; }
.portal-reminder-list small { display: block; color: #64748b; font-size: 12px; }

/* Team Knowledge — compact ERP actions, never the full-width .btn-admin chips */
#knowledge-tab .erp-btn,
#knowledge-tab a.erp-btn {
    text-decoration: none;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1.2;
}
#knowledge-tab a.erp-btn:hover { text-decoration: none; color: #fff; }
#knowledge-tab a.erp-btn-ghost { color: #0f172a; }
#knowledge-tab a.erp-btn-ghost:hover { color: #0f172a; }
#knowledge-tab .erp-btn-sm { white-space: nowrap; }
#knowledge-tab .kb-inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}
#knowledge-tab .kb-row-actions {
    flex-shrink: 0;
    align-items: center;
}
#knowledge-tab .kb-row-actions .erp-btn,
#knowledge-tab .kb-row-actions .btn-admin {
    width: auto !important;
}
#knowledge-tab .kb-form-actions { margin-top: 4px; }

.kb-lead { font-size: 14px; color: #64748b; margin: 0 0 10px; }
.kb-lock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
}
.kb-filter {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.kb-filter .form-group-admin { margin-bottom: 0; }
.kb-filter .form-control-admin { width: 100%; min-height: 42px; }
.kb-filter-go { display: flex; align-items: stretch; }
.kb-filter-go .erp-btn { min-height: 42px; }
.kb-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.kb-card-title i { color: #0ea5a4; }
.kb-card-title em {
    margin-left: auto;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    color: #0ea5a4;
    background: #ecfeff;
    border-radius: 999px;
    padding: 2px 8px;
}
.kb-help { font-size: 13px; color: #64748b; margin: 0 0 14px; line-height: 1.5; }
.kb-empty { color: #94a3b8; font-size: 14px; margin: 8px 0 0; }
.kb-list { list-style: none; margin: 0; padding: 0; }
.kb-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}
.kb-list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.kb-list-item-block { flex-wrap: wrap; }
.kb-list-main { min-width: 0; flex: 1; }
.kb-list-main strong, .kb-title-link {
    display: block;
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.35;
}
.kb-title-link:hover { color: #0ea5a4; }
.kb-meta-line { display: block; margin-top: 4px; font-size: 12px; color: #64748b; }
.kb-excerpt { margin: 8px 0 0; font-size: 13px; color: #475569; line-height: 1.5; }
.kb-reject {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
    align-items: stretch;
}
.kb-reject .form-control-admin { min-height: 36px; margin: 0; }
.kb-pending-card { border: 1px solid #fde68a; background: #fffdf7; }
.kb-article-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.kb-article-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: #0f172a; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; color: #64748b; margin: 0 0 16px; }
.kb-body { font-size: 15px; line-height: 1.7; color: #334155; }
.kb-review-note {
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    margin: 0 0 14px;
}
.kb-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.kb-badge-ok { background: #dcfce7; color: #166534; }
.kb-badge-warn { background: #fef3c7; color: #92400e; }
.kb-badge-bad { background: #fee2e2; color: #991b1b; }
.kb-badge-muted { background: #f1f5f9; color: #475569; }
@media (max-width: 760px) {
    .kb-filter { grid-template-columns: 1fr; }
    .kb-list-item { flex-direction: column; align-items: stretch; }
    .kb-row-actions { justify-content: flex-start; }
    .kb-reject { grid-template-columns: 1fr; }
}

/* —— My Time tracking hub —— */
.tracking-hub { border: 1px solid #99f6e4; background: linear-gradient(145deg, #f0fdfa 0%, #fff 55%); }
.tracking-hub-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 14px; }
.tracking-hub-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tracking-pill {
    border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 6px 12px;
    font-size: 12px; font-weight: 600; color: #334155; cursor: pointer;
}
.tracking-pill:hover { border-color: #0ea5a4; color: #0f766e; background: #ecfeff; }
.tracking-pill i { margin-right: 5px; color: #0ea5a4; }
.tracking-hub-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tracking-hub-stat {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.tracking-hub-stat span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.tracking-hub-stat strong { font-size: 1.15rem; color: #0f172a; }
.tracking-hub-stat small { font-size: 11px; color: #64748b; line-height: 1.35; }
@media (max-width: 900px) {
    .tracking-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* —— Work Calendar (month heatmap + day graph) —— */
.wc-wrap {
    display: flex; flex-direction: column; gap: 14px;
    width: 100%; max-width: 100%; min-width: 0; min-height: 1px; box-sizing: border-box;
}
.wc-wrap .card-custom,
.wc-wrap .erp-card,
.wc-wrap .wc-cal-cell {
    overflow: visible;
    animation: none !important;
    opacity: 1 !important;
}
.wc-wrap > * { min-width: 0; max-width: 100%; }
.wc-toolbar { display: flex; flex-direction: column; gap: 14px; }
.wc-toolbar-main {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 18px;
}
.wc-month-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; width: 100%; }
.wc-month-form label { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.wc-month-form label span { font-size: 12px; font-weight: 600; color: #64748b; }
.wc-month-field {
    min-height: 40px; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; color: #0f172a; background: #fff; box-sizing: border-box;
}
.wc-emp-pick { flex: 1 1 220px; max-width: 360px; }
.wc-nav { display: inline-flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; position: relative; z-index: 2; }
.wc-nav-btn {
    min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 12px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; color: #0f172a;
    text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.wc-nav-btn:hover { background: #ecfeff; border-color: #99f6e4; color: #0f766e; }
.wc-nav-label { font-weight: 700; font-size: 15px; color: #0f172a; min-width: 120px; text-align: center; }
.wc-nav-today {
    font-size: 12px; font-weight: 600; color: #0ea5a4; text-decoration: none; padding: 6px 10px;
    border-radius: 8px; border: 1px solid #99f6e4; background: #f0fdfa;
}
.wc-emp-form label { display: flex; flex-direction: column; gap: 6px; max-width: 360px; margin: 0; }
.wc-emp-form label span { font-size: 12px; font-weight: 600; color: #64748b; }
.wc-stats {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
.wc-stat {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.wc-stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #94a3b8; }
.wc-stat strong { font-size: 1.35rem; color: #0f172a; letter-spacing: -0.02em; line-height: 1.2; }
.wc-stat small { font-size: 11px; color: #64748b; }
.wc-layout {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start;
    width: 100%; min-width: 0;
}
.wc-cal-card, .wc-day-card { min-width: 0; max-width: 100%; }
.wc-cal-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px;
}
.wc-cal-head h4, .wc-day-card h4 {
    margin: 0; font-size: 15px; font-weight: 700; color: #0f172a;
}
.wc-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 11px; color: #64748b; }
.wc-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px;
    background: #f1f5f9; border: 1px solid #e2e8f0;
}
.wc-dot.i1 { background: #ccfbf1; border-color: #99f6e4; }
.wc-dot.i3 { background: #5eead4; border-color: #2dd4bf; }
.wc-dot.i5 { background: #0d9488; border-color: #0f766e; }
.wc-dot.ileave { background: #fde68a; border-color: #fbbf24; }
.wc-dot.ioff { background: #e2e8f0; border-color: #cbd5e1; }
.wc-cal-grid {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
    width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
}
.wc-cal-wd {
    text-align: center; font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; padding: 4px 0;
    min-width: 0; overflow: hidden;
}
.wc-wd-short { display: none; }
.wc-cal-cell {
    min-width: 0; min-height: 72px; border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc;
    padding: 6px 7px; text-decoration: none; color: #0f172a; display: flex; flex-direction: column; gap: 2px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    overflow: hidden; box-sizing: border-box;
}
.wc-cal-cell.is-blank { background: transparent; border-color: transparent; min-height: 0; pointer-events: none; }
.wc-cal-cell:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08); border-color: #99f6e4; }
.wc-cal-cell.is-today { box-shadow: inset 0 0 0 2px #0ea5a4; }
.wc-cal-cell.is-selected { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(14, 165, 164, 0.35); }
.wc-cal-cell.kind-off, .wc-cal-cell.kind-holiday { background: #f1f5f9; color: #64748b; }
.wc-cal-cell.kind-leave { background: #fffbeb; border-color: #fde68a; }
.wc-cal-cell.kind-absent { background: #fef2f2; border-color: #fecaca; }
.wc-cal-cell.kind-future { background: #fff; color: #94a3b8; }
.wc-cal-cell.kind-future .wc-day-hrs { color: #cbd5e1; }
.wc-cal-cell.intensity-1 { background: #ccfbf1; border-color: #99f6e4; }
.wc-cal-cell.intensity-2 { background: #99f6e4; border-color: #5eead4; }
.wc-cal-cell.intensity-3 { background: #5eead4; border-color: #2dd4bf; }
.wc-cal-cell.intensity-4 { background: #2dd4bf; border-color: #14b8a6; color: #042f2e; }
.wc-cal-cell.intensity-5 { background: #0d9488; border-color: #0f766e; color: #ecfeff; }
.wc-cal-cell.intensity-5 .wc-day-hrs, .wc-cal-cell.intensity-5 .wc-day-shots { color: #ecfeff; }
.wc-day-num { font-size: 13px; font-weight: 700; line-height: 1.2; }
.wc-day-hrs {
    font-size: 12px; font-weight: 600; color: #0f766e; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-cal-cell.intensity-4 .wc-day-hrs, .wc-cal-cell.intensity-5 .wc-day-hrs { color: inherit; }
.wc-day-shots { font-size: 10px; opacity: 0.85; margin-top: auto; }
.wc-day-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; font-size: 13px; color: #64748b; }
.wc-badge {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.wc-badge.badge-success { background: #dcfce7; color: #166534; }
.wc-badge.badge-warning { background: #fef3c7; color: #92400e; }
.wc-badge.badge-info { background: #e0f2fe; color: #075985; }
.wc-badge.badge-primary { background: #ede9fe; color: #5b21b6; }
.wc-badge.badge-secondary { background: #f1f5f9; color: #475569; }
.wc-badge.badge-danger { background: #fee2e2; color: #991b1b; }
.wc-day-big { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.wc-day-big strong { font-size: 2rem; letter-spacing: -0.03em; color: #0f172a; line-height: 1.1; }
.wc-day-big span { font-size: 13px; color: #64748b; }
.wc-day-bar { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.wc-day-bar-fill { height: 100%; background: linear-gradient(90deg, #2dd4bf, #0d9488); border-radius: 999px; }
.wc-day-note { font-size: 13px; color: #64748b; margin: 10px 0 0; }
.wc-chart-card {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    min-width: 0; max-width: 100%;
}
.wc-chart {
    position: relative; display: flex; align-items: flex-end; gap: 4px; min-height: 160px;
    width: 100%; min-width: 0; box-sizing: border-box;
    padding: 12px 4px 28px; border-top: 1px solid #f1f5f9;
    overflow: hidden;
}
.wc-bar {
    flex: 1 1 0; min-width: 10px; max-width: 28px; height: 120px; position: relative;
    text-decoration: none; display: block;
}
.wc-bar-fill {
    position: absolute; left: 0; right: 0; bottom: 18px; height: var(--h, 2%);
    border-radius: 6px 6px 3px 3px; background: #cbd5e1; transition: height 0.2s ease, background 0.15s ease;
}
.wc-bar.is-partial .wc-bar-fill { background: #5eead4; }
.wc-bar.is-hit .wc-bar-fill { background: #0d9488; }
.wc-bar.is-leave .wc-bar-fill { background: #fbbf24; min-height: 6px; }
.wc-bar.is-off .wc-bar-fill { background: #e2e8f0; min-height: 4px; }
.wc-bar.is-future .wc-bar-fill { background: #e2e8f0; height: 4px; }
.wc-bar.is-selected .wc-bar-fill { box-shadow: 0 0 0 2px #0f766e; }
.wc-bar:hover .wc-bar-fill { filter: brightness(1.05); }
.wc-bar-label {
    position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
    font-size: 10px; font-weight: 600; color: #94a3b8;
}
.wc-target-line {
    position: absolute; left: 0; right: 0;
    /* Keep line inside the 120px bar band above day labels — never through the card title */
    bottom: calc(18px + (120px * var(--wc-target-ratio, 0.5)));
    border-top: 2px dashed #f59e0b; pointer-events: none; opacity: 0.85;
}
.wc-wrap .table-admin { min-width: 0 !important; }
@media (max-width: 980px) {
    .wc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wc-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .wc-wrap { gap: 10px; }
    .wc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .wc-cal-grid { gap: 3px; }
    .wc-cal-cell { min-height: 52px; padding: 4px 3px; border-radius: 8px; }
    .wc-day-shots { display: none; }
    .wc-day-big strong { font-size: 1.6rem; }
    .wc-toolbar-main { gap: 10px; }
    .wc-nav-label { min-width: 0; }
    .wc-wd-full { display: none; }
    .wc-wd-short { display: inline; }
    .wc-cal-wd { font-size: 10px; letter-spacing: 0; }
    .wc-chart { min-width: 0; gap: 2px; }
    .wc-bar { min-width: 6px; max-width: none; }
}
@media (max-width: 480px) {
    .wc-stats { grid-template-columns: 1fr 1fr; }
    .wc-stat strong { font-size: 1.15rem; }
    .wc-cal-grid { gap: 2px; }
    .wc-cal-cell { min-height: 44px; padding: 3px 2px; border-radius: 7px; gap: 1px; }
    .wc-cal-cell.is-blank { min-height: 0; }
    .wc-day-num { font-size: 11px; }
    .wc-day-hrs { font-size: 10px; }
    .wc-cal-wd { font-size: 10px; }
}
