/* Zycor Content Management — audit-style scaffolding, Zycor colors */

:root {
    --brand-primary: #1282C4;
    --brand-dark: #0D6A9E;
    --brand-gold: #f2cf27;
    --brand-gold-hover: #d9b820;
    --body-bg: #eef2f6;
    --sidebar-width: 250px;
    --ink: #18202a;
    --muted: #667085;
    --line: #b8d4e8;
    --soft: #E7F4FB;
    --table-striped-bg: var(--soft);
    --table-striped-hover-bg: #d6eef9;
    --danger: #c33232;
    --green: #4d9f3a;
    --toolbar-ctrl-height: 32px;
    --toolbar-ctrl-font: 0.8125rem;
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--brand-primary);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--brand-dark);
    text-decoration: none;
    border-bottom: 2px solid var(--brand-gold);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 50%;
}

.sidebar-brand-text {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 16px 4px;
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

button.sidebar-link,
.sidebar-submenu-toggle {
    width: 100%;
    border: none;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    font-family: inherit;
}

button.sidebar-link:hover,
.sidebar-submenu-toggle:hover {
    transform: none;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-left-color: var(--brand-gold);
}

.sidebar-link.active {
    background: var(--brand-dark);
    color: var(--brand-gold);
    border-left-color: var(--brand-gold);
    font-weight: 600;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-submenu-toggle {
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.sidebar-submenu-toggle .sidebar-submenu-chevron {
    margin-left: auto;
    width: auto;
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.sidebar-submenu.open > .sidebar-submenu-toggle .sidebar-submenu-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu-items {
    display: none;
    padding-bottom: 4px;
}

.sidebar-submenu.open > .sidebar-submenu-items {
    display: block;
}

.sidebar-sublink {
    padding-left: 42px;
    font-size: 13px;
}

.sidebar-sublink i {
    font-size: 13px;
}

.sidebar-submenu-items .sidebar-submenu-toggle.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nested-sublink {
    padding-left: 62px;
    font-size: 12px;
}

.zoho-account-cell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.zoho-account-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(18, 130, 196, 0.12);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    margin-top: auto;
    background: var(--brand-primary);
}

.sidebar-footer form {
    margin: 0;
}

.sidebar-footer .sidebar-logout {
    color: rgba(255, 150, 150, 0.92);
}

.sidebar-footer .sidebar-logout:hover {
    color: #ffb4b4;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer-user {
    padding: 8px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    word-break: break-word;
}

.sidebar-footer-user strong {
    color: var(--brand-gold);
}

/* Topbar */
.topbar.topbar-app {
    height: 60px;
    min-height: 60px;
    background: var(--brand-primary);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    width: auto;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: visible;
    transition: left 0.25s ease;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.topbar-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topbar-settings-btn:hover,
.topbar-settings-btn:focus,
.topbar-settings-btn.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
    outline: none;
}

.topbar-user .role-badge {
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.topbar-app .topbar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-right: 12px;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
    outline: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    padding: 24px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.25s ease;
}

body.layout-sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.layout-sidebar-collapsed .topbar.topbar-app {
    left: 0;
}

body.layout-sidebar-collapsed .main-content {
    margin-left: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn.btn-brand {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn.btn-outline-brand {
    background-color: #fff;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn.btn-outline-brand:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.btn-icon-only {
    width: var(--toolbar-ctrl-height);
    height: var(--toolbar-ctrl-height);
    min-width: var(--toolbar-ctrl-height);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-header-actions .btn,
.row-actions .btn:where(:has(i), :has(svg)),
.filter-toolbar-actions .btn {
    width: var(--toolbar-ctrl-height);
    height: var(--toolbar-ctrl-height);
    min-width: var(--toolbar-ctrl-height);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Forms */
.form-label,
.control-label,
.standard-form .mb-3 > label:not(.form-check-label),
.standard-form [class*="field-"] > label:not(.form-check-label),
.compact-form-modern .mb-3 > label:not(.form-check-label),
.compact-form-modern [class*="field-"] > label:not(.form-check-label),
.followup-form .mb-3 > label:not(.form-check-label),
.followup-form [class*="field-"] > label:not(.form-check-label),
.pms-txn-edit-form .mb-3 > label:not(.form-check-label),
.pms-txn-edit-form [class*="field-"] > label:not(.form-check-label) {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ink);
}

.form-label,
.control-label,
.standard-form .mb-3 > label:not(.form-check-label),
.standard-form [class*="field-"] > label:not(.form-check-label),
.compact-form-modern .mb-3 > label:not(.form-check-label),
.compact-form-modern [class*="field-"] > label:not(.form-check-label),
.followup-form .mb-3 > label:not(.form-check-label),
.followup-form [class*="field-"] > label:not(.form-check-label),
.pms-txn-edit-form .mb-3 > label:not(.form-check-label),
.pms-txn-edit-form [class*="field-"] > label:not(.form-check-label) {
    margin-bottom: 0.375rem;
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #444;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 0.2rem rgba(242, 207, 39, 0.25);
}

.required > label::after,
.required > .form-label::after,
.required > .control-label::after {
    content: " *";
    color: var(--danger);
    font-weight: 700;
}

.standard-form-page {
    width: 100%;
    max-width: 100%;
}

.standard-form-page > .card {
    width: 100%;
}

.emp-form-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e8ef;
}

.emp-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.emp-form-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 0.25rem;
}

.emp-form-actions .btn-brand {
    min-width: 120px;
}

/* Tables */
.table > :not(caption) > * > * {
    padding: 0.35rem 0.55rem;
}

.table thead th {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
    border: none;
    vertical-align: middle;
}

.attendance-grid-table thead th.attendance-grid-sticky-col {
    background: #f8f9fa;
    color: var(--ink);
    z-index: 3;
}

.table tbody th {
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
    border-color: var(--line);
}

.table td {
    vertical-align: middle;
    font-size: 0.8125rem;
}

.table.table-striped > tbody > tr:nth-of-type(odd) > th,
.table.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--table-striped-bg);
}

.table-striped {
    --bs-table-striped-bg: var(--table-striped-bg);
    --bs-table-hover-bg: var(--table-striped-hover-bg);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--table-striped-bg);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--table-striped-bg);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--table-striped-hover-bg);
}

