/* ===========================
   Design Tokens
=========================== */
:root {
    --brand: #01325f;
    --base: #E2E2DE;
    --panel: #ffffff;
    --panel-soft: #f1f1ef;
    --border: #e3e3e3;
    --muted: #6c757d;
    --link-hover: #0071db;
    --success: #2B7A0B;
    --danger: #BF2A23;
    --info: #4FA3D1;
    --warning: #F2C14E;

    /* App shell */
    --sidebar-bg: #0f2233;
    /* brand-tinted slate */
    --sidebar-bg-2: #0d1c2a;
    --sidebar-text: #ffffff;
    --sidebar-sep: #ffffff14;
    --focus-ring: 0 0 0 .15rem rgba(1, 50, 95, .25);

    /* Layout tokens */
    --sidebar-width: 160px;
    /* was 160px */
    --sidebar-gap: 5px;
    /* was ~10px; halve the gap */

    --mobilebar-height: 56px;
}

/* ===========================
   Base
=========================== */
html,
body {
    background-color: var(--base);
    color: #1e2a36;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased;
}

/* ===========================
   Sidebar (single source of truth)
=========================== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: var(--sidebar-text);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--sidebar-sep);
}

.nav-brand .brand-mark {
    height: 28px;
    width: auto;
    display: block;
}

.nav-brand .brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .2px;
}

.sidebar nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    display: block;
    padding: 8px 12px 8px 14px;
    font-size: 0.98rem;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover {
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
}

.sidebar nav .active {
    background-color: rgba(255, 255, 255, .08);
    border-left-color: var(--brand);
}

.brand-home-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

/* ===========================
   Main Content Area
=========================== */
.content {
    margin-top: 16px;
    margin-left: calc(var(--sidebar-width) + var(--sidebar-gap)) !important;
    /* matches sidebar width + gap */
    padding: 0 20px 20px 20px;
}

/* ===========================
   Page Header (reusable)
=========================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: .2px;
}

.page-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    display: inline-block;
}

/* ===========================
   Links & Focus (global)
=========================== */
a {
    color: var(--brand);
}

a:hover {
    color: var(--link-hover);
}

:where(button, [type="button"], [type="submit"], .form-control, .form-select, a):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ===========================
   Box/Container Styles
=========================== */
.box {
    background: var(--panel-soft);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card {
    border-radius: 5px;
    box-shadow: none;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
}

/* White inner card helper (use to contrast inside a gray .box) */
.card-white {
    background: #fff !important;
    border-color: var(--border) !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

.box,
.table-responsive,
.container-fluid {
    overflow: visible !important;
}

/* ===========================
   Table: Timesheet & Timecard
=========================== */
#timesheet {
    display: table;
    width: auto;
    min-width: 100%;
    max-width: none;
    table-layout: auto !important;
}

#timesheet th {
    position: relative;
    height: 90px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    vertical-align: bottom;
    padding: 0 !important;
    text-align: left;
    background: inherit;
    overflow: visible !important;
    border-bottom: 1px solid #ccc;
}

#timesheet th .rotated-header {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 140px;
    transform: rotate(-45deg);
    transform-origin: bottom left;
    white-space: nowrap;
    text-align: left;
    font-size: 0.82rem;
    background: transparent;
    color: inherit;
    z-index: 2;
    pointer-events: auto;
}

#timesheet thead tr {
    height: 90px;
    overflow: visible !important;
}

#timesheet th:not(:first-child),
#timesheet td:not(:first-child) {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    overflow: hidden;
}

#timesheet th:first-child {
    position: static;
    height: 28px;
    width: 120px;
    min-width: 100px;
    max-width: 140px;
    padding-left: 6px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: inherit;
}

/* --- Timecard Table --- */
.tc {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse !important;
    background: #fff;
    font-size: 0.82rem;
    margin-bottom: 0 !important;
}

.tc th,
.tc td {
    border: 1px solid #ccc !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 28px;
    text-align: center;
    vertical-align: middle;
    background: #fff !important;
    font-size: 0.82rem;
    font-weight: normal;
    position: relative;
    overflow: hidden;
}