.table.pms-grid tbody th {
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.table.pms-grid .pms-grid-row--opening > th,
.table.pms-grid .pms-grid-row--opening > td,
.table.pms-grid .pms-grid-row--closing > th,
.table.pms-grid .pms-grid-row--closing > td {
    background: var(--table-striped-bg);
    color: var(--brand-dark);
}

.table.pms-grid .pms-grid-row--sub > th,
.table.pms-grid .pms-grid-row--sub > td {
    color: var(--muted);
    font-size: 0.8125rem;
}

.table.pms-grid .pms-grid-row--child > th,
.table.pms-grid .pms-grid-row--child > td {
    background: rgba(223, 245, 255, 0.35);
}

.table.pms-grid .pms-grid-toggle {
    color: var(--brand-dark);
    font-weight: 700;
    text-decoration: none;
}

.table.pms-grid .pms-grid-toggle:hover {
    color: var(--brand-primary);
}

tbody tr[data-pms-txn-edit],
tbody tr[data-pms-ledger-edit] {
    cursor: pointer;
}

tbody tr[data-pms-txn-edit]:hover,
tbody tr[data-pms-ledger-edit]:hover {
    background-color: var(--table-striped-hover-bg);
}

.card-pagination {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: center;
}

.card-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
}

.card-pagination .page-item {
    display: flex;
}

.card-pagination .page-item .page-link {
    margin-left: 0;
}

.card-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.125rem;
    min-height: 2.125rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    color: var(--brand-primary);
    background-color: #fff;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    text-decoration: none;
    box-shadow: none;
}

.card-pagination .page-link:hover,
.card-pagination .page-link:focus {
    color: var(--brand-dark);
    background-color: var(--soft);
    border-color: var(--brand-primary);
    box-shadow: none;
}

.card-pagination .page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    z-index: 1;
}

.card-pagination .page-item.disabled .page-link {
    color: var(--muted);
    background-color: #fff;
    border-color: var(--line);
    opacity: 0.65;
    pointer-events: none;
}

.table-row-clickable tbody tr[data-href],
.table-row-clickable tbody tr.clickable-table-row {
    cursor: pointer;
}

.table-row-clickable tbody tr[data-href]:hover,
.table-row-clickable tbody tr.clickable-table-row:hover {
    background-color: var(--table-striped-hover-bg);
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
}

.row-actions form {
    display: inline;
    margin: 0;
}

/* Filter toolbar */
.filter-toolbar-card .card-body {
    padding: 8px 12px;
    overflow-x: auto;
}

.filter-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: min-content;
}

.filter-toolbar .form-select,
.filter-toolbar .form-control,
.card-header-filters .form-select,
.card-header-filters .form-control {
    flex-shrink: 0;
    height: var(--toolbar-ctrl-height);
    min-height: var(--toolbar-ctrl-height);
    padding: 0.25rem 0.65rem;
    font-size: var(--toolbar-ctrl-font);
    line-height: 1.25;
    border: 0.0625rem solid var(--line);
    border-radius: 0.375rem;
}

.filter-toolbar .form-select {
    padding-right: 1.75rem;
    min-width: 8.75rem;
}

.filter-field-sm {
    width: 9.5rem;
    min-width: 9.5rem;
    max-width: 9.5rem;
}

.filter-field-md {
    width: 11.5rem;
    min-width: 11.5rem;
    max-width: 11.5rem;
}

.filter-field-lg {
    width: 14rem;
    min-width: 14rem;
    max-width: 14rem;
}

.filter-field-date,
.filter-field-month {
    width: 8.75rem;
    min-width: 8.75rem;
    max-width: 8.75rem;
}

.filter-date-range {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.filter-date-range .filter-date-sep {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
}

.card-header-filters .filter-date-range .filter-date-sep {
    color: rgba(255, 255, 255, 0.75);
}

.filter-toolbar .btn-sm,
.card-header-filters .btn-sm {
    height: var(--toolbar-ctrl-height);
    min-height: var(--toolbar-ctrl-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    font-size: var(--toolbar-ctrl-font);
    line-height: 1.25;
}

.card-header-actions .btn {
    width: var(--toolbar-ctrl-height);
    min-width: var(--toolbar-ctrl-height);
    padding-left: 0;
    padding-right: 0;
}

.filter-toolbar-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.filter-toolbar .task-progress-legend {
    margin: 0;
}

/* Single-line card header with inline filters */
.card-header-toolbar {
    overflow-x: auto;
}

.card-header-toolbar .card-header-title {
    max-width: 220px;
}

.card-header-filters {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
}

.card-header-filters .filter-toolbar,
.card-header-filters form {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: min-content;
    margin: 0;
}

.card-header-filters .filter-toolbar {
    width: 100%;
}

.card-header-filters .filter-toolbar--calendar,
.card-header-filters .filter-toolbar--calendar form,
.card-header-filters .cal-header-nav-group {
    width: auto;
    flex-shrink: 0;
}

.card-header-filters .filter-toolbar--calendar {
    justify-content: space-between;
    width: 100%;
}

.card-header-filters .cal-header-nav,
.card-header-filters .cal-header-filters-secondary {
    width: auto;
}

.card-header-filters .form-select,
.card-header-filters .form-control {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.card-header-filters .form-select {
    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='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 12px 10px;
    padding-right: 1.75rem;
}

.card-header-filters .form-select option {
    background: var(--brand-dark);
    color: #fff;
}

.card-header-filters .form-control::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.card-header-filters .text-muted,
.card-header-filters .small {
    color: rgba(255, 255, 255, 0.82) !important;
}

.card-header-filters label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    white-space: nowrap;
}

.card-header-filters .filter-toolbar-actions {
    margin-left: auto;
}

.card-header-filters .btn-brand {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.92);
    color: var(--brand-dark);
}

.card-header-filters .btn-brand:hover {
    background: #fff;
    color: var(--brand-dark);
}

.card-header-filters .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.card-header-filters .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.card-header-filters .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.card-header-filters .filter-toolbar--calendar .cal-stat-pill {
    min-width: 5.5rem;
    padding: 4px 8px;
}

.card-header-filters .filter-toolbar--calendar .cal-stat-num {
    font-size: 16px;
}

.card-header-filters .filter-toolbar--calendar .filter-field-md {
    width: 9.5rem;
    min-width: 9.5rem;
    max-width: 9.5rem;
}

.card-header-filters .cal-nav-btn,
.card-header-filters .cal-nav-select {
    flex-shrink: 0;
}

/* Tooltips */
.tooltip-inner {
    background-color: var(--brand-dark);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: var(--brand-dark);
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: var(--brand-dark);
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: var(--brand-dark);
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: var(--brand-dark);
}

/* Calendar header (planner) */
.cal-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    background: var(--brand-primary);
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 16px rgba(7, 137, 195, 0.25);
    overflow-x: auto;
}