.tc td {
    padding: 0.25em 0.5em;
}

.tc td>div {
    width: 100%;
}

.tc th:first-child,
.tc td:first-child {
    text-align: left;
    width: 180px;
    min-width: 160px;
    max-width: 220px;
    padding-left: 6px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc th:not(:first-child),
.tc td:not(:first-child) {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    overflow: hidden;
}

/* --- Timecard Section Coloring --- */
.tc .th-project .th-sum {
    background-color: var(--brand) !important;
    color: #fff !important;
    font-weight: bold !important;
    border-right: 2px solid #fff !important;
}

.tc .th-wk1 {
    background-color: #6B9472 !important;
    color: #fff !important;
    border-left: 1px solid #9b9b8e !important;
    border-right: 1px solid #9b9b8e !important;
}

.tc .th-wk2 {
    background-color: #946B8D !important;
    color: #fff !important;
    border-left: 1px solid #9b9b8e !important;
    border-right: 1px solid #9b9b8e !important;
}

.tc .td-project {
    background-color: #e6e6e6 !important;
    font-weight: bold !important;
    /* border-right: 2px solid #fff !important; */
}

.tc .td-wk1 {
    background-color: #A8B7AB !important;
    border-left: 1px solid #9b9b8e !important;
    border-right: 1px solid #9b9b8e !important;
    border-bottom: 1px solid #9b9b8e !important;
}

.tc .td-wk2 {
    background-color: #B7A8B4 !important;
    border-left: 1px solid #9b9b8e !important;
    border-right: 1px solid #9b9b8e !important;
    border-bottom: 1px solid #9b9b8e !important;
}

.tc tr:hover .td-wk1 {
    background-color: #99a69c !important;
}

.tc tr:hover .td-wk2 {
    background-color: #a1949e !important;
}

/* Totals row styling: darker, harmonious band to separate sums */
.tc .sum-row td {
    background-color: #e6e6e6 !important;
    /* slightly darker than white but neutral */
    border-top: 2px solid #d0d6d0 !important;
    font-weight: normal !important;
    /* ensure totals row is normal weight */
}

.tc .sum-row td.td-project {
    background-color: #e6e6e6 !important;
    /* align with project column tone */
    font-weight: normal !important;
}

/* Project label helper to align text like the project select */
.tc .project-label {
    display: flex;
    align-items: center;
    height: 28px;
    /* match row height */
    padding-left: 6px;
    font-weight: 700;
}

/* --- Timecard Inputs --- */
.tc input {
    width: 50px;
}

.wk1input {
    background-color: #ecf8ee;
    border: 0;
}

.wk2input {
    background-color: #fceff9;
    border: 0;
}

.custom-project-select {
    font-size: 0.9rem !important;
    height: 28px !important;
    /* match row height */
    padding: 0 1.5rem 0 6px !important;
    /* room for arrow */
    width: 100%;
    cursor: pointer;
    /* do NOT override background-image so Bootstrap's arrow remains */
}

.tc .td-project .custom-project-select:not(:focus) {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.tc .td-project .custom-project-select:focus {
    background-color: #fff !important;
    border-color: var(--brand) !important;
    box-shadow: var(--focus-ring);
    outline: none !important;
}

/* Inputs: flat by default; only show on focus */
.custom-hour-input {
    /* restore compact, full-cell sizing */
    font-size: 0.82rem !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;

    /* flat by default */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;

    /* center values */
    text-align: center;
    display: block;
    box-sizing: border-box;
    border-radius: 0 !important;
}

/* Show placeholders again (remove/hide rules previously used) */
.custom-hour-input::placeholder {
    color: #666;
    /* visible placeholder */
}

/* Remove number spinners */
.custom-hour-input[type="number"]::-webkit-outer-spin-button,
.custom-hour-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-hour-input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Keep sticky header/col without overriding header bg */
.tc thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.tc th:first-child,
.tc td:first-child {
    position: sticky;
    left: 0;
}

.tc td:first-child {
    z-index: 2;
    background: #e6e6e6 !important;
    box-shadow: 2px 0 0 rgba(0, 0, 0, .04);
}

.tc thead th:first-child,
.tc thead th.th-project {
    z-index: 4;
    background: var(--brand) !important;
    color: #fff !important;
}

/* REMOVE this block if still present (it forces the white select all the time)
.tc .td-project .custom-project-select {
    border: 1px solid #cfcfcf !important;
    background-color: #fff !important;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url(data:image/svg+xml,...);
    background-repeat: no-repeat !important;
    background-position: right .5rem center !important;
    background-size: 16px 12px !important;
}
*/

/* ===========================
   Accordion/Card Styles
=========================== */
.card-header {
    background: none;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.card-header button,
.card-header .btn {
    font-weight: 600;
    font-size: 1rem;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    color: var(--brand);
    text-align: left;
    width: 100%;
    display: block;
}

.card-body {
    background: none;
    padding: 8px 12px;
    font-size: 0.98rem;
}

/* ===========================
   Employment Navigation Links
=========================== */
#employment_nav_links a {
    color: var(--brand);
    text-decoration: none;
}

#employment_nav_links a:hover {
    color: var(--link-hover);
}

/* ===========================
   Link Reset
=========================== */
.no-style-link {
    all: unset;
    cursor: pointer;
}

.no-style-link:visited,
.no-style-link:hover,
.no-style-link:focus,
.no-style-link:active {
    all: unset;
    cursor: pointer;
}

/* ===========================
   User List (generic)
=========================== */
.user-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
    transition: box-shadow 0.2s, background 0.2s;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    background: #f0f4fa;
}