.cal-header-card--compact {
    gap: 10px 16px;
    flex-wrap: nowrap;
}

.cal-header-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    align-self: center;
}

.cal-header-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    width: auto;
    max-width: none;
    margin: 0 0 0 auto;
    flex: 0 1 auto;
    min-width: 0;
}

.cal-header-nav--toolbar,
.cal-header-nav--primary {
    margin-left: auto;
    flex-shrink: 1;
}

.filter-toolbar--calendar {
    width: 100%;
}

.cal-header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.cal-header-card--compact .cal-stat-pill {
    padding: 4px 8px;
    min-width: 5.5rem;
}

.cal-header-card--compact .cal-stat-num {
    font-size: 16px;
}

@media (max-width: 1200px) {
    .cal-header-card--compact {
        flex-wrap: wrap;
    }

    .cal-header-card--compact .cal-header-nav--toolbar {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
}

.filter-toolbar--calendar .cal-header-nav {
    margin-left: 0;
}

.card-header-toolbar--calendar {
    overflow-x: auto;
    overflow-y: visible;
}

.planner-view--calendar-month .cal-header-card {
    flex-shrink: 0;
}

.cal-stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    min-width: 110px;
}

.cal-stat-pill > i {
    font-size: 16px;
    opacity: 0.8;
}