.user-item.user-disabled {
    opacity: 0.6;
    background: #f5f5f5;
    color: #888;
}

.user-info {
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.user-info strong {
    font-size: 1.1rem;
    font-weight: 600;
}

.user-info .text-muted {
    font-size: 0.95rem;
    color: var(--muted);
}

.user-info .badge {
    font-size: 0.85rem;
    margin-top: 4px;
}

/* --- User Actions --- */
.user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.user-actions button,
.user-actions form button {
    min-width: 90px;
    font-size: 0.95rem;
    border-radius: 6px;
    box-shadow: none;
    transition: background 0.2s, color 0.2s;
}

.user-item>.user-actions {
    margin-left: 1.5rem;
}

/* --- Buttons --- */
.btn-outline-success,
.btn-outline-danger,
.btn-outline-primary,
.btn-outline-warning {
    background: #fff;
    border-width: 2px;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: #e6f4ea;
    color: var(--success);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: #fbeaea;
    color: var(--danger);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: #eaf4fb;
    color: var(--brand);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background: #fffbe6;
    color: var(--warning);
}

#addUserBtn {
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 1.2rem;
}

#toggleDisabledUsersBtn {
    border-radius: 6px;
    padding: 0.4rem 1.2rem;
}

/* Manage Users button colors */
.btn-primary,
.btn-blue2 {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-blue2:hover,
.btn-blue2:focus {
    background-color: #0b477f;
    border-color: #0b477f;
}

.btn-outline-secondary {
    color: var(--brand);
    border-color: var(--border);
    background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #eef3f7;
    border-color: var(--brand);
    color: var(--brand);
}

.btn-red {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-red:hover,
.btn-red:focus {
    background-color: #9e231d;
    border-color: #9e231d;
}

.btn-green {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-green:hover,
.btn-green:focus {
    background-color: #226308;
    border-color: #226308;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    line-height: 1.2;
}

/* ===========================
   Modals (clean + compact)
=========================== */
.loud-modal .modal-dialog {
    max-width: 560px;
}

.loud-modal .modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(1, 50, 95, 0.18);
}

.loud-modal .modal-header,
.loud-modal .modal-footer {
    background: var(--panel);
    border-color: var(--border);
    padding: 12px 16px;
}

.loud-modal .modal-body {
    padding: 14px 16px;
}

.loud-modal .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0;
}

.loud-modal .btn-close {
    opacity: .7;
}

.loud-modal .btn-close:hover {
    opacity: 1;
}

.loud-modal .mb-3 {
    margin-bottom: .65rem !important;
}

.loud-modal .form-label {
    margin-bottom: .35rem;
    font-weight: 600;
}

.loud-modal .form-control,
.loud-modal .form-select {
    border-radius: 6px;
    border-color: #d6dde4;
}

.loud-modal .form-control:focus,
.loud-modal .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(1, 50, 95, 0.12);
}

.loud-modal .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.loud-modal .btn-primary:hover,
.loud-modal .btn-primary:focus {
    background: #0b477f;
    border-color: #0b477f;
}

.loud-modal .btn-secondary {
    background: #fff;
    color: #1e2a36;
    border-color: var(--border);
}

.loud-modal .btn-secondary:hover,
.loud-modal .btn-secondary:focus {
    background: #f6f8fa;
    border-color: #c8d3de;
}

/* ===========================
   Webmail Steps
=========================== */
.webmail-steps {
    padding-left: 1.2rem;
}

.webmail-steps h6 {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 0.25rem;
}

.webmail-steps p {
    font-size: 0.98rem;
}

.webmail-steps img {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border);
}

/* ===========================
   List Group (site-wide)
=========================== */
.list-group {
    background: transparent;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-group-item {
    font-size: 1rem;
    padding: 0.65rem 1rem;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    color: var(--brand);
    background: #f8f9fa;
    transition: background 0.2s, color 0.2s;
}

.list-group-item:hover,
.list-group-item:focus {
    background: #eaf4fb;
    color: var(--link-hover);
    text-decoration: none;
}

/* ===========================
   Accounts Dashboard
=========================== */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 14px;
    background: var(--brand);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}

.list-toolbar .btn {
    border-width: 2px;
}

.list-toolbar .btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, .7);
    background: transparent;
}

.list-toolbar .btn-outline-light:hover,
.list-toolbar .btn-outline-light:focus {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border-color: #fff;
}

.list-toolbar .btn-light {
    background: #fff;
    color: var(--brand);
    border-color: #fff;
}

.list-toolbar .search {
    flex: 1 1 260px;
    min-width: 220px;
}

.list-toolbar .toolbar-actions {
    display: flex;
    gap: 8px;
}

.list-toolbar .search .form-control {
    background: #fff;
    border-color: rgba(255, 255, 255, .7);
}

.list-toolbar .search .form-control:focus {
    border-color: #fff;
    box-shadow: 0 0 0 .15rem rgba(255, 255, 255, .35);
}

/* User rows */
.list-group>.user-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.list-group>.user-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    background: #ffffff;
}

.user-info strong {
    font-weight: 700;
    color: #222;
}

.status-badge {
    display: inline-block;
    margin-left: .5rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .72rem;
    line-height: 1.2;
    border: 1px solid var(--border);
    background: #f7f7f7;
    color: #555;
}

.status-badge.status-disabled {
    background: #fff5f5;
    border-color: #f2c4c1;
    color: var(--danger);
}

/* Full/Part-time badges (keep as-is: FT=warning, PT=info) */
.status-badge.status-ft {
    background: #fff8e8;
    border-color: #f2d9a6;
    color: #8a6a00;
}

.status-badge.status-pt {
    background: #e9f6fb;
    border-color: #bfe5f3;
    color: var(--info);
}

.user-actions .btn {
    min-width: 80px;
}

.user-item.user-disabled {
    opacity: .75;
    background: #fafafa;
}

.project-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.list-group>.project-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    background: #ffffff;
}

.project-item.project-hidden {
    opacity: .8;
}

.project-item.project-system {
    background: #f8f9fb;
}

.project-info {
    flex: 1;
    min-width: 220px;
}

.project-info-line1 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.project-info strong {
    font-weight: 700;
    color: #222;
}

.project-meta-inline {
    font-size: .8rem;
}

.project-desc-line {
    display: block;
    margin-top: 2px;
}

.status-badge.status-visible {
    background: #ebf7eb;
    border-color: #b7dfba;
    color: var(--success);
}

.status-badge.status-system {
    background: #eff3ff;
    border-color: #cad6f3;
    color: #4a5f8a;
}