.cal-stat-body {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cal-stat-num {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.cal-stat-lbl {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.8;
}

.cal-stat-empty { background: #fde8eb; color: #8b1a2a; }
.cal-stat-uploaded { background: #fff3cd; color: #7a5a00; }
.cal-stat-published { background: #d4f5e2; color: #1a6b3a; }

.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
    border: none;
    flex-shrink: 0;
}

.cal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

/*
 * Explicit widths required: Bootstrap `.form-select { width: 100% }` plus
 * publisher.css `select { width: 100% }` stretch month/year under platform/company.
 */
.cal-header-card select.form-select.cal-nav-select {
    display: inline-block;
    box-sizing: border-box;
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 7.5rem;
    min-width: 7.5rem;
    max-width: 7.5rem;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    color-scheme: dark;
    background-color: rgba(255, 255, 255, 0.15);
    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='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 0 1.75rem 0 0.5rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cal-header-card select.form-select.cal-nav-select--year {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
}

.cal-header-card select.form-select.cal-nav-select--platform,
.cal-header-card select.form-select.cal-nav-select--company {
    width: 10.5rem;
    min-width: 10.5rem;
    max-width: 10.5rem;
}

.cal-header-card select.form-select.cal-nav-select:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.2);
    outline: none;
}

.cal-header-card select.form-select.cal-nav-select option {
    background: var(--brand-dark);
    color: #fff;
}

.card-header-filters .cal-nav-select {
    min-width: 7.5rem;
}

.cal-nav-today-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    height: 32px;
    border-radius: 8px;
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.cal-nav-today-btn:hover {
    background: var(--brand-gold-hover);
    color: var(--brand-dark);
}

/* Calendar grid */
.calendar-grid {
    width: 100%;
    border-collapse: collapse;
}

.calendar-grid th {
    background: var(--brand-primary);
    color: #fff;
    text-align: center;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.calendar-grid td {
    width: calc(100% / 7);
    vertical-align: top;
    border: 1px solid #d8e4ec;
    padding: 0;
}

.cal-cell {
    min-height: 110px;
    height: 100%;
    padding: 6px 7px 5px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.cal-cell-empty { background: #f8fafc; }
.cal-cell-today { box-shadow: inset 0 0 0 2px var(--brand-gold); }

/* Toast stack */
#site-toast-stack {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

#site-toast-stack .toast {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 320px;
}

#site-toast-stack .notice-msg {
    background: #d4edda;
    color: #155724;
}

#site-toast-stack .error-msg {
    background: #f8d7da;
    color: #721c24;
}

.no-print {
    /* utility */
}

@media print {
    .sidebar,
    .topbar,
    .no-print,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    body.layout-sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    body.layout-sidebar-collapsed .sidebar.open {
        transform: translateX(0);
    }

    .topbar.topbar-app {
        left: 0;
        right: 0;
        width: auto;
    }

    .main-content {
        margin-left: 0;
    }

    body.layout-sidebar-collapsed .topbar.topbar-app,
    body.layout-sidebar-collapsed .main-content {
        margin-left: 0;
        left: 0;
    }

    .cal-cell {
        min-height: 80px;
    }
}

.settings-hub-card {
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.settings-hub-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.settings-hub-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.pms-txn-tabs .nav-link {
    color: var(--muted);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.5rem 1rem;
}

.pms-txn-tabs .nav-link.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    background: transparent;
}

.pms-txn-row--pending {
    opacity: 1;
}

.pms-txn-row--pending:hover {
    opacity: 1;
}

table.pms-txn-table > thead > tr > th,
table.pms-txn-table > tbody > tr > td {
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
}

table.pms-txn-table .pms-txn-details-col {
    max-width: 16rem;
    min-width: 10rem;
}

table.pms-txn-table .pms-txn-details-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

table.pms-txn-table .pms-txn-details-field {
    margin-top: 0.2rem;
}

table.pms-txn-table .pms-pending-field.form-select-sm {
    min-height: 1.75rem;
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

table.pms-txn-table th.pms-txn-date-col,
table.pms-txn-table td.pms-txn-date-col {
    white-space: nowrap;
    width: 1%;
    min-width: 6.75rem;
}

table.pms-txn-table .pms-txn-debit,
table.pms-txn-table .pms-txn-credit,
table.pms-txn-table .pms-txn-balance {
    white-space: nowrap;
}

.pms-import-dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: calc(100% - 2rem);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.pms-import-dialog::backdrop {
    background: rgba(24, 32, 42, 0.45);
}

/* ── Shared page patterns (lists, forms, empty states) ── */
.main-content > .card,
.main-content > .standard-form-page > .card,
.main-content > .cal-header-card {
    border: 1px solid rgba(18, 130, 196, 0.12);
    box-shadow: 0 2px 10px rgba(13, 106, 158, 0.08);
}

.form-card-header .header-actions .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.form-card-header .header-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-empty-state .btn-brand {
    margin-top: 0.25rem;
}

.standard-form .form-control,
.standard-form .form-select {
    width: 100%;
    border-color: var(--line);
    border-radius: 8px;
}

.searchable-select {
    position: relative;
}

.searchable-select-toggle {
    width: 100%;
    min-height: var(--control-min-height, 2.625rem);
    padding: 0.625rem 0.875rem;
    border: 0.0625rem solid var(--line);
    border-radius: 0.5rem;
    background: #fff;
    color: var(--ink);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
}

.searchable-select-toggle:hover,
.searchable-select-toggle:focus {
    border-color: var(--brand-primary);
    background: #fff;
    color: var(--ink);
}

.searchable-select-menu {
    width: 100%;
    padding: 0;
    max-height: 260px;
    overflow: hidden;
    border: 0.0625rem solid var(--line);
    border-radius: 0.5rem;
}

.searchable-select-search-wrap {
    padding: 8px;
    border-bottom: 1px solid var(--line);
}

.searchable-select-options {
    max-height: 200px;
    overflow-y: auto;
}

.searchable-select-option {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--ink);
}

.searchable-select-option:hover,
.searchable-select-option.active {
    background: var(--soft);
    color: var(--brand-primary);
}

.badge.bg-success {
    background-color: var(--green) !important;
}

/* Payroll + dashboard stat cards */
.stat-card-row > .col {
    display: flex;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    border-radius: 12px;
    padding: 18px 14px;
    min-height: 116px;
    width: 100%;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    box-shadow: 0 4px 14px rgba(13, 106, 158, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-card-opening {
    background: linear-gradient(135deg, #e59b1a, #c47d0c);
    box-shadow: 0 4px 15px rgba(196, 125, 12, 0.35);
}

.stat-card-cash-in {
    background: linear-gradient(135deg, #4d9f3a, #3a7d2c);
    box-shadow: 0 4px 15px rgba(77, 159, 58, 0.35);
}

.stat-card-closing {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
    box-shadow: 0 4px 15px rgba(18, 130, 196, 0.35);
}

.stat-card-cash-out {
    background: linear-gradient(135deg, #c33232, #9e2424);
    box-shadow: 0 4px 15px rgba(195, 50, 50, 0.35);
}

.stat-card-balance {
    background: linear-gradient(135deg, #5b6abf, #3f4d9a);
    box-shadow: 0 4px 15px rgba(91, 106, 191, 0.35);
}

.stat-card-negative {
    background: linear-gradient(135deg, #b02a37, #7a1d26);
    box-shadow: 0 4px 15px rgba(176, 42, 55, 0.4);
}

.stat-card-icon {
    font-size: 20px;
    line-height: 1;
    opacity: 0.9;
    margin-bottom: 8px;
    color: #fff;
}

.stat-card-amount {
    font-size: clamp(16px, 1.8vw, 26px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.15;
    max-width: 100%;
    word-break: break-word;
    color: #fff;
}

.stat-card-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 6px;
    color: #fff;
}

.payroll-settings-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

tr.payroll-txn-row { cursor: pointer; }

tr.payroll-txn-row:hover {
    background-color: rgba(18, 130, 196, 0.07);
}

.payroll-audit-trail {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payroll-audit-entry {
    border: 1px solid rgba(18, 130, 196, 0.12);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.payroll-audit-entry-header {
    background: rgba(18, 130, 196, 0.04);
    border-bottom: 1px solid rgba(18, 130, 196, 0.08);
    padding: 10px 14px;
}

.payroll-audit-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    font-size: 13px;
    color: #555;
}

.payroll-audit-snapshot {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0;
    margin: 0;
    padding: 4px 0;
}

.payroll-audit-snapshot-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.payroll-audit-snapshot-row dt {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #888;
}

.payroll-audit-snapshot-row dd {
    margin: 0;
    font-size: 14px;
    color: #222;
    word-break: break-word;
}

.payroll-audit-old {
    color: #a94442;
    text-decoration: line-through;
    opacity: 0.85;
}

.payroll-audit-new {
    color: #1e7e34;
    font-weight: 600;
}