.project-user-option {
    margin-bottom: .35rem;
}

.project-user-option.project-user-disabled {
    opacity: .65;
}

.project-user-inactive-alert {
    color: var(--danger);
    font-weight: 700;
}

.project-status-toggle-form {
    margin-left: auto;
}

.project-status-toggle-btn {
    position: relative;
    min-width: 88px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.project-status-toggle-btn .label-hover {
    display: none;
}

.project-status-toggle-btn:hover .label-default,
.project-status-toggle-btn:focus-visible .label-default {
    display: none;
}

.project-status-toggle-btn:hover .label-hover,
.project-status-toggle-btn:focus-visible .label-hover {
    display: inline;
}

.project-status-toggle-btn--active {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.project-status-toggle-btn--active:hover,
.project-status-toggle-btn--active:focus-visible {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.project-status-toggle-btn--closed {
    background-color: #5b7f55;
    border-color: #5b7f55;
    color: #fff;
}

.project-status-toggle-btn--closed:hover,
.project-status-toggle-btn--closed:focus-visible {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.user-status-toggle-btn {
    min-width: 88px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.user-status-toggle-btn .label-hover {
    display: none;
}

.user-status-toggle-btn:hover .label-default,
.user-status-toggle-btn:focus-visible .label-default {
    display: none;
}

.user-status-toggle-btn:hover .label-hover,
.user-status-toggle-btn:focus-visible .label-hover {
    display: inline;
}

/* Enabled user: muted neutral, then red Disable intent on hover */
.user-status-toggle-btn--enabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.user-status-toggle-btn--enabled:hover,
.user-status-toggle-btn--enabled:focus-visible {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

/* Disabled user: muted green Enable action, bright green on hover */
.user-status-toggle-btn--disabled {
    background-color: #5b7f55;
    border-color: #5b7f55;
    color: #fff;
}

.user-status-toggle-btn--disabled:hover,
.user-status-toggle-btn--disabled:focus-visible {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.reset-pw-btn--muted {
    background-color: #8a8f96;
    border-color: #8a8f96;
    color: #fff;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.reset-pw-btn--muted:hover,
.reset-pw-btn--muted:focus-visible {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.toolbar-toggle-btn {
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

/* Pressed state (Hide ...): inverse hover feedback */
.toolbar-toggle-btn.btn-light:hover,
.toolbar-toggle-btn.btn-light:focus-visible {
    background: transparent;
    color: #f8f9fa;
    border-color: #f8f9fa;
    box-shadow: 0 0 0 1px rgba(248, 249, 250, 0.2);
}

/* Prevent sticky post-click focus styling when not hovering */
.toolbar-toggle-btn.btn-light:focus:not(:hover),
.toolbar-toggle-btn.btn-light:focus-visible:not(:hover) {
    background: #fff;
    color: var(--brand);
    border-color: #fff;
    box-shadow: none;
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 768px) {
    .user-info {
        min-width: 120px;
        max-width: 100%;
    }

    .user-actions {
        flex-direction: column;
        gap: 0.25rem;
        margin-left: 0;
    }

    .user-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0.5rem;
    }

    .box,
    .card {
        padding: 12px 8px;
    }

    h4.page-title {
        font-size: 1.2rem;
    }

    /* Mobile improvements */
    .custom-hour-input {
        min-height: 36px;
        font-size: 1rem !important;
    }

    .custom-project-select {
        height: 34px !important;
        font-size: 0.95rem !important;
    }

    /* Give a bit more width to day columns on small screens */
    .tc th:not(:first-child),
    .tc td:not(:first-child) {
        min-width: 64px;
        max-width: 64px;
    }
}

/* ===========================
   Layout container
=========================== */
.container-page {
    max-width: 1100px;
    margin: 0 auto;
}

/* ===========================
   Page Head (title + actions)
=========================== */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(1, 50, 95, .06);
    margin: 8px 0 16px;
}

.page-head .title-wrap {
    min-width: 0;
}

.page-head .page-title {
    margin: 0;
    color: var(--brand);
    font-weight: 700;
    line-height: 1.2;
    font-size: clamp(1.1rem, 1vw + 1rem, 1.5rem);
}

.page-head .page-subtitle {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .95rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-actions .search-inline {
    min-width: 220px;
    flex: 1 1 260px;
}

.page-actions .search-inline .form-control {
    height: 34px;
    padding: 4px 10px;
}

/* ===========================
   Stack helpers (consistent gaps)
=========================== */
.stack {
    display: grid;
    gap: 12px;
}

.stack-sm {
    display: grid;
    gap: 8px;
}

/* ===========================
   Compact cards/panels
=========================== */
.box {
    background: var(--panel-soft);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card {
    border-radius: 5px;
    box-shadow: none;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
}

.content {
    padding: 0 20px 20px 20px;
}

.toolbar-neutral .btn {
    border-width: 2px;
}

/* Horizontal scroll wrapper for timecard */
.tc-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0;
    /* table owns padding */
}

/* Sticky header and first column for better mobile UX */
.tc thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    /* base for header row */
}

.tc th:first-child,
.tc td:first-child {
    position: sticky;
    left: 0;
}

/* First column cells: light background */
.tc td:first-child {
    z-index: 2;
    background: #e6e6e6 !important;
    box-shadow: 2px 0 0 rgba(0, 0, 0, 0.04);
}

/* Top-left intersection cell should keep brand color */
.tc thead th:first-child,
.tc thead th.th-project {
    z-index: 4;
    background: var(--brand) !important;
    color: #fff !important;
}

/* --- Project select: restore arrow and interactive look --- */
.custom-project-select {
    /* keep compact sizing inside the grid */
    height: 28px !important;
    /* matches .tc row height */
    padding: 0 1.5rem 0 6px !important;
    /* room for arrow */
    width: 100%;
    cursor: pointer;
}

/* Ensure the table select looks enabled with visible arrow */
.tc .td-project .custom-project-select {
    border: 1px solid #cfcfcf !important;
    background-color: #fff !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat !important;
    background-position: right .5rem center !important;
    background-size: 16px 12px !important;
}

.tc .td-project .custom-project-select:focus {
    border-color: var(--brand) !important;
    box-shadow: var(--focus-ring);
}

/* Mobile topbar (visible under lg) */
.topbar-mobile {
    display: none;
}

.topbar-mobile .brand-mark {
    height: 28px;
    width: auto;
}

.topbar-mobile .menu-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    opacity: .9;
}

.topbar-mobile .menu-btn:hover {
    opacity: 1;
}

/* Show topbar and hide left sidebar on mobile */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .topbar-mobile {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--mobilebar-height);
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
        border-bottom: 1px solid var(--sidebar-sep);
        z-index: 1030;
        /* above content */
    }

    .content {
        margin-left: 0 !important;
        padding-top: calc(var(--mobilebar-height) + 12px);
    }
}

.offcanvas.mobile-nav {
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: var(--sidebar-text);
}

.offcanvas.mobile-nav .offcanvas-header {
    border-bottom: 1px solid var(--sidebar-sep);
}

.offcanvas.mobile-nav a.nav-link,
.offcanvas.mobile-nav a {
    color: var(--sidebar-text);
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.offcanvas.mobile-nav a:hover {
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
}

.offcanvas.mobile-nav a.active {
    background-color: rgba(255, 255, 255, .08);
    border-left-color: var(--brand);
}

/* ===========================
   Tables (generic docs list)
=========================== */
.table-docs {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    /* keeps header radius */
}

.table-docs thead th {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    border: none !important;
}

.table-docs tbody tr:nth-child(even) {
    background: #f8f9fb;
}

.table-docs tbody tr:hover {
    background: #eef3f7;
}

.table-docs td,
.table-docs th {
    padding: 0.5rem 0.75rem !important;
    vertical-align: middle;
}

/* Reintroduce row separators even if Bootstrap's table-borderless is used */
.table-docs.table-borderless> :not(caption)>*>* {
    border-bottom: 1px solid var(--border) !important;
}

.table-docs td:first-child,
.table-docs th:first-child {
    white-space: nowrap;
    width: 80px;
}
