/* SHARKS CREDIT AND COLLECTION SERVICE CORPORATION - UI */

:root {
    --text-primary: #111827;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Arial, sans-serif;
    background: #f0f2f7;
    color: #111827;
    font-size: 13.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* LAYOUT */
.layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    --sidebar-bg: #0b1220;
    --sidebar-surface: rgba(255, 255, 255, 0.04);
    --sidebar-border: rgba(148, 163, 184, 0.12);
    --sidebar-text: #94a3b8;
    --sidebar-text-strong: #e2e8f0;
    --sidebar-accent: #3b82f6;
    width: 248px;
    background:
        linear-gradient(180deg, rgba(30, 58, 138, 0.18) 0%, transparent 140px),
        linear-gradient(180deg, #0b1220 0%, #0a101c 100%);
    border-right: 1px solid var(--sidebar-border);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
}

.sidebar-brand {
    flex-shrink: 0;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.sidebar-logo {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    letter-spacing: -0.3px;
}

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

.brand-name {
    display: block;
    line-height: 1.25;
    word-break: break-word;
}

.sidebar .brand-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--sidebar-text-strong);
}

.sidebar-role-badge {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.28);
}

.login-logo .brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    background: #2563eb;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    line-height: 28px;
    text-align: center;
}

.logo-mark {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.35);
}

.sidebar-brand .logo-mark {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    box-shadow: none;
    object-fit: cover;
    overflow: hidden;
}

.login-logo .logo-mark {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

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

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

.sidebar-section {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 14px 10px 6px;
}

.sidebar-section:first-child {
    padding-top: 6px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
    position: relative;
}

.sidebar a span {
    min-width: 0;
}

.sidebar a .sidebar-notif {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--sidebar-bg);
}

.sidebar a .sidebar-notif[hidden] {
    display: none !important;
}

.sidebar a.active .sidebar-notif {
    box-shadow: 0 0 0 2px transparent;
}

.sidebar a svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
    opacity: .72;
}

.sidebar a:hover {
    background: var(--sidebar-surface);
    color: var(--sidebar-text-strong);
}

.sidebar a:hover svg {
    opacity: .95;
}

.sidebar a.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.08));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.22);
}

.sidebar a.active svg {
    opacity: 1;
    color: #93c5fd;
}

.sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--sidebar-accent);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 10px 2px;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 12px 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 9px;
    border-radius: 10px;
    background: var(--sidebar-surface);
    border: 1px solid var(--sidebar-border);
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #dbeafe;
    background: linear-gradient(145deg, #1d4ed8, #2563eb);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.sidebar-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.collector-topnav-avatar-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: -4px;
    margin-right: 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sidebar-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
}

a.sidebar-user {
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

a.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

a.sidebar-user:hover .sidebar-user-name {
    color: #ffffff;
}

a.sidebar-user:hover .sidebar-user-gear {
    color: #38bdf8;
    transform: rotate(35deg);
}

a.sidebar-user.active {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(59, 130, 246, 0.5);
}

a.sidebar-user.active .sidebar-user-name {
    color: #93c5fd;
}

a.sidebar-user.active .sidebar-user-gear {
    color: #60a5fa;
}

.sidebar-user-gear {
    margin-left: auto;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, color 0.15s ease;
    flex-shrink: 0;
}

.collector-topnav .collector-topnav-profile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.sidebar .logout {
    margin-top: 0;
    color: #fca5a5;
    border: 1px solid transparent;
}

.sidebar .logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.2);
}

.sidebar .logout svg {
    opacity: .9;
}

/* MAIN */
.main {
    margin-left: 248px;
    flex: 1;
    padding: 30px 34px;
    min-height: 100vh;
}

.mobile-app-bar,
.mobile-nav-backdrop,
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .mobile-app-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 30;
        width: 100%;
        min-height: 52px;
        padding: 8px 12px;
        background: #0b1220;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
        color: #e2e8f0;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.08);
        color: #f8fafc;
        cursor: pointer;
    }

    .mobile-nav-toggle.has-notif::after {
        content: '';
        position: absolute;
        top: 6px;
        right: 6px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ef4444;
        box-shadow: 0 0 0 2px #0b1220;
    }

    .mobile-nav-toggle svg {
        width: 18px;
        height: 18px;
    }

    .mobile-app-bar-title {
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .mobile-nav-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(15, 23, 42, 0.55);
    }

    .sidebar {
        transform: translateX(-105%);
        width: min(280px, 88vw);
        z-index: 40;
        transition: transform 0.22s ease;
    }

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

    .main {
        margin-left: 0 !important;
        width: 100%;
        min-width: 0;
        padding: 16px 14px 28px;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }
}

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
    line-height: 1.25;
}

.page-header p,
.page-header .customer-page-sub,
.page-header .app-page-sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

/* Shared app chrome (ledger-style) */
.app-page-header,
.office-ledger-page-header,
.due-ledger-page-header {
    margin-bottom: 14px;
}

.js-edit-perm-decide {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.js-edit-perm-decide[hidden] {
    display: none !important;
}

.app-page-actions,
.office-ledger-page-actions,
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.app-page-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.app-card {
    border-color: #dbe3f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-card > .card-head {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom-color: #e2e8f0;
    padding: 14px 18px;
    gap: 10px;
    flex-wrap: wrap;
}

.app-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 64, 175, 0.18);
    border-radius: 10px;
}

.app-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.app-meta-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.app-meta-field--full {
    grid-column: 1 / -1;
}

.app-meta-row--address {
    grid-template-columns: 1fr 1fr 1fr;
}

.app-meta-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
}

.app-meta .ledger-input,
.app-meta input[type="text"],
.app-meta input[type="date"],
.app-meta input[type="number"],
.app-meta select {
    border: none;
    border-bottom: 1px solid #3b82f6;
    background: transparent;
    border-radius: 0;
    font-size: 12.5px;
    padding: 2px 0;
    color: #0f172a;
    font-family: inherit;
    width: 100%;
    min-width: 0;
}

.app-meta input:focus,
.app-meta select:focus {
    outline: none;
    border-bottom-color: #1d4ed8;
}

.app-sheet-card {
    overflow: hidden;
    padding: 0;
}

.app-sheet-card .client-attendance-sheet,
.app-sheet-card .monitoring-report-sheet {
    margin: 0;
    border-radius: 0 0 12px 12px;
}

.app-sheet-card .promissory-note-sheet {
    margin: 18px auto;
    border-radius: 4px;
}

.app-sheet-card .monitoring-report-sheet {
    padding: 22px 20px 26px;
    background: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

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

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

    .stat-card:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,.1);
        transform: translateY(-1px);
    }

    .stat-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
    }

    .stat-card.blue::after {
        background: #2563eb;
    }

    .stat-card.green::after {
        background: #16a34a;
    }

    .stat-card.amber::after {
        background: #d97706;
    }

    .stat-card.red::after {
        background: #dc2626;
    }

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

    .stat-icon.blue {
        background: #eff6ff;
        color: #2563eb;
    }

    .stat-icon.green {
        background: #f0fdf4;
        color: #16a34a;
    }

    .stat-icon.amber {
        background: #fffbeb;
        color: #d97706;
    }

    .stat-icon.red {
        background: #fef2f2;
        color: #dc2626;
    }

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1;
}

    .stat-value.blue {
        color: #2563eb;
    }

    .stat-value.green {
        color: #16a34a;
    }

    .stat-value.amber {
        color: #d97706;
    }

    .stat-value.red {
        color: #dc2626;
    }

a.stat-card {
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.stats-grid.dash-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Dashboard page */
.dashboard-page .dash-hero {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px 24px;
    padding: 18px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #1e40af 100%);
    border: 1px solid #16304f;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.dashboard-page .dash-hero-text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    text-align: left;
}

.dashboard-page .dash-hero h1 {
    color: #fff;
    font-size: 24px;
    letter-spacing: -0.4px;
    margin: 0;
    text-align: left;
}

.dashboard-page .dash-hero .app-page-sub {
    color: rgba(226, 232, 240, 0.88);
    margin-top: 6px;
    text-align: left;
}

.dashboard-page .dash-hero .app-page-sub strong {
    color: #fff;
    font-weight: 700;
}

.dashboard-page .dash-hero-kicker {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.9);
    text-align: left;
}

.dashboard-page .dash-hero-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-left: auto;
    text-align: left;
}

.dashboard-page .dash-hero-date {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.85);
}

.dashboard-page .dash-hero-day {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.dashboard-page .dash-section-label {
    margin: 4px 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.dashboard-page .stats-grid.dash-stats {
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-page .stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 18px 16px;
    border-color: #d7e0ec;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dashboard-page .stat-card::after {
    height: 3px;
}

.dashboard-page .stat-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.dashboard-page .stat-body {
    min-width: 0;
    flex: 1;
}

.dashboard-page .stat-label {
    color: #64748b;
    margin-bottom: 8px;
}

.dashboard-page .stat-value {
    font-size: 24px;
    letter-spacing: -0.6px;
    color: #0f172a;
}

.dashboard-page .stat-value.blue,
.dashboard-page .stat-value.green,
.dashboard-page .stat-value.amber,
.dashboard-page .stat-value.red {
    color: inherit;
}

.dashboard-page .stat-card.blue .stat-value { color: #1d4ed8; }
.dashboard-page .stat-card.green .stat-value { color: #15803d; }
.dashboard-page .stat-card.amber .stat-value { color: #b45309; }
.dashboard-page .stat-card.red .stat-value { color: #b91c1c; }

.dashboard-page a.stat-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.dashboard-page .dash-link-hint {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
}

.dashboard-page .stat-card.is-attention {
    border-color: #fcd34d;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.dashboard-page .stat-card.is-attention.red {
    border-color: #fca5a5;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.18);
}

.dash-card-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.dash-card-title > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dash-card-sub {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.dash-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    font-weight: 800;
}

.dash-count-badge--red {
    background: #fee2e2;
    color: #b91c1c;
}

.dash-action-card {
    margin-bottom: 18px;
    border-left: 3px solid #cbd5e1;
}

.dash-action-card--amber {
    border-left-color: #d97706;
}

.dash-action-card--red {
    border-left-color: #dc2626;
}

.dash-table-pad {
    padding: 0 16px 16px;
}

.dash-date-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 0 auto;
}

.dash-date-form label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-date-form input[type="date"],
.dash-date-form select {
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    font-weight: 600;
    color: #0f172a;
}

.dash-date-form input[type="date"]:focus,
.dash-date-form select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.dashboard-page .dash-report-card {
    border-color: #d0d7e4;
}

@media (max-width: 720px) {
    .dashboard-page .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 16px 14px;
        margin-bottom: 16px;
    }

    .dashboard-page .dash-hero-text {
        width: 100%;
        text-align: left;
    }

    .dashboard-page .dash-hero h1 {
        font-size: 22px;
        text-align: left;
    }

    .dashboard-page .dash-hero-meta {
        align-items: flex-start;
        text-align: left;
        margin-left: 0;
        width: 100%;
    }

    .dashboard-page .stats-grid.dash-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-page .stat-card {
        padding: 14px 14px 12px;
        gap: 12px;
    }

    .dashboard-page .stat-label {
        white-space: normal;
        letter-spacing: 0.04em;
        line-height: 1.3;
    }

    .dashboard-page .stat-value {
        font-size: 22px;
    }

    .dashboard-page .dash-date-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-page .dash-date-form label {
        width: 100%;
    }

    .dashboard-page .dash-date-form input[type="date"],
    .dashboard-page .dash-date-form select {
        width: 100%;
        min-height: 42px;
    }

    .dashboard-page .dash-report-card .card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-page .table-wrap {
        margin: 0 -4px;
    }

    .dashboard-page .dash-action-card .table-wrap,
    .dashboard-page .dash-report-card .table-wrap {
        overflow: visible;
        margin: 0;
        padding: 0 12px 12px;
    }

    .dashboard-page .dash-action-card table thead,
    .dashboard-page .dash-report-card table thead {
        display: none;
    }

    .dashboard-page .dash-action-card table,
    .dashboard-page .dash-action-card tbody,
    .dashboard-page .dash-action-card tr,
    .dashboard-page .dash-action-card td,
    .dashboard-page .dash-report-card table,
    .dashboard-page .dash-report-card tbody,
    .dashboard-page .dash-report-card tr,
    .dashboard-page .dash-report-card td {
        display: block;
        width: 100%;
        border: 0;
    }

    .dashboard-page .dash-action-card tr,
    .dashboard-page .dash-report-card tbody tr {
        margin: 0 0 10px;
        padding: 12px 14px;
        background: #fff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
    }

    .dashboard-page .dash-action-card td[data-label],
    .dashboard-page .dash-report-card td[data-label] {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        padding: 6px 0;
        font-size: 14px;
    }

    .dashboard-page .dash-action-card td[data-label]::before,
    .dashboard-page .dash-report-card td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 42%;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
    }

    .dashboard-page .dash-action-card td.file-actions,
    .dashboard-page .dash-report-card td.file-actions {
        flex-direction: column;
        align-items: stretch;
        padding-top: 10px;
    }

    .dashboard-page .dash-action-card td.file-actions::before,
    .dashboard-page .dash-report-card td.file-actions::before {
        display: none;
    }

    .dashboard-page .dash-action-card td.file-actions .btn-sm,
    .dashboard-page .dash-report-card td.file-actions .btn-sm {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }

    .dashboard-page .dash-report-card td[colspan] {
        text-align: center;
        color: #64748b;
        padding: 12px 0;
    }

    .dashboard-page .dash-report-card td[colspan]::before {
        display: none;
    }

    .dashboard-page .dash-card-title > span:first-child {
        white-space: normal;
        line-height: 1.35;
    }
}


/* CARDS */
.card {
    background: #ffffff;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-subhead {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 22px;
}

    .form-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .field label {
        font-size: 11px;
        font-weight: 700;
        color: #1e40af;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    .field input,
    .field select {
        width: 100%;
        height: 38px;
        border: 1.5px solid #e4e7ef;
        border-radius: 8px;
        padding: 0 12px;
        font-size: 13.5px;
        color: #111827;
        background: #f7f8fc;
        font-family: inherit;
        transition: border-color .15s, background .15s, box-shadow .15s;
        -webkit-appearance: none;
        appearance: none;
    }

    .field select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%239ca3af'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 32px;
        cursor: pointer;
    }

        .field input:focus,
        .field select:focus {
            outline: none;
            border-color: #2563eb;
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(37,99,235,.1);
        }

    .field input::placeholder {
        color: #d1d5db;
    }

.form-actions {
    padding: 14px 22px;
    border-top: 1px solid #eef0f6;
    display: flex;
    justify-content: flex-end;
    background: #f7f8fc;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .12s;
    line-height: 1;
}

    .btn:active {
        transform: scale(.97);
    }

.btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

    .btn-primary:hover {
        opacity: .9;
    }

.btn-sm {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
    line-height: 1;
}

    .btn-sm:hover {
        opacity: .88;
    }

.btn-sm:disabled,
.btn-sm[disabled],
.btn-sm.is-locked,
.tr-release-done-locked {
    background: #94a3b8 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.65;
    pointer-events: none;
}

.tr-release-done-locked {
    position: relative;
    padding-right: 28px !important;
}

.tr-release-done-locked::after {
    content: '🔒';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    line-height: 1;
}

/* TABLE */
.table-wrap {
    overflow-x: auto;
}

.empty-row {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 18px 22px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 11px 22px;
    border-bottom: 1px solid #eef0f6;
    background: #f7f8fc;
}

tbody td {
    padding: 13px 22px;
    border-bottom: 1px solid #eef0f6;
    color: #4b5563;
    font-size: 13.5px;
    vertical-align: middle;
}

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

tbody tr:hover td {
    background: #f8f9fd;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green {
    background: #ecfdf5;
    color: #059669;
}

.badge-blue {
    background: #eff6ff;
    color: #2563eb;
}

.badge-amber {
    background: #fffbeb;
    color: #b45309;
}

.badge-red {
    background: #fef2f2;
    color: #dc2626;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

/* ALERTS */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin: 16px 22px 0;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* LOGIN */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1623;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

    .login-page::before {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 65%);
        top: -150px;
        right: -100px;
        pointer-events: none;
    }

.login-card {
    background: #ffffff;
    border: 1px solid #e4e7ef;
    border-radius: 18px;
    padding: 36px 32px;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
    position: relative;
    z-index: 1;
}

.login-page-split {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #0b1220;
}

.login-page-split::before {
    display: none;
}

.login-brand-panel {
    flex: 1 1 58%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 56px 64px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(59, 130, 246, 0.32) 0%, transparent 42%),
        radial-gradient(circle at 88% 86%, rgba(14, 165, 233, 0.16) 0%, transparent 46%),
        linear-gradient(165deg, #0b1220 0%, #111827 52%, #0f172a 100%);
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    inset: auto -80px -120px auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 68%);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.login-brand-mark-wrap {
    width: 168px;
    height: 168px;
    margin: 0 0 28px;
    border: 0;
    border-radius: 50%;
    overflow: hidden;
    clip-path: circle(50%);
    background: transparent;
}

.login-brand-mark {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 50%;
    background: transparent !important;
    padding: 0;
    box-shadow: none;
    outline: none;
    color-scheme: light;
}

.login-brand-mark-wrap img.login-brand-mark {
    object-fit: cover;
}

.login-brand-mark-wrap.has-photo {
    mix-blend-mode: lighten;
}

.login-brand-kicker {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #93c5fd;
}

.login-brand-title {
    margin: 0;
    font-size: clamp(2.4rem, 4.8vw, 4.6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.038em;
    color: #f8fafc;
    max-width: 11.5ch;
    text-wrap: balance;
}

.login-form-panel {
    flex: 0 0 min(520px, 46%);
    min-width: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    background: #f7f8fc;
}

.login-page-split .login-card {
    max-width: 440px;
    width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
}

.login-form-heading {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}

.login-form-sub {
    margin: 0 0 24px;
    font-size: 14.5px;
    color: #6b7280;
    line-height: 1.5;
}

.login-form-link {
    text-align: center;
    margin: 20px 0 0;
    font-size: 14px;
}

.login-form-link a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}

.login-form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e4e7ef;
}

.login-form-footer p {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.login-form-footer a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

@media screen and (max-width: 900px) {
    .login-page-split {
        flex-direction: column;
        overflow: auto;
    }

    .login-brand-panel {
        flex: 0 0 auto;
        min-height: 0;
        padding: 32px 24px 28px;
        align-items: flex-end;
    }

    .login-brand-mark-wrap {
        width: 112px;
        height: 112px;
        margin-bottom: 16px;
    }

    .login-brand-title {
        font-size: clamp(1.7rem, 7.2vw, 2.5rem);
        max-width: none;
    }

    .login-form-panel {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
        align-items: flex-start;
        padding: 28px 20px 40px;
    }
}

.login-logo {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.login-logo .brand-name {
    line-height: 1.18;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

    .login-field label {
        font-size: 11px;
        font-weight: 600;
        color: #4b5563;
        text-transform: uppercase;
        letter-spacing: .07em;
    }

    .login-field input {
        width: 100%;
        height: 50px;
        border: 1.5px solid #e4e7ef;
        border-radius: 12px;
        padding: 0 16px;
        font-size: 15px;
        color: #111827;
        background: #f7f8fc;
        font-family: inherit;
        transition: border-color .15s, box-shadow .15s;
    }

        .login-field input:focus {
            outline: none;
            border-color: #2563eb;
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(37,99,235,.1);
        }

.login-btn {
    width: 100%;
    height: 54px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(37,99,235,.4);
}

    .login-btn:hover {
        opacity: .92;
        box-shadow: 0 6px 20px rgba(37,99,235,.5);
    }

.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: #9ca3af;
    margin: 18px 0;
}

    .login-divider::before,
    .login-divider::after {
        content: '';
        flex: 1;
        border-top: 1px solid #e4e7ef;
    }

.login-footer {
    text-align: center;
    font-size: 12.5px;
    color: #9ca3af;
}

    .login-footer a {
        color: #2563eb;
        text-decoration: none;
        font-weight: 500;
    }

/* UTILITIES */
.text-muted {
    color: #9ca3af;
}

.text-green {
    color: #16a34a;
    font-weight: 600;
}

.text-red {
    color: #dc2626;
}

.file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.file-actions form {
    margin: 0;
}

.file-date-link {
    color: #1e40af;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.file-date-link:hover {
    color: #1d4ed8;
}

.collector-topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e4e7ef;
}

.collector-topnav .btn,
.collector-topnav .btn-primary {
    text-decoration: none;
    color: #ffffff;
}

.collector-topnav .btn.is-active {
    background: #1d4ed8;
}

.collector-topnav .btn.is-locked {
    opacity: 0.65;
    cursor: not-allowed;
    background: #94a3b8;
    position: relative;
}

.collector-topnav .btn.is-locked::after {
    content: '🔒';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
}

.collector-topnav .btn.has-paid-glow {
    position: relative !important;
    border-color: #38bdf8 !important;
    animation: collector-btn-blue-glow 1.5s ease-in-out infinite !important;
}

@keyframes collector-btn-blue-glow {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.55), 0 0 14px rgba(14, 165, 233, 0.7);
        border-color: #38bdf8;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.9), 0 0 24px rgba(56, 189, 248, 1), inset 0 0 8px rgba(255, 255, 255, 0.35);
        border-color: #7dd3fc;
    }
}

.collector-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 999px;
    background: #ffffff;
    color: #0284c7;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    vertical-align: middle;
}

.collector-nav-badge[hidden] {
    display: none !important;
}

.collector-topnav-logout {
    margin-left: auto;
}

.collector-topnav .btn-danger,
.collector-topnav-logout.btn-danger {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
}

.collector-topnav .btn-danger:hover,
.collector-topnav-logout.btn-danger:hover {
    background: #b91c1c;
    border-color: #991b1b;
}

.customer-topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 8px;
    min-width: 0;
}

.customer-topnav-title {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    max-width: 220px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.customer-topnav-user {
    margin-left: auto;
    margin-right: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    max-width: min(280px, 46vw);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-topnav .collector-topnav-logout {
    margin-left: 0;
}

.customer-page-header h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.customer-view-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.customer-edit-wait {
    background: #fff7ed;
    color: #9a3412;
}

.customer-edit-allowed {
    background: #ecfdf5;
    color: #047857;
}

.edit-change-log {
    margin: 0 16px 18px;
    padding: 14px 16px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.edit-change-log-head {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.edit-change-block + .edit-change-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.edit-change-meta {
    margin: 0 0 8px;
    font-size: 12px;
    color: #64748b;
}

.edit-change-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.edit-change-table th,
.edit-change-table td {
    border: 1px solid #e2e8f0;
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
}

.edit-change-table th {
    background: #eef2ff;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4338ca;
}

.edit-change-table td:nth-child(2) {
    color: #64748b;
}

.edit-change-table td:nth-child(3) {
    font-weight: 700;
    color: #0f172a;
}

.customer-due-badge {
    background: #ffedd5;
    color: #9a3412;
}

.customer-due-ledger-card {
    margin-top: 16px;
}

.customer-page-sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: #6b7280;
}

.customer-empty-card {
    margin-top: 8px;
}

.customer-empty-body {
    padding: 36px 28px;
    text-align: center;
}

.customer-empty-body h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #111827;
}

.customer-empty-body p {
    margin: 0 auto;
    max-width: 420px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.55;
}

.customer-login-kicker {
    margin: -8px 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2563eb;
    text-align: center;
}

.customer-login-lead {
    margin: 0 0 22px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    line-height: 1.45;
}

.customer-login-help {
    text-align: center;
    margin: 20px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

.customer-login-staff {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border, #e4e7ef);
}

.customer-login-staff a {
    color: var(--accent, #2563eb);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

/* CLIENT ATTENDANCE */
.client-attendance-sheet {
    margin: 18px 22px 24px;
    border: 2px solid #1e40af;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    padding-bottom: 12px;
}

.app-sheet-card .client-attendance-sheet {
    margin: 0;
    border-radius: 0 0 12px 12px;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.client-attendance-title {
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    margin-top: 14px;
    color: #1e3a8a;
}

.client-attendance-subtitle {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #1d4ed8;
}

.client-attendance-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 10px 14px;
    margin: 0 12px 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(30, 64, 175, 0.18);
    border-radius: 10px;
}

.client-attendance-meta label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1e40af;
}

.client-attendance-meta input {
    border: none;
    border-bottom: 1px solid #3b82f6;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    padding: 2px 0;
    background: transparent;
    color: #0f172a;
    min-width: 8rem;
}

.client-attendance-meta input:focus {
    outline: none;
    border-bottom-color: #2563eb;
}

.client-attendance-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    padding: 0 12px 12px;
}

.client-attendance-table,
.client-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.client-attendance-table th,
.client-attendance-table td,
.client-summary-table th,
.client-summary-table td {
    border: 1px solid #374151;
    font-size: 11.5px;
    padding: 4px;
}

.client-attendance-table th {
    background: #f3f4f6;
}

.client-attendance-table .ca-row-num {
    width: 2.4rem;
    text-align: center;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.client-attendance-table td input,
.client-summary-table td input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 11.5px;
    padding: 2px;
    font-family: inherit;
}

.client-attendance-table td.ca-name-cell {
    min-width: 180px;
    width: 28%;
}

.client-attendance-table .ca-name-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.client-attendance-table .ca-name-wrap .ca-row-name {
    flex: 1 1 auto;
    min-width: 120px;
    width: 100%;
}

.client-attendance-table .ca-renew-tag {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.client-attendance-table .ca-new-tag {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.client-attendance-table .ca-due-tag {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.client-attendance-table .ca-paid-tag {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.client-attendance-table .ca-paid-tag[hidden] {
    display: none !important;
}

.client-attendance-table .ca-sent-tag--wait {
    color: #9a3412;
    background: #fff7ed;
    border-color: #fdba74;
}

.client-attendance-table .ca-send-wait {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    padding: 8px 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #9a3412;
}

.client-attendance-table .ca-send-wait .btn-sm {
    margin-left: auto;
}

.customer-send-money-card {
    margin: 0 0 16px;
    padding: 16px 18px 18px;
}

.customer-send-money-head {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.customer-send-money-note {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}

.customer-send-money-form {
    margin: 0;
}

.customer-send-money-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 6px;
}

.customer-send-money-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.customer-send-money-peso {
    display: flex;
    align-items: center;
    font-weight: 800;
    color: #0f172a;
    padding: 0 2px 0 4px;
}

.customer-send-money-row .ledger-input {
    flex: 1 1 auto;
    min-width: 0;
}

.customer-send-money-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.customer-send-pending-card {
    margin: 0 0 16px;
    border-color: #fdba74;
}

.customer-send-pending-note {
    margin: 0;
    padding: 12px 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #9a3412;
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
}

.customer-send-pending-list {
    display: flex;
    flex-direction: column;
}

.customer-send-pending-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8.5rem 10.5rem;
    gap: 16px;
    align-items: center;
    padding: 8px 18px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .07em;
    background: #f7f8fc;
    border-bottom: 1px solid #eef0f6;
}

.customer-send-pending-cols span:nth-child(2),
.customer-send-pending-cols span:nth-child(3) {
    text-align: right;
}

.customer-send-pending-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8.5rem 10.5rem;
    gap: 16px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #eef0f6;
}

.customer-send-pending-row:last-child {
    border-bottom: none;
}

.customer-send-pending-name {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.customer-send-pending-amt {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.customer-send-pending-form {
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

.customer-send-pending-form .btn-sm {
    white-space: nowrap;
}

@media screen and (max-width: 720px) {
    .customer-send-pending-cols {
        display: none;
    }

    .customer-send-pending-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name amt"
            "form form";
        gap: 8px 12px;
        padding: 12px 14px;
    }

    .customer-send-pending-name {
        grid-area: name;
    }

    .customer-send-pending-amt {
        grid-area: amt;
    }

    .customer-send-pending-form {
        grid-area: form;
        justify-content: stretch;
    }

    .customer-send-pending-form .btn-sm {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }
}


.client-attendance-table .ca-absent-tag {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.client-attendance-table .ca-absent-tag[hidden] {
    display: none !important;
}


.client-attendance-table .ca-rb-tag {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.4;
    white-space: nowrap;
}

.client-attendance-table td input:focus,
.client-summary-table td input:focus {
    outline: 1px solid rgba(37, 99, 235, .35);
}

.client-summary-table th {
    text-align: left;
    font-weight: 700;
    background: #f9fafb;
}

.client-attendance-view-only .client-summary-table td input,
.client-attendance-view-only .client-attendance-table td input {
    background: var(--surface-muted, #f3f4f6) !important;
    color: #111827 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #111827;
}

.client-attendance-view-only input.ca-expense-editable:not([readonly]) {
    background: #fff !important;
    cursor: text;
}

.customer-access-card {
    background: #0f1623;
    color: #fff;
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0 24px;
    box-shadow: 0 10px 28px rgba(15, 22, 35, 0.22);
    border: 1px solid rgba(255,255,255,0.08);
}
.access-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}
.access-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}
.btn-print-card {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.btn-print-card:hover {
    background: rgba(255,255,255,0.3);
}
.access-card-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
}
.access-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 16px;
    align-items: center;
}
.access-label {
    font-weight: 600;
    font-size: 14px;
    opacity: 0.9;
}
.access-value {
    font-size: 15px;
    font-weight: 500;
}
.access-code-display {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    font-family: "Courier New", Consolas, monospace;
    background: rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.4);
}
.access-url {
    font-size: 13px;
    word-break: break-all;
}
.access-url a {
    color: #fff;
    text-decoration: underline;
}
.access-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.qr-code {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
}
.qr-label {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
}
@media screen and (max-width: 768px) {
    .access-card-body {
        grid-template-columns: 1fr;
    }
    .access-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .collector-topnav:not(.customer-topnav) {
        display: none !important;
    }
}

.ca-collector-folders {
    padding: 12px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ca-collector-folder {
    border: 1px solid #dbe3f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ca-collector-folder-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    color: #0f172a;
    list-style: none;
    user-select: none;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid transparent;
}

.ca-collector-folder[open] > .ca-collector-folder-head {
    border-bottom-color: #e2e8f0;
}

.ca-collector-folder-head::-webkit-details-marker {
    display: none;
}

.ca-collector-folder-head::before {
    content: '▶';
    font-size: 10px;
    color: #3b82f6;
    transition: transform 0.15s ease;
}

.ca-collector-folder[open] > .ca-collector-folder-head::before {
    transform: rotate(90deg);
}

.ca-collector-folder-name {
    flex: 1;
    font-size: 14px;
}

.dc-file-source,
.ca-file-source {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.dc-file-source-attendance,
.ca-file-source-attendance {
    background: #e8f0fe;
    color: #1e3a8a;
}

.dc-file-source-due,
.ca-file-source-due {
    background: #fef3c7;
    color: #92400e;
}

.dc-file-source-other {
    background: #f3f4f6;
    color: #4b5563;
}

.dc-file-source-pending {
    background: #fee2e2;
    color: #991b1b;
}

.dc-file-source-received {
    background: #d1fae5;
    color: #065f46;
}

.dc-pending-row td {
    background: #fffbeb;
}

.ca-collector-folder-count {
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 2px 10px;
}

.ca-collector-folder-table-wrap {
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.ca-collector-folders--nested {
    padding: 10px 12px 14px;
    gap: 8px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.ca-folder-business {
    background: #f8fafc;
    border-color: #dbe3ef;
}

.ca-folder-business > .ca-collector-folder-head {
    background: #eef2f7;
}

.ca-folder-collector {
    background: #fff;
    border-color: #e5e7eb;
}

.ca-folder-collector > .ca-collector-folder-head {
    padding: 10px 12px;
    font-weight: 600;
    background: #fff;
}

.ca-folder-collector > .ca-collector-folder-head .ca-collector-folder-name {
    font-size: 13px;
}

.central-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin: 0 0 0 auto;
}

.central-filter-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1e40af;
}

.central-filter-form select,
.central-filter-form input[type="search"],
.central-filter-form input[type="text"],
.central-filter-form input[type="date"] {
    height: 34px;
    border: 1px solid #dbe3f0;
    border-radius: 8px;
    padding: 0 10px;
    min-width: 11rem;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: #0f172a;
    background: #fff;
}

.central-filter-form a.btn-sm {
    text-decoration: none;
}

.ca-collector-folder-table-wrap table {
    margin: 0;
}

.ca-folder-customer-list .ca-folder-customer-name {
    font-weight: 600;
    width: 100%;
}

.ca-folder-customer-list td.file-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.ba-secretary-folder-section-label {
    padding: 10px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #6b7280);
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.ca-collector-folder-table-wrap > .ba-secretary-folder-section-label:first-child {
    border-top: 0;
}

tr.ca-folder-row-active td {
    background: #eff6ff;
}

/* ATTENDANCE PAGE POLISH */
.attendance-page .attendance-form-card,
.attendance-page .attendance-table-card {
    border-radius: 14px;
}

.attendance-page .attendance-form-card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    overflow: visible;
}

.attendance-form-head {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #eef0f6;
    padding: 18px 22px;
    align-items: flex-start;
}

.attendance-form-head-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.attendance-form-head-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.attendance-form-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.attendance-form-sub {
    display: block;
    margin-top: 4px;
    max-width: 36rem;
}

.attendance-form-messages {
    padding: 16px 22px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attendance-form-messages .alert {
    margin: 0;
}

.attendance-form-flash {
    margin: 0;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.attendance-log-form-body {
    padding: 0;
}

.attendance-form-section {
    padding: 20px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.attendance-form-section:last-of-type {
    border-bottom: none;
}

.attendance-form-section--policy {
    background: #fafbfc;
}

.attendance-form-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin: 0 0 14px 0;
}

.attendance-form-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

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

.attendance-clock-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 0.75rem;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 12px;
    color: #475569;
}

.attendance-clock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: attendance-pulse 2s ease-in-out infinite;
}

@keyframes attendance-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.attendance-clock-label {
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 10px;
}

.attendance-clock-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.04em;
}

.attendance-clock-badge--section {
    margin-bottom: 6px;
}

.attendance-form-hint--clock {
    margin: 0 0 14px;
}

.btn-clock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 220px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn-clock:hover {
    transform: translateY(-1px);
}

.btn-clock:active {
    transform: translateY(0);
}

.btn-clock-in {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.btn-clock-in:hover {
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45);
}

.btn-clock-out {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    box-shadow: 0 4px 14px rgba(71, 85, 105, 0.35);
}

.btn-clock-out:hover {
    box-shadow: 0 6px 18px rgba(71, 85, 105, 0.45);
}

.btn-clock:disabled,
.btn-clock[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-clock:disabled:hover,
.btn-clock[disabled]:hover {
    transform: none;
    box-shadow: none;
}

.attendance-time-captured {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.attendance-mismatch-alert {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.attendance-form-hint {
    margin: 14px 0 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
    max-width: 42rem;
}

.attendance-form-hint--employee-first {
    margin-top: 8px;
}

.field-attendance-employee .employee-combobox {
    position: relative;
}

.field-attendance-employee .employee-search-input {
    width: 100%;
    height: 38px;
    border: 1.5px solid #e4e7ef;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13.5px;
    color: #111827;
    background: #f7f8fc;
    font-family: inherit;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.field-attendance-employee .employee-search-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.field-attendance-employee .employee-search-input::placeholder {
    color: #d1d5db;
}

.field-attendance-employee .employee-listbox {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1.5px solid #e4e7ef;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.field-attendance-employee .employee-listbox li {
    padding: 8px 12px;
    font-size: 13.5px;
    color: #111827;
    cursor: pointer;
}

.field-attendance-employee .employee-listbox li:hover,
.field-attendance-employee .employee-listbox li:focus {
    background: #f1f5f9;
}

.attendance-form-actions {
    padding: 18px 22px;
    background: #f8fafc;
    border-top: 1px solid #eef0f6;
}

.btn-attendance-save {
    min-width: 180px;
    padding-left: 20px;
    padding-right: 20px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-attendance-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* BORROWERS LEDGER */
.ledger-sheet {
    margin: 18px 22px 24px;
    border: 2px solid #1e3a8a;
    padding: 14px;
    background: #dbeafe;
}

.ledger-sheet--office,
.ledger-sheet--customer,
.ledger-sheet--paid,
.office-ledger-card .ledger-sheet {
    margin: 0;
    border-color: #1e40af;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 0 0 12px 12px;
    padding: 18px 16px 20px;
}

.office-ledger-card {
    overflow: hidden;
    padding: 0;
}

.office-ledger-card .ledger-sheet {
    border-radius: 12px;
}

.office-ledger-page-header {
    margin-bottom: 12px;
}

.office-ledger-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.office-ledger-save-status {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    min-height: 1em;
}

.ledger-sheet--office .ledger-title,
.ledger-sheet--customer .ledger-title,
.ledger-sheet--paid .ledger-title {
    color: #1e3a8a;
}

.ledger-sheet--office .ledger-subtitle,
.ledger-sheet--customer .ledger-subtitle,
.ledger-sheet--paid .ledger-subtitle {
    color: #1d4ed8;
    margin-bottom: 14px;
}

.ledger-office-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 64, 175, 0.2);
    border-radius: 10px;
}

.ledger-office-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.ledger-office-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ledger-office-field--full {
    grid-column: 1 / -1;
}

.ledger-office-field--spacer {
    display: block;
    min-height: 0;
    pointer-events: none;
}

.ledger-office-field--accent .ledger-input {
    font-size: 16px;
    font-weight: 700;
    color: #1d4ed8;
    border-bottom-color: #3b82f6;
}

.ledger-office-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
}

.ledger-office-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.ledger-office-inline .ledger-input {
    flex: 1 1 0;
    min-width: 0;
}

.ledger-office-inline .ledger-input--rate,
.ledger-office-inline .ledger-input--terms {
    flex: 0 1 7.5rem;
    max-width: 9rem;
}

.ledger-office-inline-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.ledger-office-meta select.ledger-input {
    border: none;
    border-bottom: 1px solid #3b82f6;
    background: transparent;
    border-radius: 0;
    height: auto;
    padding: 2px 0;
    font-size: 12.5px;
    color: #0f172a;
    font-family: inherit;
}

.ledger-office-meta select.ledger-input:focus {
    outline: none;
    border-bottom-color: #1d4ed8;
}

.ledger-sheet--office .ledger-input,
.ledger-sheet--customer .ledger-input,
.ledger-sheet--paid .ledger-input {
    border-bottom-color: #3b82f6;
    color: #0f172a;
    background: transparent;
    width: 100%;
    min-width: 0;
}

.ledger-sheet--office .ledger-table th,
.ledger-sheet--office .ledger-table td,
.ledger-sheet--customer .ledger-table th,
.ledger-sheet--customer .ledger-table td,
.ledger-sheet--paid .ledger-table th,
.ledger-sheet--paid .ledger-table td {
    border-color: #1e40af;
}

.ledger-sheet--office .ledger-table thead th,
.ledger-sheet--customer .ledger-table thead th,
.ledger-sheet--paid .ledger-table thead th {
    background: #93c5fd;
    color: #1e3a8a;
}

.ledger-sheet--office .ledger-cell-input,
.ledger-sheet--customer .ledger-cell-input,
.ledger-sheet--paid .ledger-cell-input {
    color: #0f172a;
    background: #fff;
}

.ledger-sheet--office .ledger-rb-computed,
.ledger-sheet--customer .ledger-rb-computed,
.ledger-sheet--paid .ledger-rb-computed {
    background: #eff6ff !important;
    color: #1e40af;
    font-weight: 600;
}

.ledger-sheet--office .form-actions,
.ledger-sheet--customer .form-actions,
.ledger-sheet--paid .form-actions {
    margin-top: 14px;
    padding: 0 2px;
}

.ledger-sheet--due,
.due-ledger-card .ledger-sheet {
    margin: 0;
    border-color: #9a3412;
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 0 0 12px 12px;
}

.due-ledger-card {
    overflow: hidden;
    padding: 0;
}

.due-ledger-card .ledger-sheet {
    border-radius: 12px;
}

.due-ledger-page-header {
    margin-bottom: 12px;
}

.ledger-sheet--due .ledger-title {
    color: #7c2d12;
}

.ledger-sheet--due .ledger-subtitle {
    color: #9a3412;
    margin-bottom: 14px;
}

.ledger-due-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(154, 52, 18, 0.22);
    border-radius: 10px;
}

.ledger-due-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.ledger-due-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ledger-due-field--full {
    grid-column: 1 / -1;
}

.ledger-due-field--accent .ledger-input {
    font-size: 16px;
    font-weight: 700;
    color: #9a3412;
    border-bottom-color: #ea580c;
}

.ledger-sheet--due .ledger-office-inline-label {
    color: #9a3412;
    opacity: 0.75;
}

.ledger-sheet--due .ledger-input {
    border-bottom-color: #c2410c;
    color: #1c1917;
    background: transparent;
    width: 100%;
    min-width: 0;
}

.ledger-sheet--due .ledger-table th,
.ledger-sheet--due .ledger-table td {
    border-color: #c2410c;
}

.ledger-sheet--due .ledger-table thead th {
    background: #fdba74;
    color: #7c2d12;
}

.ledger-sheet--due .ledger-cell-input {
    color: #1c1917;
    background: #fff;
}

.ledger-sheet--due .ledger-rb-computed {
    background: #fff7ed;
    color: #9a3412;
    font-weight: 600;
}

.ledger-sheet--due .ledger-cell-input.sunday-date,
.ledger-sheet--due .ledger-cell-input.ledger-date-sunday {
    color: #b91c1c;
    font-weight: 600;
    background: #fee2e2;
}

.ledger-cell-input.monday-date {
    color: #15803d !important;
    font-weight: 700;
    background-color: #dcfce7 !important;
}

.ledger-sheet--due .ledger-cell-input.monday-date {
    color: inherit !important;
    font-weight: normal !important;
    background-color: transparent !important;
}

.ol-due-tag {
    display: inline-block;
    margin-left: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

.ol-new-tag,
.ol-renew-tag {
    display: inline-block;
    margin-left: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

.ol-new-tag {
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.ol-renew-tag {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.ledger-cell-input.ledger-sign-due {
    color: #9a3412 !important;
    font-weight: 700;
    background: #fff7ed !important;
}

.ledger-cell-input.ledger-sign-present {
    color: #15803d !important;
    font-weight: 700;
    background: #f0fdf4 !important;
}

.ledger-cell-input.ledger-sign-absent {
    color: #b91c1c !important;
    font-weight: 700;
    background: #fef2f2 !important;
}

.ledger-cell-input.ledger-sign-advance {
    color: #1d4ed8 !important;
    font-weight: 700;
    background: #eff6ff !important;
}

.ledger-cell-input.ledger-sign-deficiency {
    color: #b45309 !important;
    font-weight: 700;
    background: #fffbeb !important;
}

.ledger-sheet--due-tagged .ledger-office-label .ol-due-tag {
    margin-left: 6px;
}

.ledger-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ledger-title {
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .02em;
}

.ledger-subtitle {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    margin: 2px 0 10px;
}

.ledger-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    margin-bottom: 10px;
}

.ledger-line {
    font-size: 12.5px;
}

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

.ledger-input {
    border: none;
    border-bottom: 1px solid #1e3a8a;
    background: transparent;
    font-size: 12.5px;
    padding: 0 2px;
    min-width: 120px;
    font-family: inherit;
    color: #0f172a;
}

.ledger-input:focus {
    outline: none;
    border-bottom-color: #1d4ed8;
}

.ledger-input.small {
    min-width: 110px;
}

.ledger-input.tiny {
    min-width: 70px;
}

.ledger-input.amount {
    max-width: 110px;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ledger-table th,
.ledger-table td {
    border: 1px solid #1e3a8a;
    padding: 6px 4px;
    font-size: 11.5px;
    text-align: center;
}

.ledger-table thead th {
    background: #bfdbfe;
    color: #111827;
    text-transform: none;
    letter-spacing: normal;
}

.ledger-table tbody td {
    height: 24px;
    padding: 0;
}

.ledger-table tfoot td {
    font-weight: 700;
    text-align: left;
    padding-left: 8px;
}

.ledger-cell-input {
    width: 100%;
    height: 24px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 11.5px;
    padding: 2px 4px;
    font-family: inherit;
    color: #0f172a;
}

.ledger-cell-input.ledger-date-sunday {
    color: #dc2626 !important;
    font-weight: 700;
}

.ledger-table.ledger-terms-short tr.ledger-row-extended {
    display: none;
}

.ledger-table tr.ledger-row-hidden {
    display: none;
}

.ledger-cell-input:focus {
    outline: 1px solid rgba(30, 58, 138, .35);
    outline-offset: -1px;
}

.ledger-rb-computed {
    background: #f1f5f9 !important;
    cursor: default;
}

@media print {
    @page {
        size: 8.5in 13in;
        margin: 0.28in 0.32in;
    }

    .sidebar,
    .page-header,
    .due-ledger-page-header,
    .office-ledger-page-header,
    .app-page-header,
    .card-head,
    .no-print {
        display: none !important;
    }

    /* Hide browse/list chrome when printing an open ledger sheet */
    body:has(.office-ledger-card) .app-card,
    body:has(.office-ledger-card) .customer-access-card,
    body:has(.office-ledger-card) .ca-collector-folders,
    body:has(.office-ledger-card) .form-actions,
    body:has(.office-ledger-card) .alert,
    body:has(.due-ledger-card) .app-card,
    body:has(.due-ledger-card) .customer-access-card,
    body:has(.due-ledger-card) .form-actions,
    body:has(.due-ledger-card) .alert {
        display: none !important;
    }

    html,
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .layout,
    .main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: 0 !important;
    }

    .card,
    .office-ledger-card,
    .due-ledger-card {
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .ledger-sheet--due,
    .due-ledger-card .ledger-sheet,
    .ledger-sheet--office,
    .ledger-sheet--customer,
    .ledger-sheet--paid,
    .office-ledger-card .ledger-sheet,
    .ledger-sheet {
        background: #fff !important;
        border: 1px solid #000 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 4px 6px 6px !important;
        page-break-inside: avoid;
        break-inside: avoid;
        page-break-after: avoid;
    }

    .office-ledger-card fieldset,
    .due-ledger-card fieldset,
    .ledger-sheet fieldset {
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    .ledger-title {
        font-size: 11px !important;
        line-height: 1.15 !important;
        margin: 0 !important;
    }

    .ledger-subtitle {
        font-size: 13px !important;
        line-height: 1.15 !important;
        margin: 1px 0 4px !important;
        color: #000 !important;
    }

    .ledger-office-meta,
    .ledger-due-meta {
        gap: 3px !important;
        margin: 0 0 4px !important;
        padding: 3px 5px !important;
        background: #fff !important;
        border: 1px solid #000 !important;
        border-radius: 0 !important;
    }

    .ledger-office-meta-row,
    .ledger-due-meta-row,
    .app-meta-row {
        gap: 2px 8px !important;
    }

    .ledger-office-field,
    .ledger-due-field {
        gap: 0 !important;
    }

    .ledger-office-label,
    .ledger-due-label {
        font-size: 8px !important;
        letter-spacing: 0.04em !important;
        line-height: 1.1 !important;
        color: #000 !important;
    }

    .ledger-office-field--spacer {
        display: none !important;
    }

    .ledger-input,
    .ledger-input.small,
    .ledger-input.tiny,
    .ledger-input.amount {
        border: none !important;
        border-bottom: 1px solid #333 !important;
        font-size: 9px !important;
        line-height: 1.15 !important;
        padding: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        color: #000 !important;
        background: transparent !important;
        outline: none !important;
    }

    .ledger-office-field--accent .ledger-input {
        font-size: 10px !important;
        color: #000 !important;
    }

    .ledger-office-inline {
        gap: 4px !important;
    }

    .ledger-office-inline-label {
        font-size: 8px !important;
    }

    .ledger-table-wrap {
        overflow: visible !important;
    }

    .ledger-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .ledger-table th,
    .ledger-table td {
        border-color: #000 !important;
        padding: 0 1px !important;
        font-size: 8px !important;
        line-height: 1.05 !important;
    }

    .ledger-table thead th {
        background: #e5e7eb !important;
        color: #000 !important;
        font-size: 8px !important;
        font-weight: 700 !important;
        padding: 1px 1px !important;
    }

    .ledger-table tbody td {
        height: 12px !important;
        padding: 0 !important;
    }

    .ledger-cell-input {
        height: 12px !important;
        font-size: 8px !important;
        line-height: 1.05 !important;
        padding: 0 1px !important;
        color: #000 !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
    }

    .ledger-rb-computed {
        background: #f3f4f6 !important;
    }

    .ledger-table tfoot td {
        font-size: 8px !important;
        padding: 1px 3px !important;
        line-height: 1.15 !important;
    }

    .ledger-sum-row td {
        padding-top: 2px !important;
        font-size: 8px !important;
    }

    /* Longer terms (visible extended rows / 3–4 months): denser so it still fits one long bond. */
    body.ledger-print-dense .ledger-table tbody td,
    .ledger-table:has(tr.ledger-row-extended:not(.ledger-row-hidden)) tbody td {
        height: 9px !important;
    }

    body.ledger-print-dense .ledger-cell-input,
    .ledger-table:has(tr.ledger-row-extended:not(.ledger-row-hidden)) .ledger-cell-input {
        height: 9px !important;
        font-size: 7px !important;
    }

    body.ledger-print-dense .ledger-table th,
    body.ledger-print-dense .ledger-table td,
    .ledger-table:has(tr.ledger-row-extended:not(.ledger-row-hidden)) th,
    .ledger-table:has(tr.ledger-row-extended:not(.ledger-row-hidden)) td {
        font-size: 7px !important;
    }

    body.ledger-print-dense .ledger-office-meta,
    body.ledger-print-dense .ledger-due-meta {
        padding: 2px 4px !important;
        margin-bottom: 2px !important;
    }

    body.ledger-print-dense .ledger-subtitle {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }
}

.attendance-page .table-wrap table tbody tr td:first-child {
    min-width: 180px;
}

/* RESPONSIVE */
@media (max-width: 980px) {
    .main {
        padding: 22px 18px;
        min-width: 0;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid.dash-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid,
    .form-grid.cols-2,
    .form-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .ledger-top-grid {
        grid-template-columns: 1fr;
    }

    .ledger-line.right {
        text-align: left;
    }

    .ledger-due-meta-row,
    .ledger-office-meta-row,
    .app-meta-row {
        grid-template-columns: 1fr;
    }

    .ledger-office-field--spacer {
        display: none;
    }

    .due-ledger-page-header,
    .office-ledger-page-header,
    .app-page-header,
    .page-header,
    .ops-browse-page .sca-hero {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        gap: 10px;
    }

    .ops-browse-page .sca-hero-meta {
        justify-content: flex-start;
        width: 100%;
    }

    .app-page-actions,
    .office-ledger-page-actions,
    .page-header-actions {
        margin-left: 0;
        width: 100%;
    }

    .client-attendance-meta {
        flex-direction: column;
    }

    .client-attendance-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .layout {
        width: 100%;
        min-width: 0;
    }

    .main {
        width: 100%;
        min-width: 0;
        padding: 14px 10px;
    }

    .page-header {
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }

    .page-header h1 {
        font-size: 18px;
        line-height: 1.25;
    }

    .stats-grid.dash-stats {
        grid-template-columns: 1fr;
    }

    .card {
        width: 100%;
        min-width: 0;
        margin-bottom: 14px;
        border-radius: 9px;
    }

    .card-head {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .collector-topnav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        width: 100%;
        padding: 10px;
        position: sticky;
        top: 0;
        z-index: 25;
        background: #0b1220;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    .collector-topnav .btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        justify-content: center;
        padding: 10px 8px;
        font-size: 13px;
        line-height: 1.2;
        white-space: normal;
        border-radius: 10px;
    }

    .collector-topnav .btn.is-locked {
        padding-right: 22px;
    }

    .customer-topnav {
        display: none !important;
    }

    .client-attendance-sheet {
        width: auto;
        min-width: 0;
        margin: 8px;
        border-width: 1px;
    }

    .client-attendance-title {
        padding: 0 8px;
        font-size: 12px;
    }

    .client-attendance-subtitle {
        font-size: 14px;
    }

    .client-attendance-meta {
        gap: 9px;
        padding: 0 8px 10px;
    }

    .client-attendance-meta label {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .client-attendance-meta input {
        width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    .client-attendance-grid {
        display: block;
        padding: 0 8px 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .collector-app .client-attendance-grid,
    .mobile-sheet-cards .client-attendance-grid {
        overflow: visible;
    }

    .collector-app form[data-collector-form] .client-attendance-table,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table {
        min-width: 0;
        width: 100%;
        border: 0;
    }

    .collector-app form[data-collector-form] .client-attendance-table thead,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table thead {
        display: none;
    }

    .collector-app form[data-collector-form] .client-attendance-table tbody,
    .collector-app form[data-collector-form] .client-attendance-table tr,
    .collector-app form[data-collector-form] .client-attendance-table td,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table tbody,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table tr,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td {
        display: block;
        width: 100%;
        border: 0;
    }

    .collector-app form[data-collector-form] .client-attendance-table tr,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table tr {
        position: relative;
        margin: 0 0 10px;
        padding: 12px;
        padding-right: 44px;
        background: #fff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .collector-app form[data-collector-form] .client-attendance-table tr.is-empty-row,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table tr.is-empty-row {
        display: none;
    }

    .collector-app form[data-collector-form] .client-attendance-table td,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td {
        padding: 0;
        font-size: 14px;
    }

    .collector-app form[data-collector-form] .client-attendance-table td:first-child:not(.ca-row-num),
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td:first-child:not(.ca-row-num) {
        display: none !important;
    }

    .collector-app form[data-collector-form] .client-attendance-table td.ca-row-num,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td.ca-row-num {
        display: block !important;
        position: absolute;
        top: 12px;
        right: 12px;
        width: auto;
        padding: 0 !important;
        border: 0;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.02em;
        color: #64748b;
        line-height: 1;
    }

    .collector-app form[data-collector-form] .client-attendance-table td.ca-row-num::before,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td.ca-row-num::before {
        content: none !important;
    }

    .collector-app form[data-collector-form] .client-attendance-table td.ca-name-cell,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td.ca-name-cell {
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
    }

    .collector-app form[data-collector-form] .client-attendance-table td.ca-name-cell input,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td.ca-name-cell input {
        font-size: 16px;
        font-weight: 700;
        color: #0f172a;
    }

    .collector-app form[data-collector-form] .client-attendance-table td[data-label]:not(.ca-name-cell):not(.ca-row-num),
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td[data-label]:not(.ca-name-cell):not(.ca-row-num) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 0 0;
    }

    .collector-app form[data-collector-form] .client-attendance-table td[data-label]:not(.ca-name-cell):not(.ca-row-num)::before,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td[data-label]:not(.ca-name-cell):not(.ca-row-num)::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
    }

    .collector-app form[data-collector-form] .client-attendance-table td[data-label]:not(.ca-name-cell):not(.ca-row-num) input,
    .mobile-sheet-cards form.client-attendance-sheet .client-attendance-table td[data-label]:not(.ca-name-cell):not(.ca-row-num) input {
        flex: 1 1 auto;
        min-width: 0 !important;
        min-height: 40px;
        font-size: 16px;
        text-align: right;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #f8fafc;
        padding: 6px 10px;
    }

    .collector-app .client-attendance-meta,
    .mobile-sheet-cards .client-attendance-meta {
        margin: 0 8px 12px;
    }

    .collector-app .client-attendance-meta label,
    .mobile-sheet-cards .client-attendance-meta label {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .collector-app .file-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .collector-app .file-actions .btn-sm,
    .collector-app .file-actions button {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .collector-app .app-page-header,
    .collector-app .sca-hero {
        display: none;
    }

    .collector-app .main {
        padding-top: 10px;
    }

    .client-attendance-table {
        min-width: 650px;
    }

    .client-attendance-table th,
    .client-attendance-table td,
    .client-summary-table th,
    .client-summary-table td {
        font-size: 10.5px;
        padding: 3px;
    }

    .client-summary-table {
        min-width: 280px;
        margin-top: 12px;
    }

    .form-actions {
        flex-wrap: wrap;
        padding-left: 8px;
        padding-right: 8px;
    }

    .form-actions .btn,
    .form-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .table-wrap,
    .ca-collector-folder-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ca-collector-folders {
        padding: 8px;
    }

    .ledger-sheet {
        width: auto;
        min-width: 0;
        margin: 8px;
        padding: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ledger-title {
        font-size: 12px;
    }

    .ledger-subtitle {
        font-size: 14px;
    }

    .ledger-top-grid {
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .ledger-line,
    .ledger-line.right {
        display: block;
        text-align: left;
        line-height: 1.8;
    }

    .ledger-input,
    .ledger-input.small,
    .ledger-input.tiny,
    .ledger-input.amount {
        max-width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    .ledger-table {
        min-width: 680px;
    }

    .office-ledger-card .ledger-table,
    .due-ledger-card .ledger-table,
    body.customer-portal .ledger-table {
        min-width: 0 !important;
    }

    .ledger-table th,
    .ledger-table td,
    .ledger-cell-input {
        font-size: 10px;
    }
}

/* Phone: keep left and right ledger columns on screen together */
@media screen and (max-width: 900px) {
    .office-ledger-card,
    .due-ledger-card,
    body.customer-portal .office-ledger-card,
    body.customer-portal .customer-due-ledger-card {
        overflow: visible;
    }

    .office-ledger-card .ledger-sheet,
    .due-ledger-card .ledger-sheet,
    body.customer-portal .ledger-sheet {
        overflow: visible;
        width: 100%;
        min-width: 0;
    }

    .office-ledger-card .ledger-table-wrap,
    .due-ledger-card .ledger-table-wrap,
    body.customer-portal .ledger-table-wrap {
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .office-ledger-card .ledger-table,
    .due-ledger-card .ledger-table,
    body.customer-portal .ledger-table {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100%;
        border: 0;
        display: block;
        table-layout: auto;
    }

    .office-ledger-card .ledger-table thead,
    .due-ledger-card .ledger-table thead,
    body.customer-portal .ledger-table thead {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 0 0 8px;
    }

    .office-ledger-card .ledger-table thead th,
    .due-ledger-card .ledger-table thead th,
    body.customer-portal .ledger-table thead th {
        display: none;
        border: 0;
        background: transparent;
        padding: 0;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
        text-align: left;
    }

    .office-ledger-card .ledger-table thead th:nth-child(1),
    .due-ledger-card .ledger-table thead th:nth-child(1),
    body.customer-portal .ledger-table thead th:nth-child(1),
    .office-ledger-card .ledger-table thead th:nth-child(5),
    .due-ledger-card .ledger-table thead th:nth-child(5),
    body.customer-portal .ledger-table thead th:nth-child(5) {
        display: block;
    }

    .office-ledger-card .ledger-table thead th:nth-child(1)::after,
    .due-ledger-card .ledger-table thead th:nth-child(1)::after,
    body.customer-portal .ledger-table thead th:nth-child(1)::after {
        content: "Left";
    }

    .office-ledger-card .ledger-table thead th:nth-child(5)::after,
    .due-ledger-card .ledger-table thead th:nth-child(5)::after,
    body.customer-portal .ledger-table thead th:nth-child(5)::after {
        content: "Right";
    }

    .office-ledger-card .ledger-table thead th:nth-child(1),
    .due-ledger-card .ledger-table thead th:nth-child(1),
    body.customer-portal .ledger-table thead th:nth-child(1),
    .office-ledger-card .ledger-table thead th:nth-child(5),
    .due-ledger-card .ledger-table thead th:nth-child(5),
    body.customer-portal .ledger-table thead th:nth-child(5) {
        font-size: 0;
    }

    .office-ledger-card .ledger-table thead th:nth-child(1)::after,
    .due-ledger-card .ledger-table thead th:nth-child(1)::after,
    body.customer-portal .ledger-table thead th:nth-child(1)::after,
    .office-ledger-card .ledger-table thead th:nth-child(5)::after,
    .due-ledger-card .ledger-table thead th:nth-child(5)::after,
    body.customer-portal .ledger-table thead th:nth-child(5)::after {
        font-size: 11px;
    }

    .office-ledger-card .ledger-table tbody,
    .due-ledger-card .ledger-table tbody,
    body.customer-portal .ledger-table tbody {
        display: block;
        width: 100%;
    }

    .office-ledger-card .ledger-table tbody tr.ledger-data-row,
    .due-ledger-card .ledger-table tbody tr.ledger-data-row,
    body.customer-portal .ledger-table tbody tr.ledger-data-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 8px;
        width: 100%;
        margin: 0 0 10px;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .office-ledger-card .ledger-table tbody tr.ledger-data-row.is-empty-row,
    .due-ledger-card .ledger-table tbody tr.ledger-data-row.is-empty-row,
    body.customer-portal .ledger-table tbody tr.ledger-data-row.is-empty-row,
    .office-ledger-card .ledger-table tbody tr.ledger-data-row.ledger-row-hidden,
    .due-ledger-card .ledger-table tbody tr.ledger-data-row.ledger-row-hidden,
    body.customer-portal .ledger-table tbody tr.ledger-data-row.ledger-row-hidden,
    .office-ledger-card .ledger-table.ledger-terms-short tbody tr.ledger-data-row.ledger-row-extended,
    .due-ledger-card .ledger-table.ledger-terms-short tbody tr.ledger-data-row.ledger-row-extended,
    body.customer-portal .ledger-table.ledger-terms-short tbody tr.ledger-data-row.ledger-row-extended {
        display: none;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cell[data-side="left"],
    .due-ledger-card .ledger-table tbody td.ledger-pay-cell[data-side="left"],
    body.customer-portal .ledger-table tbody td.ledger-pay-cell[data-side="left"] {
        grid-column: 1;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cell[data-side="right"],
    .due-ledger-card .ledger-table tbody td.ledger-pay-cell[data-side="right"],
    body.customer-portal .ledger-table tbody td.ledger-pay-cell[data-side="right"] {
        grid-column: 2;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-date,
    .due-ledger-card .ledger-table tbody td.ledger-pay-date,
    body.customer-portal .ledger-table tbody td.ledger-pay-date {
        grid-row: 1;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cr,
    .due-ledger-card .ledger-table tbody td.ledger-pay-cr,
    body.customer-portal .ledger-table tbody td.ledger-pay-cr {
        grid-row: 2;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-rb,
    .due-ledger-card .ledger-table tbody td.ledger-pay-rb,
    body.customer-portal .ledger-table tbody td.ledger-pay-rb {
        grid-row: 3;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-sign,
    .due-ledger-card .ledger-table tbody td.ledger-pay-sign,
    body.customer-portal .ledger-table tbody td.ledger-pay-sign {
        grid-row: 4;
    }

    .office-ledger-card .ledger-table tbody tr.is-empty-right td[data-side="right"],
    .due-ledger-card .ledger-table tbody tr.is-empty-right td[data-side="right"],
    body.customer-portal .ledger-table tbody tr.is-empty-right td[data-side="right"],
    .office-ledger-card .ledger-table tbody tr.is-empty-left td[data-side="left"],
    .due-ledger-card .ledger-table tbody tr.is-empty-left td[data-side="left"],
    body.customer-portal .ledger-table tbody tr.is-empty-left td[data-side="left"] {
        display: none;
    }

    .office-ledger-card .ledger-table tbody tr.is-empty-right,
    .due-ledger-card .ledger-table tbody tr.is-empty-right,
    body.customer-portal .ledger-table tbody tr.is-empty-right,
    .office-ledger-card .ledger-table tbody tr.is-empty-left,
    .due-ledger-card .ledger-table tbody tr.is-empty-left,
    body.customer-portal .ledger-table tbody tr.is-empty-left {
        grid-template-columns: 1fr;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cell,
    .due-ledger-card .ledger-table tbody td.ledger-pay-cell,
    body.customer-portal .ledger-table tbody td.ledger-pay-cell {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        width: auto;
        min-width: 0;
        box-sizing: border-box;
        padding: 6px 8px;
        font-size: 13px;
        background: #fff;
        border-left: 1px solid #dbe3ef;
        border-right: 1px solid #dbe3ef;
        border-top: 0;
        border-bottom: 0;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cr,
    .due-ledger-card .ledger-table tbody td.ledger-pay-cr,
    body.customer-portal .ledger-table tbody td.ledger-pay-cr,
    .office-ledger-card .ledger-table tbody td.ledger-pay-rb,
    .due-ledger-card .ledger-table tbody td.ledger-pay-rb,
    body.customer-portal .ledger-table tbody td.ledger-pay-rb,
    .office-ledger-card .ledger-table tbody td.ledger-pay-sign,
    .due-ledger-card .ledger-table tbody td.ledger-pay-sign,
    body.customer-portal .ledger-table tbody td.ledger-pay-sign {
        border-top: 1px solid #e2e8f0;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-date,
    .due-ledger-card .ledger-table tbody td.ledger-pay-date,
    body.customer-portal .ledger-table tbody td.ledger-pay-date {
        padding-top: 8px;
        border-top: 1px solid #dbe3ef;
        border-radius: 10px 10px 0 0;
        font-weight: 700;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-sign,
    .due-ledger-card .ledger-table tbody td.ledger-pay-sign,
    body.customer-portal .ledger-table tbody td.ledger-pay-sign {
        padding-bottom: 8px;
        border-bottom: 1px solid #dbe3ef;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cell::before,
    .due-ledger-card .ledger-table tbody td.ledger-pay-cell::before,
    body.customer-portal .ledger-table tbody td.ledger-pay-cell::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-date::before,
    .due-ledger-card .ledger-table tbody td.ledger-pay-date::before,
    body.customer-portal .ledger-table tbody td.ledger-pay-date::before {
        content: none;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cell input,
    .due-ledger-card .ledger-table tbody td.ledger-pay-cell input,
    body.customer-portal .ledger-table tbody td.ledger-pay-cell input {
        flex: 1 1 auto;
        min-width: 0 !important;
        width: auto;
        min-height: 28px;
        font-size: 13px;
        text-align: right;
        border: 0;
        background: transparent !important;
        padding: 0;
        color: #0f172a;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-date input,
    .due-ledger-card .ledger-table tbody td.ledger-pay-date input,
    body.customer-portal .ledger-table tbody td.ledger-pay-date input {
        text-align: left;
        font-size: 13px;
        font-weight: 800;
    }

    .office-ledger-card .ledger-table tbody td.ledger-pay-cell.is-latest-attendance,
    .due-ledger-card .ledger-table tbody td.ledger-pay-cell.is-latest-attendance,
    body.customer-portal .ledger-table tbody td.ledger-pay-cell.is-latest-attendance {
        background: #eff6ff;
        border-left-color: #2563eb;
        border-left-width: 3px;
    }

    .office-ledger-card .ledger-table tfoot,
    .due-ledger-card .ledger-table tfoot,
    body.customer-portal .ledger-table tfoot {
        display: block;
        width: 100%;
        margin-top: 4px;
    }

    .office-ledger-card .ledger-table tfoot tr.ledger-total-row,
    .due-ledger-card .ledger-table tfoot tr.ledger-total-row,
    body.customer-portal .ledger-table tfoot tr.ledger-total-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        border: 0;
        background: transparent;
    }

    .office-ledger-card .ledger-table tfoot tr.ledger-total-row td,
    .due-ledger-card .ledger-table tfoot tr.ledger-total-row td,
    body.customer-portal .ledger-table tfoot tr.ledger-total-row td {
        display: block;
        border: 1px solid #dbe3ef;
        border-radius: 8px;
        padding: 8px;
        background: #fff;
        font-size: 12px;
        text-align: left;
    }

    .office-ledger-card .ledger-table tfoot tr.ledger-sum-row,
    .due-ledger-card .ledger-table tfoot tr.ledger-sum-row,
    body.customer-portal .ledger-table tfoot tr.ledger-sum-row {
        display: block;
        margin-top: 8px;
    }

    .office-ledger-card .ledger-table tfoot tr.ledger-sum-row td,
    .due-ledger-card .ledger-table tfoot tr.ledger-sum-row td,
    body.customer-portal .ledger-table tfoot tr.ledger-sum-row td {
        display: block;
        border: 0;
        text-align: left !important;
        padding: 4px 2px 0 !important;
        font-size: 12px !important;
    }

    /* Customer phone: list left dates, then right dates, so Date Renew is last */
    body.customer-portal .customer-ledger-chrono {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 0 0 12px;
        padding: 0;
        list-style: none;
    }

    body.customer-portal .customer-chrono-hint {
        display: block;
        margin: 0 0 10px;
        font-size: 12px;
        line-height: 1.4;
        color: #64748b;
    }

    body.customer-portal .customer-scroll-hint {
        display: none !important;
    }

    body.customer-portal .office-ledger-card .ledger-table thead,
    body.customer-portal .due-ledger-card .ledger-table thead,
    body.customer-portal .office-ledger-card .ledger-table tbody,
    body.customer-portal .due-ledger-card .ledger-table tbody {
        display: none !important;
    }

    body.customer-portal .customer-ledger-chrono-card {
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 0;
        background: #fff;
        border: 1px solid #dbe3ef;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    body.customer-portal .customer-ledger-chrono-date {
        padding: 8px 10px;
        font-size: 15px;
        font-weight: 800;
        color: #0f172a;
        background: #f8fafc;
        border-bottom: 1px solid #dbe3ef;
    }

    body.customer-portal .customer-ledger-chrono-date.sunday-date {
        color: #b45309;
    }

    body.customer-portal .customer-ledger-chrono-date.monday-date {
        color: #15803d !important;
        font-weight: 800;
        background: #dcfce7 !important;
    }

    body.customer-portal .customer-ledger-chrono-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 7px 10px;
        font-size: 13px;
        border-top: 1px solid #eef2f7;
    }

    body.customer-portal .customer-ledger-chrono-row span:first-child {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
    }

    body.customer-portal .customer-ledger-chrono-card.is-latest-attendance {
        border-color: #93c5fd;
        box-shadow: 0 0 0 2px #bfdbfe;
    }

    body.customer-portal .customer-ledger-chrono-card.is-latest-attendance .customer-ledger-chrono-date {
        background: #eff6ff;
    }
}

/* Monitoring report (monthly grid) */
.mr-card {
    border: 1px solid #d0d7e4;
    overflow: hidden;
}

.monitoring-report-sheet {
    padding: 22px 20px 26px;
    background: #fff;
}

.mr-sheet-header {
    text-align: center;
    margin-bottom: 16px;
}

.monitoring-report-title {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.35;
}

.monitoring-report-subtitle {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.16em;
    margin: 6px 0 0;
}

.mr-header-rule {
    width: 96px;
    height: 2px;
    margin: 12px auto 0;
    background: linear-gradient(90deg, transparent, #1e3a5f 20%, #1e3a5f 80%, transparent);
}

.mr-month-label {
    text-align: center;
    color: #64748b;
    font-size: 12.5px;
    margin: 10px 0 0;
    font-weight: 500;
}

.mr-readonly-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.monitoring-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.mr-toolbar-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin: 0;
}

.mr-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mr-toolbar-form label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.mr-toolbar-control {
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
}

select.mr-toolbar-control {
    min-width: 11rem;
    max-width: 16rem;
}

.mr-toolbar-control:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.mr-daily-savings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.mr-daily-savings label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
}

.mr-daily-savings input {
    width: 140px;
    max-width: 100%;
}

.mr-daily-savings-hint {
    font-size: 12px;
    color: #64748b;
}

.monitoring-report-wrap {
    overflow-x: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.monitoring-report-wrap.is-drag-scrolling {
    cursor: grabbing;
    user-select: none;
}

.monitoring-report-wrap.is-drag-scrolling .monitoring-report-input {
    pointer-events: none;
}

.monitoring-report-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    table-layout: fixed;
}

.monitoring-report-table th,
.monitoring-report-table td {
    border: 1px solid #dbe3ef;
    padding: 0;
    font-size: 11px;
    text-align: center;
    vertical-align: middle;
}

.monitoring-report-table thead th {
    background: linear-gradient(180deg, #1e3a5f 0%, #16304f 100%);
    color: #f8fafc;
    font-weight: 700;
    padding: 8px 4px;
    white-space: normal;
    line-height: 1.25;
    font-size: 10px;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 2;
}

.monitoring-report-table tbody td.day-num {
    background: #f1f5f9;
    font-weight: 700;
    width: 28px;
    padding: 4px 2px;
    color: #334155;
}

.monitoring-report-table tbody td.date-cell {
    background: #f8fafc;
    font-size: 10px;
    color: #475569;
    padding: 2px;
    font-weight: 600;
}

.monitoring-report-table tbody tr:nth-child(even) td:not(.day-num):not(.date-cell) {
    background: #fafbfc;
}

.monitoring-report-table tbody tr:hover td {
    background: #eff6ff;
}

.monitoring-report-table tbody tr.inactive-day td {
    background: #f1f5f9 !important;
    opacity: 0.5;
}

.monitoring-report-table tbody tr.inactive-day input {
    pointer-events: none;
}

.monitoring-report-input {
    width: 100%;
    min-width: 0;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 11px;
    padding: 2px 4px;
    color: #0f172a;
    font-weight: 600;
}

.monitoring-report-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background: #fff;
}

.monitoring-report-input.is-readonly {
    color: #64748b;
    font-weight: 500;
    cursor: default;
}

.monitoring-report-input.is-readonly:focus {
    outline: none;
    background: transparent;
}

.monitoring-report-table tfoot td {
    background: #e8eef6;
    font-weight: 800;
    padding: 8px 4px;
    color: #0f172a;
    border-color: #cbd5e1;
}

.monitoring-release-net {
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.monitoring-release-net-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
}

.monitoring-release-net-formula {
    font-size: 12.5px;
    color: #475569;
    margin-bottom: 10px;
    line-height: 1.55;
}

.monitoring-release-net-result {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.mr-form-actions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 28px;
}

.mr-save-lock-hint {
    margin: 0;
    margin-right: auto;
    font-size: 13px;
    line-height: 1.4;
    max-width: 28rem;
}

.mr-latest-card .card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.mr-latest-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.mr-section-label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.mr-expense-note {
    margin: -8px 0 18px;
    font-size: 12px;
    color: #64748b;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
}

.mr-readonly-note {
    margin: 12px 0 0;
    font-size: 12px;
    color: #64748b;
}

.mr-branch-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.mr-branch-status-bar {
    display: inline-block;
    width: 56px;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    vertical-align: middle;
}

.mr-branch-status-bar > span {
    display: block;
    height: 100%;
    background: #1d4ed8;
    border-radius: inherit;
}

@media print {
    .monitoring-report-toolbar,
    .mr-form-actions,
    .no-print {
        display: none !important;
    }

    .monitoring-report-wrap {
        overflow: visible;
        border: 1px solid #000;
        border-radius: 0;
        box-shadow: none;
    }

    .monitoring-report-table thead th {
        background: #e5e7eb !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .monitoring-report-input {
        border: none !important;
        font-weight: 400 !important;
    }

    .monitoring-release-net {
        background: #fff !important;
        border-color: #000 !important;
    }
}

.mr-th-abbr {
    display: none;
}

/* Landscape inspect view for monitoring reports */
.mr-rotate-hint {
    display: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
}

@media screen and (orientation: portrait) and (max-width: 900px) {
    .mr-page .mr-rotate-hint {
        display: block;
    }
}

.mr-landscape-exit {
    display: none;
}

body.mr-landscape-view .sidebar,
body.mr-landscape-view .mobile-app-bar,
body.mr-landscape-view .mobile-nav-backdrop,
body.mr-landscape-view .app-chat-fab,
body.mr-landscape-view .app-chat-panel,
body.mr-landscape-view .page-header,
body.mr-landscape-view .mr-latest-card,
body.mr-landscape-view .mr-rotate-hint,
body.mr-landscape-view .dash-report-card,
body.mr-landscape-view .card:not(.mr-card):not(.alert),
body.mr-landscape-view .alert,
body.mr-landscape-view .monitoring-release-net,
body.mr-landscape-view .mr-form-actions,
body.mr-landscape-view .mr-readonly-note,
body.mr-landscape-view .mr-daily-savings-hint,
body.mr-landscape-view #mrLandscapeToggle,
body.mr-landscape-view .mr-toolbar-actions,
body.mr-device-landscape .sidebar,
body.mr-device-landscape .mobile-app-bar,
body.mr-device-landscape .mobile-nav-backdrop,
body.mr-device-landscape .app-chat-fab,
body.mr-device-landscape .app-chat-panel,
body.mr-device-landscape .page-header,
body.mr-device-landscape .mr-latest-card,
body.mr-device-landscape .mr-rotate-hint,
body.mr-device-landscape .dash-report-card,
body.mr-device-landscape .card:not(.mr-card):not(.alert),
body.mr-device-landscape .alert,
body.mr-device-landscape .monitoring-release-net,
body.mr-device-landscape .mr-form-actions,
body.mr-device-landscape .mr-readonly-note,
body.mr-device-landscape .mr-daily-savings-hint,
body.mr-device-landscape #mrLandscapeToggle,
body.mr-device-landscape .mr-toolbar-actions {
    display: none !important;
}

html:has(body.mr-landscape-view),
html:has(body.mr-device-landscape),
body.mr-landscape-view,
body.mr-device-landscape {
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

body.mr-landscape-view .layout,
body.mr-device-landscape .layout {
    display: block;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

body.mr-landscape-view .main,
body.mr-device-landscape .main {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.mr-landscape-view .mr-card,
body.mr-device-landscape .mr-card {
    margin: 0;
    border-radius: 8px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.mr-landscape-view .monitoring-report-sheet,
body.mr-device-landscape .monitoring-report-sheet {
    padding: 6px 8px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.mr-landscape-view #monitoring-report-form,
body.mr-landscape-view .monitoring-report-sheet > fieldset,
body.mr-device-landscape #monitoring-report-form,
body.mr-device-landscape .monitoring-report-sheet > fieldset {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

body.mr-landscape-view .mr-sheet-header,
body.mr-device-landscape .mr-sheet-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    text-align: left;
    margin-bottom: 4px;
    padding-right: 108px;
}

body.mr-landscape-view .monitoring-report-title,
body.mr-landscape-view .monitoring-report-subtitle,
body.mr-landscape-view .mr-month-label,
body.mr-device-landscape .monitoring-report-title,
body.mr-device-landscape .monitoring-report-subtitle,
body.mr-device-landscape .mr-month-label {
    text-align: left;
    margin: 0;
}

body.mr-landscape-view .monitoring-report-subtitle,
body.mr-device-landscape .monitoring-report-subtitle {
    font-size: 13px;
    letter-spacing: 0.08em;
}

body.mr-landscape-view .mr-month-label,
body.mr-device-landscape .mr-month-label {
    font-size: 11px;
    margin-left: auto;
}

body.mr-landscape-view .mr-header-rule,
body.mr-device-landscape .mr-header-rule {
    display: none;
}

body.mr-landscape-view .monitoring-report-toolbar,
body.mr-device-landscape .monitoring-report-toolbar {
    margin-bottom: 4px;
    padding: 4px 8px;
    gap: 8px;
}

body.mr-landscape-view .mr-daily-savings,
body.mr-device-landscape .mr-daily-savings {
    margin-bottom: 4px;
    padding: 4px 8px;
}

body.mr-landscape-view .mr-daily-savings input,
body.mr-device-landscape .mr-daily-savings input {
    width: 110px;
    height: 28px;
}

body.mr-landscape-view .monitoring-report-wrap,
body.mr-device-landscape .monitoring-report-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

body.mr-landscape-view .monitoring-report-table,
body.mr-device-landscape .monitoring-report-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

body.mr-landscape-view .mr-th-full,
body.mr-device-landscape .mr-th-full {
    display: none;
}

body.mr-landscape-view .mr-th-abbr,
body.mr-device-landscape .mr-th-abbr {
    display: inline;
}

body.mr-landscape-view .monitoring-report-table thead th,
body.mr-landscape-view .monitoring-report-table tbody td,
body.mr-landscape-view .monitoring-report-table tfoot td,
body.mr-device-landscape .monitoring-report-table thead th,
body.mr-device-landscape .monitoring-report-table tbody td,
body.mr-device-landscape .monitoring-report-table tfoot td {
    font-size: 9px;
    padding: 0;
}

body.mr-landscape-view .monitoring-report-table thead th,
body.mr-device-landscape .monitoring-report-table thead th {
    padding: 5px 2px;
    line-height: 1.15;
    white-space: normal;
}

body.mr-landscape-view .monitoring-report-input,
body.mr-device-landscape .monitoring-report-input {
    height: 22px;
    font-size: 9px;
    padding: 0 2px;
    white-space: nowrap;
}

body.mr-landscape-view .mr-th-num,
body.mr-landscape-view .monitoring-report-table tbody td.day-num,
body.mr-device-landscape .mr-th-num,
body.mr-device-landscape .monitoring-report-table tbody td.day-num {
    width: 22px;
    min-width: 22px;
}

body.mr-landscape-view .mr-th-date,
body.mr-landscape-view .monitoring-report-table tbody td.date-cell,
body.mr-device-landscape .mr-th-date,
body.mr-device-landscape .monitoring-report-table tbody td.date-cell {
    width: 58px;
    min-width: 58px;
}

body.mr-landscape-view .monitoring-report-table thead th.mr-th-num,
body.mr-landscape-view .monitoring-report-table tbody td.day-num,
body.mr-device-landscape .monitoring-report-table thead th.mr-th-num,
body.mr-device-landscape .monitoring-report-table tbody td.day-num {
    position: sticky;
    left: 0;
    z-index: 3;
}

body.mr-landscape-view .monitoring-report-table thead th.mr-th-date,
body.mr-landscape-view .monitoring-report-table tbody td.date-cell,
body.mr-device-landscape .monitoring-report-table thead th.mr-th-date,
body.mr-device-landscape .monitoring-report-table tbody td.date-cell {
    position: sticky;
    left: 22px;
    z-index: 3;
}

body.mr-landscape-view .monitoring-report-table thead th.mr-th-num,
body.mr-landscape-view .monitoring-report-table thead th.mr-th-date,
body.mr-device-landscape .monitoring-report-table thead th.mr-th-num,
body.mr-device-landscape .monitoring-report-table thead th.mr-th-date {
    background: #16304f;
    z-index: 5;
}

body.mr-landscape-view .monitoring-report-table tbody td.day-num,
body.mr-device-landscape .monitoring-report-table tbody td.day-num {
    background: #e2e8f0;
}

body.mr-landscape-view .monitoring-report-table tbody td.date-cell,
body.mr-device-landscape .monitoring-report-table tbody td.date-cell {
    background: #f1f5f9;
}

body.mr-landscape-view .monitoring-report-table tfoot td,
body.mr-device-landscape .monitoring-report-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding: 5px 2px;
    background: #e8eef6;
}

body.mr-landscape-view .monitoring-report-table tfoot td.day-num,
body.mr-device-landscape .monitoring-report-table tfoot td.day-num {
    left: 0;
    background: #e8eef6;
    z-index: 6;
}

body.mr-landscape-view .monitoring-report-table tfoot td.date-cell,
body.mr-device-landscape .monitoring-report-table tfoot td.date-cell {
    left: 22px;
    background: #e8eef6;
    z-index: 6;
}

body.mr-landscape-view .mr-landscape-exit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 6px;
    right: 8px;
    z-index: 90;
    min-height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.monitor-log-amount-released td {
    background: rgba(14, 116, 144, 0.08);
}

.monitor-log-failed-expenses td {
    background: rgba(180, 83, 9, 0.08);
}

/* Keep +₱1,200.00 on one line so the sign does not wrap above the amount. */
td.monitor-log-delta,
td.monitor-log-money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

td.monitor-log-delta {
    font-weight: 600;
}

/* Release Papers (promissory-note.php) */
.pn-card {
    background: linear-gradient(180deg, #e8edf5 0%, #dfe6f0 100%);
    padding: 22px 18px 26px;
    border: 1px solid #d0d7e4;
}

.pn-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 14px 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border-bottom: 1px solid #e2e8f0;
}

.pn-card-head-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pn-card-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.pn-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.pn-card-head-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px 12px;
    margin-left: auto;
}

.pn-area-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
}

.pn-area-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 150px;
}

.pn-area-field span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.pn-area-select {
    min-width: 160px;
    height: 34px;
    border: 1px solid #dbe3f0;
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.pn-area-select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.pn-form-actions {
    padding: 14px 22px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.promissory-note-sheet {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    color: #111;
    padding: 32px 40px 36px;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 12.5px;
    line-height: 1.5;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 28px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.promissory-note-sheet,
.promissory-note-sheet * {
    font-family: 'Times New Roman', Times, serif !important;
}

.promissory-note-sheet input,
.promissory-note-sheet select,
.promissory-note-sheet button,
.promissory-note-sheet .pn-type-auto-label,
.promissory-note-sheet .pn-section-label,
.promissory-note-sheet .pn-meta-table label,
.promissory-note-sheet .pn-cash-title,
.promissory-note-sheet .pn-name-label,
.promissory-note-sheet .pn-type-label {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif !important;
}

.pn-sheet-header {
    text-align: center;
    margin-bottom: 18px;
}

.pn-sheet-readonly input,
.pn-view-only input,
.pn-view-only select {
    background: #f8fafc;
    pointer-events: none;
}

.pn-company {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    width: 100%;
    color: #1e293b;
}

.pn-title {
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 800;
    font-size: 22px;
    margin: 8px 0 10px;
    letter-spacing: 0.18em;
    color: #0f172a;
}

.pn-header-rule {
    width: 120px;
    height: 2px;
    margin: 0 auto 14px;
    background: linear-gradient(90deg, transparent, #1e3a5f 20%, #1e3a5f 80%, transparent);
}

.pn-type-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 0 auto 4px;
    padding: 6px 14px;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.pn-type-label {
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 10px;
}

.pn-type-auto-label {
    font-weight: 800;
    letter-spacing: 0.1em;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.pn-type-auto-label--new {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.pn-type-auto-label--renew {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}

.pn-type-print {
    display: none;
    text-align: center;
    font-size: 13px;
    margin: 0 0 12px;
}

.pn-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    letter-spacing: 0.02em;
}

.pn-type-badge--renew {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.pn-type-badge--new {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.pn-status-badge--pending {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.pn-status-badge--released {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.pn-status-badge--cancelled {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.pn-status-badge--pending {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.pn-name-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
}

.pn-name-row.pn-address-row {
    margin-top: -8px;
}

.pn-address-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.pn-address-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    width: 100%;
}

.pn-address-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 140px;
    min-width: 120px;
}

.pn-address-field span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.pn-address-select {
    width: 100%;
    font-weight: 600;
    font-size: 14px;
    padding: 4px 2px 6px;
    border: 0;
    border-bottom: 2px solid #cbd5e1;
    background: transparent;
    color: #0f172a;
    border-radius: 0;
}

.pn-address-select:focus {
    outline: none;
    border-bottom-color: #1d4ed8;
}

.pn-address-selects.is-readonly .pn-address-select {
    pointer-events: none;
    color: #334155;
}

.pn-address-print {
    display: none;
}

.pn-name-label {
    flex: 0 0 auto;
    white-space: nowrap;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 72px;
}

.pn-name-suggest-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.pn-name-input {
    width: 100%;
    font-weight: 600;
    font-size: 15px;
    padding: 4px 2px 6px;
    border-bottom: 2px solid #cbd5e1;
}

.pn-name-input:focus {
    border-bottom-color: #1d4ed8;
}

.pn-name-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 40;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.pn-name-suggest-list[hidden] {
    display: none !important;
}

.pn-name-suggest-item {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pn-name-suggest-item mark {
    background: none;
    color: #0f172a;
    font-weight: 600;
}

.pn-name-suggest-item.is-active,
.pn-name-suggest-item:hover {
    background: #f1f5f9;
    color: #334155;
}

@media print {
    .pn-name-suggest-list {
        display: none !important;
    }
}

.pn-meta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    table-layout: fixed;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #fafbfc;
}

.pn-meta-table td {
    border: none;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 10px 12px;
    vertical-align: top;
    width: 25%;
    background: #fff;
}

.pn-meta-table tr:last-child td {
    border-bottom: none;
}

.pn-meta-table td:last-child {
    border-right: none;
}

.pn-meta-table-5 td {
    width: 20%;
}

.pn-meta-table-6 td {
    width: 16.666%;
}

.pn-meta-table label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pn-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #cbd5e1;
    background: transparent;
    font: inherit;
    color: #0f172a;
    padding: 2px 0 4px;
    outline: none;
    text-align: left;
    font-weight: 600;
}

.pn-input:focus {
    border-bottom-color: #1d4ed8;
}

.pn-input-date {
    border-bottom: 1px solid #cbd5e1;
}

.pn-body {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.pn-body p {
    text-align: justify;
    margin: 0 0 12px;
    text-indent: 0;
    color: #1e293b;
}

.pn-body p + p {
    text-indent: 1.5em;
}

.pn-demand-waived {
    font-family: 'Times New Roman', Times, serif !important;
    font-weight: 700 !important;
    font-style: normal;
    text-transform: uppercase;
}

.pn-blur {
    filter: none;
    user-select: auto;
}

@media print {
    .pn-blur {
        filter: none !important;
        user-select: auto !important;
    }
}

.pn-inline {
    display: inline-block;
    border: none;
    border-bottom: 1px solid #94a3b8;
    background: transparent;
    font: inherit;
    color: #0f172a;
    padding: 0 4px;
    margin: 0 2px;
    outline: none;
    vertical-align: baseline;
    text-align: left;
    font-weight: 600;
}

.pn-inline:focus {
    border-bottom-color: #1d4ed8;
}

.pn-inline-wide {
    min-width: 220px;
    width: 48%;
}

.pn-inline-words {
    min-width: 16ch;
    width: auto;
    max-width: 100%;
    font-weight: 700;
}

.pn-inline-mid {
    min-width: 160px;
    width: 28%;
}

.pn-inline-money {
    min-width: 100px;
    width: 120px;
    text-align: left;
}

.pn-inline-money-lg {
    min-width: 180px;
    width: 42%;
    text-align: left;
}

.pn-sign-grid,
.pn-witness-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 28px;
}

.pn-sign-col {
    min-width: 0;
    padding: 12px 14px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafbfc;
}

.pn-sign-line {
    border-bottom: 1px solid #334155;
    height: 32px;
    margin-bottom: 6px;
}

.pn-sign-caption {
    text-align: center;
    font-size: 11px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #475569;
}

.pn-field-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
}

.pn-field-row span {
    flex: 0 0 auto;
    white-space: nowrap;
    color: #475569;
}

.pn-uline {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-bottom: 1px solid #94a3b8;
    background: transparent;
    font: inherit;
    color: #0f172a;
    padding: 1px 2px;
    outline: none;
    text-align: left;
}

.pn-uline:focus {
    border-bottom-color: #1d4ed8;
}

.pn-witness-head {
    text-align: center;
    margin: 28px 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #334155;
}

.pn-section-label {
    margin: 22px 0 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.pn-extras {
    margin-top: 8px;
    display: grid;
    gap: 10px;
    max-width: 480px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.pn-cash-block {
    margin-top: 4px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
    column-gap: 20px;
    align-items: start;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.pn-cash-col {
    min-width: 0;
}

.pn-cash-title {
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 10px;
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #334155;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.pn-cash-serial-group {
    margin-bottom: 4px;
}

.pn-cash-serial-row,
.pn-cash-count-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
    font-size: 12px;
}

.pn-cash-label {
    min-width: 64px;
    font-weight: 600;
    white-space: nowrap;
    color: #475569;
}

.pn-cash-label-spacer {
    min-width: 64px;
    visibility: hidden;
}

.pn-cash-serial-sign {
    margin-top: 20px;
    max-width: 240px;
}

.pn-cash-serial-sign .pn-sign-line {
    height: 40px;
}

.pn-cash-serial-sign .pn-sign-caption {
    margin-bottom: 0;
}

.pn-sign-line--img {
    height: auto;
    min-height: 44px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 2px;
    background: transparent;
}

.pn-customer-sign-img {
    display: block;
    width: auto;
    max-width: 72%;
    max-height: 52px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center bottom;
    background: transparent !important;
    mix-blend-mode: multiply;
}

.pn-borrower-sign-stack {
    position: relative;
    min-height: 52px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: visible;
}

.pn-borrower-sign-stack .pn-sign-printed-name {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 4px;
    margin: 0;
    z-index: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: #111;
    pointer-events: none;
}

.pn-borrower-sign-stack .pn-customer-sign-img {
    position: relative;
    z-index: 2;
    max-width: 88%;
    max-height: 56px;
}

.pn-sign-col .pn-sign-printed-name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #111;
}

body.pn-sign-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.pn-sign-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    overscroll-behavior: none;
}

.pn-sign-overlay[hidden] {
    display: none !important;
}

.pn-sign-dialog {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 12px;
    padding: 16px 16px 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
    max-height: 100%;
    overflow: auto;
}

.pn-sign-dialog-title {
    margin: 0 0 4px;
    font-size: 18px;
}

.pn-sign-dialog-sub {
    margin: 0 0 8px;
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}

.pn-sign-dialog-how {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
}

.pn-sign-pad-wrap {
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    touch-action: none;
    min-height: 96px;
    cursor: pointer;
}

.pn-sign-pad-wrap canvas,
#pnCustomerSignPad,
#pnBorrowerSignPad,
#pnSerialSignPad,
#pnComakerSignPad,
#pnSignBoardPad {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
    background: #fff;
    -webkit-user-select: none;
    user-select: none;
}

.pn-sign-pad-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
}

.pn-sign-pad-wrap.is-signed .pn-sign-pad-hint {
    display: none;
}

.pn-sign-dialog-hint {
    margin: 8px 0 12px;
    font-size: 12px;
    color: #64748b;
}

.pn-sign-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 700px) {
    .pn-sign-overlay {
        padding: 0;
        align-items: stretch;
    }

    .pn-sign-dialog {
        width: 100%;
        min-height: 100%;
        border-radius: 0;
        padding: 14px 14px 18px;
        display: flex;
        flex-direction: column;
    }

    .pn-sign-pad-wrap {
        flex: 0 0 auto;
        min-height: 96px;
    }

    .pn-sign-dialog-actions {
        margin-top: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .pn-sign-btn {
        min-height: 44px;
        font-size: 15px;
        width: 100%;
    }

    #pnCustomerSignSave {
        grid-column: 1 / -1;
    }
}

.tr-mobile-list {
    display: none;
}

.tr-help-note {
    margin: 0;
    padding: 10px 16px 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.tr-mobile-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
}

.tr-mobile-name {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.tr-mobile-meta {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
}

.tr-mobile-sign {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.tr-mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tr-mobile-actions form {
    margin: 0;
}

.tr-mobile-actions .btn-sm,
.tr-mobile-actions a.btn-sm,
.tr-mobile-actions button {
    width: 100%;
    min-height: 42px;
    justify-content: center;
}

.tr-mobile-actions a.btn-sm {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .tr-desktop-table {
        display: none;
    }

    .tr-mobile-list {
        display: grid;
        gap: 10px;
        padding: 10px 12px 14px;
    }
}

body.pn-sign-mobile {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0f172a;
    font-family: inherit;
}

.pn-sign-phone {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    background: #f8fafc;
    padding: 14px 16px 24px;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.pn-sign-phone-head {
    margin-bottom: 12px;
}

.pn-sign-phone-back {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.pn-sign-phone-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.pn-sign-phone-title {
    margin: 2px 0 0;
    font-size: 22px;
    line-height: 1.2;
    color: #0f172a;
}

.pn-sign-phone-name {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}

.pn-sign-phone-meta,
.pn-sign-phone-how {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #475569;
}

.pn-sign-printed-name {
    margin: 2px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}

.pn-sign-optional {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
}

.pn-sign-name-label {
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.pn-sign-name-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    color: #0f172a;
    background: #fff;
}

.pn-sign-block {
    margin-bottom: 14px;
}

.pn-sign-phone .pn-sign-pad-wrap {
    height: 110px;
}

.pn-sign-block-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.pn-sign-block-note {
    margin: -2px 0 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

.pn-sign-clear {
    margin-top: 8px;
    min-height: 36px;
}

.pn-sign-phone-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pn-sign-phone-pad {
    flex: 1 1 auto;
    min-height: 220px;
    background: #fff;
}

.pn-sign-phone-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pn-sign-phone-actions .pn-sign-btn {
    min-height: 46px;
    font-size: 15px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pn-sign-phone-actions #pnCustomerSignSave {
    grid-column: 1 / -1;
}

@media (min-width: 500px) {
    body.pn-sign-mobile {
        display: flex;
        align-items: stretch;
        justify-content: center;
        padding: 16px;
    }

    .pn-sign-phone {
        min-height: calc(100vh - 32px);
        min-height: calc(100dvh - 32px);
        border-radius: 24px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
        overflow: auto;
    }
}

html.pn-sign-board-open,
body.pn-sign-board-open {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: none;
}

body.pn-sign-board-open {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

.pn-sign-board {
    position: fixed;
    z-index: 40000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}

.pn-sign-board[hidden] {
    display: none !important;
}

.pn-sign-board-bar {
    position: relative;
    z-index: 40;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.pn-sign-board-title {
    flex: 1;
    margin: 0;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.pn-sign-board-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}

.pn-sign-board-btn-done {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.pn-sign-board-stage {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: auto;
    height: auto;
    margin: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    touch-action: none;
}

.pn-sign-board-stage canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.pn-sign-board-over-name {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 2;
    margin: 0;
    pointer-events: none;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

html.pn-sign-board-forced-landscape .pn-sign-board {
    top: 0;
    left: 100%;
    width: 100dvh;
    height: 100dvw;
    transform: rotate(90deg);
    transform-origin: top left;
}

.pn-sign-rotate {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 24px 20px;
    background: #fff;
    text-align: center;
}

.pn-sign-rotate[hidden] {
    display: none !important;
}

html.pn-sign-need-rotate .pn-sign-rotate,
body.pn-sign-need-rotate .pn-sign-rotate {
    display: flex;
}

.pn-sign-rotate-glyph {
    position: relative;
    width: min(58vw, 260px);
    height: min(58vw, 260px);
}

.pn-sign-rotate-phone,
.pn-sign-rotate-arrows {
    position: absolute;
    left: 50%;
    top: 50%;
}

.pn-sign-rotate-phone {
    width: 42%;
    height: 72%;
    margin-left: -21%;
    margin-top: -36%;
    transform-origin: center center;
    animation: pn-sign-phone-tip 1.8s ease-in-out infinite;
}

.pn-sign-rotate-arrows {
    width: 100%;
    height: 100%;
    margin-left: -50%;
    margin-top: -50%;
    animation: pn-sign-arrows-spin 2.4s linear infinite;
}

.pn-sign-rotate-text {
    margin: 0;
    font-size: clamp(32px, 10vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.01em;
    color: #0f172a;
}

@keyframes pn-sign-phone-tip {
    0%,
    18% {
        transform: rotate(0deg);
    }
    42%,
    68% {
        transform: rotate(90deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes pn-sign-arrows-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (orientation: landscape) {
    .pn-sign-board-bar {
        padding-top: max(4px, env(safe-area-inset-top));
        padding-bottom: 4px;
    }

    .pn-sign-board-title {
        font-size: 12px;
    }

    .pn-sign-board-btn {
        min-height: 36px;
    }
}

.pn-cash-serial-input,
.pn-cash-count-input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
}

.pn-cash-count-input {
    max-width: 88px;
}

.pn-cash-total-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #cbd5e1;
    font-weight: 700;
}

.pn-cash-total-input {
    flex: 1;
    min-width: 0;
    max-width: 100px;
    font-size: 12px;
    font-weight: 700;
    background: transparent;
}

.pn-files-mobile {
    display: none;
}

.pn-mobile-back {
    display: inline-block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.tr-mobile-card--active {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

@media (max-width: 720px) {
    .pn-page.collector-app .app-page-header {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }

    .pn-page.collector-app .app-page-actions {
        width: 100%;
    }

    .pn-page.collector-app .app-page-actions .btn-sm {
        width: 100%;
        min-height: 42px;
        justify-content: center;
    }

    .pn-page .pn-card {
        padding: 0;
    }

    .pn-page .pn-card-head {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pn-page .pn-card-head-tools {
        margin-left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
    }

    .pn-page .pn-area-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 8px;
    }

    .pn-page .pn-area-field {
        min-width: 0;
        width: 100%;
    }

    .pn-page .pn-area-select {
        min-width: 0;
        width: 100%;
        height: 42px;
        font-size: 16px;
    }

    .pn-page .pn-card-head-tools > .btn,
    .pn-page .pn-card-head-tools > .btn-sm,
    .pn-page .pn-card-head-tools > .pn-view-back {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        box-sizing: border-box;
    }

    .pn-page .app-sheet-card {
        overflow: visible;
    }

    .pn-page .app-sheet-card .promissory-note-sheet,
    .pn-page .promissory-note-sheet {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 16px 14px 20px;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .pn-page .pn-title {
        font-size: 16px;
        letter-spacing: 0.08em;
        margin: 6px 0 8px;
    }

    .pn-page .pn-company {
        font-size: 11px;
        letter-spacing: 0.06em;
    }

    .pn-page .pn-name-row {
        flex-wrap: wrap;
        gap: 4px 8px;
        margin-bottom: 12px;
    }

    .pn-page .pn-name-label {
        min-width: 0;
    }

    .pn-page .pn-name-suggest-wrap,
    .pn-page .pn-name-input {
        width: 100%;
        min-width: 0;
    }

    .pn-cash-block {
        grid-template-columns: 1fr;
        row-gap: 16px;
    }

    .pn-meta-table,
    .pn-meta-table tbody,
    .pn-meta-table tr,
    .pn-meta-table td {
        display: block;
        width: 100% !important;
    }

    .pn-meta-table td {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .pn-page .pn-meta-table {
        table-layout: auto;
        overflow: hidden;
    }

    .pn-page .pn-input,
    .pn-page .pn-input-date,
    .pn-page input[type="date"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    .pn-page .pn-body p {
        text-align: left;
    }

    .pn-page .pn-inline,
    .pn-page .pn-inline-wide,
    .pn-page .pn-inline-mid,
    .pn-page .pn-inline-money,
    .pn-page .pn-inline-money-lg {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 6px 0;
        font-size: 15px;
    }

    .pn-sign-grid,
    .pn-witness-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pn-page .pn-extras {
        max-width: none;
        padding: 12px;
    }

    .pn-page .pn-field-row {
        flex-wrap: wrap;
    }

    .pn-page .pn-field-row span {
        min-width: 0;
        white-space: normal;
    }

    .pn-page .pn-blur {
        filter: none;
        user-select: auto;
    }

    .pn-files-desktop {
        display: none;
    }

    .pn-files-mobile {
        display: grid;
        gap: 10px;
        padding: 10px 12px 14px;
    }

    .pn-saved-card .card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .pn-saved-card .central-filter-form {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .pn-saved-card .central-filter-form label,
    .pn-saved-card .central-filter-form input,
    .pn-saved-card .central-filter-form .btn-sm {
        width: 100%;
        min-height: 42px;
    }
}

@media screen and (orientation: landscape) and (max-height: 520px) {
    .pn-page .collector-topnav {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        position: sticky;
        top: 0;
        z-index: 25;
        background: #0b1220;
    }

    .pn-page .collector-topnav .btn,
    .pn-page .collector-topnav .btn-primary {
        width: auto;
        min-width: 0;
        min-height: 32px;
        flex: 1 1 auto;
        padding: 6px 8px;
        font-size: 12px;
        border-radius: 8px;
    }

    .pn-page .collector-topnav-logout {
        grid-column: auto;
        flex: 0 0 auto;
    }

    .pn-page.collector-app .app-page-header {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px 12px;
        margin: 0 0 8px;
    }

    .pn-page .app-page-header h1 {
        font-size: 16px;
        margin: 0;
    }

    .pn-page .app-page-sub {
        display: none;
    }

    .pn-page .pn-mobile-back {
        margin: 0 8px 0 0;
        font-size: 13px;
    }

    .pn-page .app-page-actions .btn-sm {
        width: auto;
        min-height: 32px;
    }

    .pn-page .main {
        padding: 8px 10px 12px;
    }

    .pn-page .pn-card-head {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
    }

    .pn-page .app-sheet-card {
        overflow: visible;
    }

    .pn-page .app-sheet-card .promissory-note-sheet,
    .pn-page .promissory-note-sheet {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 12px 16px 16px;
        box-shadow: none;
    }

    .pn-page .pn-title {
        font-size: 16px;
        margin: 4px 0 6px;
        letter-spacing: 0.1em;
    }

    .pn-page .pn-name-row {
        flex-wrap: nowrap;
        margin-bottom: 8px;
    }

    .pn-page .pn-meta-table,
    .pn-page .pn-meta-table tbody,
    .pn-page .pn-meta-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    .pn-page .pn-meta-table td {
        display: table-cell;
        width: 16.666% !important;
        padding: 6px 6px 8px;
        border-right: 1px solid #e2e8f0;
        border-bottom: none;
        vertical-align: top;
    }

    .pn-page .pn-input,
    .pn-page .pn-input-date,
    .pn-page input[type="date"] {
        font-size: 13px;
    }

    .pn-page .pn-inline,
    .pn-page .pn-inline-wide,
    .pn-page .pn-inline-mid,
    .pn-page .pn-inline-money,
    .pn-page .pn-inline-money-lg {
        display: inline-block;
        width: auto;
        min-width: 0;
        max-width: 42%;
        margin: 0 4px 0 0;
        font-size: 13px;
    }

    .pn-page .pn-inline-words {
        display: inline-block;
        width: auto;
        min-width: 16ch;
        max-width: 100%;
        margin: 0 4px 0 0;
        font-size: 13px;
    }

    .pn-page .pn-sign-grid,
    .pn-page .pn-witness-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px 20px;
        margin-top: 14px;
    }

    .pn-page .pn-cash-block {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
        row-gap: 0;
    }

    .pn-page .pn-extras {
        max-width: 520px;
        padding: 10px 12px;
    }

    .pn-page #saved-release-papers {
        display: none;
    }

    .ops-browse-page .sca-hero,
    .collector-app .app-page-header,
    .collector-app .page-header {
        align-items: flex-start !important;
        justify-content: flex-start;
        text-align: left;
    }

    .ops-browse-page .sca-hero > div,
    .collector-app .app-page-header > div {
        width: 100%;
        text-align: left;
    }

    .ops-browse-page .sca-hero-meta {
        justify-content: flex-start;
    }
}

@media print {
    .pn-cash-block {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) !important;
    }
}

.pn-extras .pn-field-row span {
    min-width: 130px;
}

.pn-select {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    cursor: pointer;
    background: transparent;
    padding-right: 18px;
    background-image: linear-gradient(45deg, transparent 50%, #333 50%), linear-gradient(135deg, #333 50%, transparent 50%);
    background-position: calc(100% - 10px) calc(50% - 2px), calc(100% - 5px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.pn-saved-card .card-head {
    align-items: center;
}

.app-sheet-card .promissory-note-sheet {
    margin: 18px auto;
    border-radius: 4px;
}

/* Typeable collector suggest (shared) */
.collector-suggest-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: block;
}

.collector-suggest-wrap .js-collector-suggest,
.collector-suggest-wrap input {
    width: 100%;
}

.collector-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 50;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.collector-suggest-list[hidden] {
    display: none !important;
}

.collector-suggest-item {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collector-suggest-item mark {
    background: none;
    color: #0f172a;
    font-weight: 600;
}

.collector-suggest-item.is-active,
.collector-suggest-item:hover {
    background: #f1f5f9;
    color: #334155;
}

@media print {
    .collector-suggest-list {
        display: none !important;
    }
}

@media print {
    @page {
        size: 8.5in 13in;
        margin: 0.35in 0.4in;
    }

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

    html,
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    .layout,
    .main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: 0 !important;
    }

    .sidebar,
    .page-header,
    .app-page-header,
    .card-head,
    .alert,
    .form-actions {
        display: none !important;
    }

    .pn-card,
    .app-sheet-card,
    .card {
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .promissory-note-sheet {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 10px !important;
        line-height: 1.28 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .pn-header-rule {
        display: none !important;
    }

    .pn-sheet-header {
        margin-bottom: 6px !important;
    }

    .pn-company {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin: 0 0 2px !important;
        letter-spacing: 0.02em !important;
    }

    .pn-title {
        font-size: 14px !important;
        margin: 2px 0 6px !important;
        letter-spacing: 0.03em !important;
    }

    .pn-type-print {
        display: block !important;
        font-size: 10px !important;
        margin: 0 0 6px !important;
    }

    .pn-name-row {
        margin: 0 0 6px !important;
        gap: 6px !important;
    }

    .pn-name-row.pn-address-row {
        margin-top: -2px !important;
        margin-bottom: 6px !important;
    }

    .pn-address-selects {
        display: none !important;
    }

    .pn-address-print {
        display: block !important;
        width: 100%;
        font-size: 12px !important;
        font-weight: 600;
        min-height: 16px;
        border-bottom: 1px solid #000;
        padding-bottom: 2px;
    }

    .pn-name-label {
        font-size: 10px !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        min-width: auto !important;
        color: #000 !important;
    }

    .pn-name-input {
        font-size: 10px !important;
        font-weight: 400 !important;
        border-bottom-width: 1px !important;
        padding: 0 !important;
    }

    .pn-meta-table {
        margin: 0 0 6px !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        border-collapse: collapse !important;
        overflow: visible !important;
    }

    .pn-meta-table td {
        padding: 1px 3px 1px 0 !important;
        font-size: 10px !important;
        vertical-align: bottom !important;
        border: 1px solid #000 !important;
        background: transparent !important;
        display: table-cell !important;
        width: 16.666% !important;
    }

    .pn-meta-table label {
        font-size: 9px !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        color: #000 !important;
        margin-bottom: 1px !important;
    }

    .pn-body {
        border-top: none !important;
        padding-top: 0 !important;
    }

    .pn-body p {
        margin: 0 0 5px !important;
        font-size: 10px !important;
        line-height: 1.3 !important;
        color: #000 !important;
        font-family: 'Times New Roman', Times, serif !important;
    }

    .pn-demand-waived {
        font-weight: 700 !important;
        font-family: 'Times New Roman', Times, serif !important;
    }

    .pn-body p + p {
        margin-top: 4px !important;
    }

    .pn-sign-grid,
    .pn-witness-grid {
        gap: 10px 16px !important;
        margin: 6px 0 !important;
    }

    .pn-sign-col {
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .pn-sign-line {
        margin-top: 10px !important;
        margin-bottom: 2px !important;
        border-bottom-color: #000 !important;
    }

    .pn-sign-caption {
        font-size: 9px !important;
        margin-bottom: 3px !important;
        color: #000 !important;
    }

    .pn-field-row {
        margin: 1px 0 !important;
        gap: 4px !important;
        font-size: 9.5px !important;
    }

    .pn-field-row span {
        min-width: 72px !important;
        font-size: 9.5px !important;
        color: #000 !important;
    }

    .pn-witness-head {
        margin: 6px 0 4px !important;
        font-size: 10px !important;
        color: #000 !important;
        letter-spacing: 0 !important;
    }

    .pn-cash-block {
        margin: 6px 0 !important;
        gap: 8px 12px !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .pn-cash-title {
        font-size: 10px !important;
        margin-bottom: 3px !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        text-decoration: underline !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        color: #000 !important;
    }

    .pn-cash-serial-row,
    .pn-cash-count-row {
        margin: 1px 0 !important;
        gap: 4px !important;
    }

    .pn-cash-label {
        font-size: 9px !important;
        min-width: 52px !important;
        color: #000 !important;
    }

    .pn-cash-total-row {
        margin-top: 2px !important;
        padding-top: 2px !important;
        border-top-color: #000 !important;
    }

    .pn-cash-serial-sign {
        margin-top: 10px !important;
        max-width: 70% !important;
    }

    .pn-cash-serial-sign .pn-sign-line {
        height: auto !important;
        min-height: 28px !important;
        margin-top: 8px !important;
        margin-bottom: 2px !important;
        border-bottom-color: #000 !important;
    }

    .pn-cash-serial-sign .pn-sign-caption {
        font-size: 9px !important;
        margin-bottom: 0 !important;
        color: #000 !important;
    }

    .pn-cash-serial-sign .pn-sign-line--img,
    .pn-cash-serial-sign .pn-borrower-sign-stack {
        height: auto !important;
        min-height: 36px !important;
        margin-top: 8px !important;
        justify-content: center !important;
        background: transparent !important;
    }

    .pn-cash-serial-sign .pn-sign-printed-name {
        bottom: 2px !important;
        font-size: 10px !important;
        color: #000 !important;
    }

    .pn-customer-sign-img {
        max-height: 36px !important;
        max-width: 72% !important;
        margin: 0 auto !important;
        background: transparent !important;
        mix-blend-mode: multiply !important;
    }

    .pn-borrower-sign-stack {
        min-height: 36px !important;
        margin-top: 8px !important;
    }

    .pn-borrower-sign-stack .pn-sign-printed-name {
        bottom: 2px !important;
        font-size: 10px !important;
        color: #000 !important;
    }

    .pn-borrower-sign-stack .pn-customer-sign-img {
        max-height: 34px !important;
        max-width: 88% !important;
    }

    .pn-sign-printed-name {
        font-size: 10px !important;
        margin: 0 0 1px !important;
        color: #000 !important;
        text-align: center !important;
        background: transparent !important;
    }

    .pn-extras {
        margin-top: 6px !important;
        gap: 2px !important;
        padding: 0 !important;
        max-width: none !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .pn-extras .pn-field-row span {
        min-width: 110px !important;
    }

    .pn-input,
    .pn-inline,
    .pn-uline,
    .pn-cash-serial-input,
    .pn-cash-count-input,
    .pn-cash-total-input {
        border-bottom-color: #000 !important;
        font-size: 10px !important;
        font-weight: 400 !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 0 1px !important;
        background: transparent !important;
        color: #000 !important;
    }

    .pn-select {
        background-image: none !important;
    }

    .pn-inline-money,
    .pn-inline-money-lg {
        max-width: 7rem !important;
    }
}

/* Post-login greeting overlay */
.login-greeting-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background:
        radial-gradient(ellipse 80% 55% at 50% 42%, rgba(37, 99, 235, 0.18) 0%, transparent 70%),
        rgba(10, 14, 22, 0.62);
    backdrop-filter: blur(18px) saturate(1.05);
    -webkit-backdrop-filter: blur(18px) saturate(1.05);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: loginGreetingIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    user-select: none;
}

.login-greeting-overlay.is-hiding {
    animation: loginGreetingOut 0.4s ease forwards;
    pointer-events: none;
}

.login-greeting-card {
    width: min(880px, 100%);
    max-width: 100%;
    text-align: center;
    pointer-events: none;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.login-greeting-hello {
    margin: 0 0 20px;
    font-size: clamp(13px, 2.2vw, 16px);
    font-weight: 600;
    color: rgba(191, 219, 254, 0.92);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0;
    animation: loginGreetingRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.login-greeting-name {
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 4px;
    font-size: clamp(26px, 7.2vw, 64px);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.22);
    opacity: 0;
    animation: loginGreetingRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.16s forwards;
}

.login-greeting-role {
    margin: 14px 0 0;
    font-size: clamp(13px, 2vw, 15px);
    font-weight: 500;
    color: rgba(226, 232, 240, 0.72);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    animation: loginGreetingRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.24s forwards;
}

.login-greeting-rule {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    width: 100%;
    height: auto;
    margin: 28px 0 22px;
    background: none;
    opacity: 0;
    animation: loginGreetingRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.32s forwards;
}

.login-greeting-rule > span {
    display: block;
    width: 56px;
    height: 2px;
    flex: 0 0 56px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.95), transparent);
}

.login-greeting-sub {
    margin: 0 0 36px;
    font-size: clamp(18px, 3.2vw, 26px);
    font-weight: 400;
    color: rgba(226, 232, 240, 0.78);
    letter-spacing: 0.01em;
    opacity: 0;
    animation: loginGreetingRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.38s forwards;
}

.login-greeting-hint {
    margin: 0;
    font-size: clamp(12px, 1.8vw, 14px);
    font-weight: 500;
    color: rgba(148, 163, 184, 0.85);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0;
    animation: loginGreetingHint 1.8s ease-in-out 0.7s infinite;
}

@keyframes loginGreetingIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes loginGreetingOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

@keyframes loginGreetingHint {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

@media screen and (max-width: 720px) {
    .login-greeting-overlay {
        padding: 24px 16px;
        align-items: center;
    }

    .login-greeting-card {
        width: 100%;
        max-width: 100%;
        padding: 12px 8px;
    }

    .login-greeting-name {
        font-size: clamp(22px, 8vw, 36px);
        line-height: 1.25;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-greeting-overlay,
    .login-greeting-overlay.is-hiding,
    .login-greeting-hello,
    .login-greeting-name,
    .login-greeting-role,
    .login-greeting-rule,
    .login-greeting-sub,
    .login-greeting-hint {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Delete password confirmation modal */
body.delete-pw-open {
    overflow: hidden;
}

.delete-pw-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.delete-pw-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.delete-pw-dialog {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    padding: 22px 22px 18px;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}

.delete-pw-overlay.is-open .delete-pw-dialog {
    transform: translateY(0) scale(1);
}

.delete-pw-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #1d4ed8;
    margin-bottom: 12px;
}

.delete-pw-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.delete-pw-message {
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #64748b;
}

.delete-pw-label {
    display: block;
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
}

.delete-pw-input {
    width: 100%;
    height: 40px;
    border: 1px solid #dbe3f0;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
    font-family: inherit;
}

.delete-pw-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.delete-pw-error {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: #dc2626;
    font-weight: 600;
}

.delete-pw-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.delete-pw-confirm {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

.delete-pw-confirm:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

@media (prefers-reduced-motion: reduce) {
    .delete-pw-overlay,
    .delete-pw-dialog {
        transition: none;
    }
}

/* Collector Client Attendance access restricted modal */
body.collector-access-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

.collector-access-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.collector-access-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.collector-access-dialog {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    padding: 24px 24px 20px;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}

.collector-access-overlay.is-open .collector-access-dialog {
    transform: translateY(0) scale(1);
}

.collector-access-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fffbeb;
    color: #d97706;
    margin-bottom: 14px;
}

.collector-access-icon svg {
    width: 22px;
    height: 22px;
}

.collector-access-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.collector-access-message {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
}

.collector-access-message strong {
    color: #0f172a;
    font-weight: 700;
}

.collector-access-note {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

.collector-access-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.collector-access-dismiss {
    min-width: 72px;
}

.collector-access-primary {
    min-width: 150px;
    text-align: center;
}

@media screen and (max-width: 640px) {
    body.collector-access-open {
        touch-action: none;
    }

    .collector-access-overlay {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .collector-access-dialog {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 18px 18px 0 0;
        border-bottom: none;
        padding: 8px 18px max(18px, env(safe-area-inset-bottom));
        max-height: min(90vh, calc(100dvh - env(safe-area-inset-top) - 12px));
        overflow-y: auto;
        transform: translateY(100%);
        -webkit-overflow-scrolling: touch;
    }

    .collector-access-dialog::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 14px;
        border-radius: 999px;
        background: #cbd5e1;
    }

    .collector-access-overlay.is-open .collector-access-dialog {
        transform: translateY(0);
    }

    .collector-access-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .collector-access-icon svg {
        width: 24px;
        height: 24px;
    }

    .collector-access-title {
        font-size: 20px;
        line-height: 1.25;
    }

    .collector-access-message {
        font-size: 15px;
        line-height: 1.55;
    }

    .collector-access-note {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .collector-access-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
        padding-top: 4px;
    }

    .collector-access-dismiss,
    .collector-access-primary {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .collector-access-dismiss {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #f1f5f9;
        color: #475569;
    }

    .collector-access-primary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media screen and (max-width: 380px) {
    .collector-access-dialog {
        padding-left: 16px;
        padding-right: 16px;
    }

    .collector-access-title {
        font-size: 18px;
    }

    .collector-access-message,
    .collector-access-note {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collector-access-overlay,
    .collector-access-dialog {
        transition: none;
    }
}

/* Collector Due Customers locked until Today's Released is complete */
.collector-due-blocked-card .card-head {
    align-items: center;
}

.collector-due-blocked-body {
    padding: 22px 20px 24px;
    text-align: center;
}

.collector-due-blocked-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fffbeb;
    color: #d97706;
}

.collector-due-blocked-icon svg {
    width: 24px;
    height: 24px;
}

.collector-due-blocked-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.collector-due-blocked-text {
    margin: 0 auto;
    max-width: 34rem;
    font-size: 14px;
    line-height: 1.55;
    color: #64748b;
}

.collector-due-blocked-text strong {
    color: #0f172a;
    font-weight: 700;
}

@media screen and (max-width: 640px) {
    .collector-due-blocked-body {
        padding: 18px 16px 20px;
    }

    .collector-due-blocked-title {
        font-size: 17px;
    }

    .collector-due-blocked-text {
        font-size: 14px;
    }
}

.pn-saved-card,
#saved-release-papers,
#saved-office-ledger-files,
#saved-paid-customer-ledgers,
#saved-client-attendance-files,
#due-customer-ledgers,
#lapse-customers-list,
#lapse-transfer-logs,
#centralized-paid-customers,
#centralized-due-accounts {
    scroll-margin-top: 16px;
}
.customer-ledger-jump {
    display: none;
}

.paid-ledger-flip,
.customer-ledger-jump.paid-ledger-flip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.paid-ledger-flip .customer-ledger-jump-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #d0d7e5;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
}

.paid-ledger-flip .customer-ledger-jump-link.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

body.customer-portal .paid-ledger-flip,
body.customer-portal .customer-ledger-jump.paid-ledger-flip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 12px;
    position: sticky;
    top: 56px;
    z-index: 40;
    background: #f0f2f7;
    padding: 6px 0 8px;
}

body.customer-portal .paid-ledger-flip .customer-ledger-jump-link {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

body.customer-portal .paid-ledger-flip .customer-ledger-jump-link.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.customer-scroll-hint {
    display: none;
}

body.customer-portal {
    overflow-x: hidden;
}

body.customer-portal .customer-topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    box-shadow: 0 1px 0 #e4e7ef;
}

body.customer-portal .customer-portal-main {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    min-width: 0;
    width: 100%;
}

body.customer-portal .office-ledger-card,
body.customer-portal .customer-due-ledger-card {
    scroll-margin-top: 72px;
}

body.customer-portal .ledger-table tbody td.ledger-pay-cell.is-latest-attendance {
    background: #eff6ff;
}

body.customer-portal #customer-latest-attendance,
body.customer-portal .customer-ledger-chrono-card.is-latest-attendance {
    scroll-margin-top: 88px;
}

.customer-ledger-chrono,
.customer-chrono-hint {
    display: none;
}

@media screen and (max-width: 720px) {
    body.customer-portal {
        background: #f0f2f7;
    }

    body.customer-portal .customer-portal-main {
        padding: 10px 10px max(24px, env(safe-area-inset-bottom));
    }

    body.customer-portal .customer-page-header,
    body.customer-portal .app-page-header.customer-page-header {
        display: none;
    }

    body.customer-portal .office-ledger-page-actions {
        display: none;
    }

    body.customer-portal .customer-topnav {
        display: none !important;
    }

    body.customer-portal .paid-ledger-flip,
    body.customer-portal .customer-ledger-jump,
    body.customer-portal .customer-ledger-jump.paid-ledger-flip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 0 0 12px;
        position: sticky;
        top: 52px;
        z-index: 40;
        background: #f0f2f7;
        padding: 8px 0 10px;
    }

    body.customer-portal .customer-ledger-jump-link,
    body.customer-portal .paid-ledger-flip .customer-ledger-jump-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid #cbd5e1;
        background: #fff;
        color: #1e3a8a;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        text-align: center;
    }

    body.customer-portal .customer-ledger-jump-link.is-active,
    body.customer-portal .paid-ledger-flip .customer-ledger-jump-link.is-active {
        background: #0f172a;
        border-color: #0f172a;
        color: #fff;
    }

    body.customer-portal .office-ledger-card,
    body.customer-portal .customer-due-ledger-card,
    body.customer-portal .customer-empty-card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 12px;
        overflow: hidden;
    }

    body.customer-portal .customer-send-money-card {
        margin: 0 0 12px;
        padding: 14px 12px 16px;
        border-radius: 12px;
    }

    body.customer-portal .customer-send-money-max {
        display: none;
    }

    body.customer-portal .customer-send-money-row {
        flex-wrap: wrap;
    }

    body.customer-portal .customer-send-money-row .ledger-input {
        flex: 1 1 8rem;
        min-height: 44px;
        font-size: 16px;
    }

    body.customer-portal .customer-send-money-row .btn {
        flex: 1 1 100%;
        min-height: 44px;
        justify-content: center;
    }

    body.customer-portal .ledger-sheet--customer,
    body.customer-portal .ledger-sheet--due,
    body.customer-portal .office-ledger-card .ledger-sheet,
    body.customer-portal .due-ledger-card .ledger-sheet {
        margin: 0;
        padding: 12px 10px 14px;
        border-radius: 12px;
        overflow: visible;
        min-width: 0;
        width: 100%;
    }

    body.customer-portal .ledger-title {
        font-size: 11px;
        line-height: 1.35;
        padding: 0 2px;
        word-break: break-word;
    }

    body.customer-portal .ledger-subtitle {
        font-size: 13px;
        margin-bottom: 10px;
        letter-spacing: 0.08em;
    }

    body.customer-portal .ledger-office-meta,
    body.customer-portal .ledger-due-meta {
        padding: 10px;
        gap: 8px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    body.customer-portal .ledger-office-meta-row,
    body.customer-portal .ledger-due-meta-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.customer-portal .ledger-office-label,
    body.customer-portal .ledger-due-label {
        font-size: 11px;
    }

    body.customer-portal .ledger-input,
    body.customer-portal .ledger-office-meta .ledger-input,
    body.customer-portal .ledger-due-meta .ledger-input {
        width: 100%;
        max-width: 100%;
        min-height: 40px;
        font-size: 16px;
        padding: 8px 10px;
    }

    body.customer-portal .ledger-office-inline {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    body.customer-portal .ledger-office-inline .ledger-input--rate,
    body.customer-portal .ledger-office-inline .ledger-input--terms {
        max-width: none;
        flex: 1 1 5rem;
    }

    body.customer-portal .ledger-office-field--accent .ledger-input,
    body.customer-portal .ledger-due-field--accent .ledger-input {
        font-size: 18px;
        font-weight: 800;
        color: #0f172a;
        background: #fff7ed;
        border-color: #fdba74;
    }

    body.customer-portal .customer-scroll-hint,
    body.customer-portal .due-ledger-card .ledger-table-wrap::before {
        display: none !important;
        content: none !important;
    }

    body.customer-portal .ledger-table-wrap {
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    body.customer-portal .ledger-table tfoot tr.ledger-total-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.customer-portal .customer-empty-body {
        padding: 28px 18px;
    }

    body.customer-portal .customer-empty-body h2 {
        font-size: 1.15rem;
    }

    body.customer-portal .customer-empty-body p {
        font-size: 14px;
    }

    body.customer-portal .customer-due-ledger-card {
        margin-top: 14px;
    }

    body.customer-portal .alert {
        font-size: 13px;
        line-height: 1.45;
    }
}

/* Customer login — phone */
@media screen and (max-width: 480px) {
    .login-page {
        align-items: flex-start;
        padding: max(20px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
    }

    .login-card {
        padding: 26px 18px 22px;
        border-radius: 14px;
        max-width: 100%;
    }

    .login-logo {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }

    .login-logo .brand-name {
        font-size: 13px;
        line-height: 1.35;
    }

    .customer-login-kicker {
        text-align: center;
    }

    .customer-login-lead {
        text-align: center;
        font-size: 14px;
    }

    .login-field input {
        min-height: 48px;
        font-size: 16px !important;
    }

    #access_code {
        min-height: 48px;
        font-size: 18px !important;
    }

    .login-btn {
        min-height: 48px;
        font-size: 16px;
        width: 100%;
    }
}


/* -- User Management ----------------------------------------- */
.user-management-page .um-hero {
    align-items: flex-end;
    gap: 16px 24px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.user-management-page .um-hero-kicker {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.user-management-page .um-hero h1 {
    margin: 0;
    letter-spacing: -0.02em;
}

.user-management-page .um-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.user-management-page .um-hero-role {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1e3a5f;
    background: #e8f0fe;
    border: 1px solid #bfdbfe;
}

.user-management-page .um-hero-stat {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.user-management-page .um-section-label {
    margin: 8px 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.user-management-page .um-card {
    margin-bottom: 20px;
    border-color: #d7e0ec;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.user-management-page .um-card .card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.user-management-page .um-card-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-management-page .um-card-title > span:first-child {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.user-management-page .um-card-sub {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.user-management-page .um-alert {
    margin: 0 0 16px;
}

.user-management-page .um-temp-pass {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #86efac;
    background: #f0fdf4;
}

.user-management-page .um-temp-pass-note {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #166534;
}

.user-management-page .um-temp-pass-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.user-management-page .um-temp-pass-code {
    flex: 1;
    min-width: 12rem;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    background: #fff;
    font-size: 14px;
    letter-spacing: 0.04em;
    word-break: break-all;
    color: #14532d;
}

.user-management-page .um-form .form-grid,
.user-management-page .um-form .form-actions {
    padding-left: 20px;
    padding-right: 20px;
}

.user-management-page .um-form .form-actions {
    padding-bottom: 18px;
}

.user-management-page .um-form-hint,
.user-management-page .um-folder-hint {
    margin: 0 20px 12px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.user-management-page .um-folder-hint {
    margin: 12px 12px 0;
}

.user-management-page .um-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.user-management-page .um-inline-note {
    margin: 0;
    padding: 16px 20px 20px;
    font-size: 14px;
    color: #64748b;
}

.user-management-page .um-directory-body {
    padding: 12px 16px 16px;
}

.user-management-page .um-empty-search {
    padding: 8px 4px 14px;
    margin: 0;
}

.user-management-page .um-folders {
    gap: 10px;
}

.user-management-page .um-folder {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.user-management-page .um-folder > .ca-collector-folder-head {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid transparent;
}

.user-management-page .um-folder[open] > .ca-collector-folder-head {
    border-bottom-color: #e2e8f0;
}

.user-management-page .um-folder-body {
    background: #fff;
}

.user-management-page .um-panel-form {
    padding: 14px 12px;
}

.user-management-page .um-panel-form--split {
    border-top: 1px solid #e2e8f0;
}

.user-management-page .um-logo-preview {
    display: flex;
    align-items: center;
    min-height: 72px;
}

.user-management-page .um-logo-preview img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 5px;
    background: #fff;
}

.user-management-page .um-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.user-management-page .um-inline-form--stack {
    align-items: flex-end;
}

.user-management-page .um-action-form {
    display: inline-flex;
    margin: 0;
}

.user-management-page .um-actions-cell {
    min-width: 280px;
}

.user-management-page .um-actions-cell .um-action-form {
    margin-top: 6px;
}

.user-management-page .um-inline-input,
.user-management-page .um-inline-select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #0f172a;
    background: #fff;
}

.user-management-page .um-inline-input {
    min-width: 10rem;
    flex: 1;
    max-width: 16rem;
    font-weight: 600;
}

.user-management-page .um-inline-input--user {
    max-width: 14rem;
    font-weight: 500;
}

.user-management-page .um-inline-input--pass {
    min-width: 160px;
    max-width: 180px;
    flex: 0 1 auto;
    font-weight: 400;
}

.user-management-page .um-inline-select {
    min-width: 8rem;
    max-width: 12rem;
    font-size: 12px;
    padding: 0 6px;
}

.user-management-page .um-inline-select--wide {
    min-width: 140px;
    max-width: 180px;
}

.user-management-page .um-strong {
    font-weight: 600;
    color: #0f172a;
}

.user-management-page .um-muted {
    font-size: 12px;
}

.user-management-page .um-code {
    font-size: 12px;
    word-break: break-all;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.user-management-page .um-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    border: 1px solid transparent;
}

.user-management-page .um-role-badge--owner {
    color: #1e3a5f;
    background: #dbeafe;
    border-color: #93c5fd;
}

.user-management-page .um-role-badge--manager {
    color: #5b21b6;
    background: #ede9fe;
    border-color: #c4b5fd;
}

.user-management-page .um-role-badge--secretary {
    color: #164e63;
    background: #cffafe;
    border-color: #67e8f9;
}

.user-management-page .um-role-badge--collector {
    color: #854d0e;
    background: #fef3c7;
    border-color: #fcd34d;
}

.user-management-page .um-role-badge--customer {
    color: #334155;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.user-management-page .um-add-card .field select {
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    width: 100%;
}

@media (max-width: 768px) {
    .user-management-page .um-hero {
        align-items: flex-start;
    }

    .user-management-page .um-hero-meta {
        justify-content: flex-start;
    }

    .user-management-page .um-card .card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .user-management-page .um-actions-cell {
        min-width: 0;
    }
}

/* ── Ops browse (Saved CA + Due Customers) ─────────────────── */
.ops-browse-page .sca-hero {
    align-items: flex-end;
    gap: 16px 24px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.ops-browse-page .sca-hero-kicker {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.ops-browse-page .sca-hero h1 {
    margin: 0;
    letter-spacing: -0.02em;
}

.ops-browse-page .sca-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ops-browse-page .sca-hero-stat {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.ops-browse-page .sca-hero-stat--pending {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.ops-browse-page .sca-hero-stat--received {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.ops-browse-page .sca-pending-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #fde68a;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.ops-browse-page .sca-pending-banner strong {
    display: block;
    font-size: 13px;
    color: #92400e;
}

.ops-browse-page .sca-pending-banner span {
    font-size: 12px;
    color: #a16207;
}

.ops-browse-page .sca-pending-banner-hint {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
}

.ops-browse-page .sca-section-label {
    margin: 4px 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.ops-browse-page .sca-card {
    margin-bottom: 20px;
    border-color: #d7e0ec;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ops-browse-page .sca-card .card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.ops-browse-page .sca-card-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ops-browse-page .sca-card-title > span:first-child {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.ops-browse-page .sca-card-sub {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.ops-browse-page .sca-table-wrap {
    border-radius: 0 0 10px 10px;
}

.ops-browse-page .sca-table thead th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ops-browse-page .sca-collector-name {
    font-weight: 600;
    color: #0f172a;
}

.ops-browse-page .sca-ref-no {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.ops-browse-page .sca-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.ops-browse-page .sca-updated {
    font-size: 12.5px;
    color: #64748b;
    white-space: nowrap;
}

.ops-browse-page .sca-dash,
.ops-browse-page .sca-no-file {
    color: #94a3b8;
    font-size: 13px;
}

.ops-browse-page .sca-row--empty td {
    background: #fcfcfd;
}

.ops-browse-page .sca-row--received td {
    background: #f8fffb;
}

.ops-browse-page .sca-empty {
    padding: 16px 20px;
    margin: 0;
}

.ops-browse-page .sca-empty-state {
    padding: 36px 24px;
    text-align: center;
}

.ops-browse-page .sca-empty-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.ops-browse-page .sca-empty-text {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.ops-browse-page .sca-pair-nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 14px;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.ops-browse-page .sca-pair-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border: 1px solid transparent;
}

.ops-browse-page .sca-pair-link.is-active {
    color: #0f172a;
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ops-browse-page .sca-pair-link.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ops-browse-page .sca-pair-link:not(.is-active):not(.is-disabled):hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.ops-browse-page .sca-folders {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ops-browse-page .sca-folder.sca-folder--glow {
    border-color: #f59e0b;
    animation: sca-folder-glow 1.6s ease-in-out infinite;
}

.ops-browse-page .sca-folder.sca-folder--glow > .ca-collector-folder-head {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.sca-folder-notif {
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

@keyframes sca-folder-glow {
    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35), 0 0 10px rgba(245, 158, 11, 0.35);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.55), 0 0 22px rgba(251, 191, 36, 0.7);
    }
}

.ops-browse-page .sca-folder > .ca-collector-folder-head {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.ops-browse-page .sca-folder[open] > .ca-collector-folder-head {
    border-bottom: 1px solid #e2e8f0;
}

.ops-browse-page .sca-customer-name {
    font-weight: 600;
    color: #0f172a;
}

@media (max-width: 768px) {
    .ops-browse-page .sca-hero {
        align-items: flex-start;
        text-align: left;
    }

    .ops-browse-page .sca-hero-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .ops-browse-page .sca-card .card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .ops-browse-page .sca-pending-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .ops-browse-page .central-filter-form {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ops-browse-page .central-filter-form label,
    .ops-browse-page .central-filter-form input,
    .ops-browse-page .central-filter-form select,
    .ops-browse-page .central-filter-form .btn-sm {
        width: 100%;
        min-height: 42px;
    }

    .ops-browse-page .sca-table-wrap,
    .ops-browse-page .ca-collector-folder-table-wrap {
        overflow: visible;
    }

    .ops-browse-page .sca-table thead {
        display: none;
    }

    .ops-browse-page .sca-table,
    .ops-browse-page .sca-table tbody,
    .ops-browse-page .sca-table tr,
    .ops-browse-page .sca-table td {
        display: block;
        width: 100%;
        border: 0;
    }

    .ops-browse-page .sca-table tr {
        margin: 0 0 10px;
        padding: 12px 14px;
        background: #fff;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .ops-browse-page .sca-table td[data-label] {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        padding: 6px 0;
        font-size: 14px;
    }

    .ops-browse-page .sca-table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 42%;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #64748b;
    }

    .ops-browse-page .sca-table td:first-child {
        font-size: 15px;
        font-weight: 700;
        padding-bottom: 8px;
        margin-bottom: 2px;
        border-bottom: 1px solid #e5e7eb;
    }

    .ops-browse-page .sca-table td:first-child::before {
        display: none;
    }

    .ops-browse-page .sca-table td.file-actions {
        flex-direction: column;
        align-items: stretch;
        padding-top: 10px;
        border-bottom: 0;
    }

    .ops-browse-page .sca-table td.file-actions::before {
        display: none;
    }

    .ops-browse-page .sca-table td.file-actions .btn-sm {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }

    .ops-browse-page .sca-table td[colspan] {
        display: block;
        padding: 8px 0 0;
        color: #64748b;
    }

    .mobile-sheet-cards .app-sheet-card .card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-sheet-cards .app-page-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-sheet-cards .app-page-actions .btn-sm,
    .mobile-sheet-cards .app-page-actions .btn,
    .mobile-sheet-cards .app-page-actions button {
        flex: 1 1 auto;
        min-height: 40px;
        justify-content: center;
        text-align: center;
    }

    .mobile-sheet-cards .sca-pair-nav {
        width: 100%;
    }

    .mobile-sheet-cards .sca-pair-link {
        flex: 1 1 0;
        text-align: center;
    }

    .main {
        padding-bottom: 88px;
    }
}

/* In-app chat */
.app-chat-fab {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 9000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 16px 0 14px;
    border: 0;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.35);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

.app-chat-fab:hover {
    background: #1e40af;
}

body.app-chat-open .app-chat-fab {
    display: none;
}

.app-chat-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
}

.app-chat-panel {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(76px, calc(16px + env(safe-area-inset-bottom) + 52px));
    z-index: 9001;
    width: min(390px, calc(100vw - 24px));
    height: min(580px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    font-family: inherit;
    animation: appChatSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.app-chat-panel[hidden] {
    display: none !important;
}

/* Header */
.app-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-chat-head-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.app-chat-head-text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-chat-head-text strong {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f8fafc;
}

.app-chat-head-text span {
    font-size: 11px;
    line-height: 1.2;
}

.app-chat-back,
.app-chat-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.app-chat-back:hover,
.app-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-chat-back:active,
.app-chat-close:active {
    transform: scale(0.94);
}

/* Contacts View */
.app-chat-contacts {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #f8fafc;
}

.app-chat-contacts[hidden] {
    display: none !important;
}

/* Search Box */
.app-chat-search-wrap {
    padding: 10px 12px 8px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-chat-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.app-chat-search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
}

.app-chat-search-box input {
    width: 100%;
    height: 36px;
    padding: 0 30px 0 34px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

.app-chat-search-box input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.app-chat-search-clear {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: #cbd5e1;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-chat-search-clear:hover {
    background: #94a3b8;
    color: #fff;
}

/* Category Filter Tabs */
.app-chat-filter-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.app-chat-filter-tabs::-webkit-scrollbar {
    display: none;
}

.app-chat-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.app-chat-tab-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.app-chat-tab-btn.is-active {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.app-chat-tab-count {
    font-size: 10px;
    opacity: 0.85;
}

.app-chat-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
}

.app-chat-tab-btn.is-active .app-chat-tab-dot {
    background: #fef08a;
}

#appChatContacts {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

/* Section Header in All View */
.app-chat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.app-chat-sec-count {
    background: #cbd5e1;
    color: #1e293b;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
}

/* Contact Item */
.app-chat-person {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.app-chat-person:hover {
    background: #f0f7ff;
}

/* Contact Avatar */
.app-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.app-chat-avatar-lg {
    width: 54px;
    height: 54px;
    font-size: 18px;
    margin: 0 auto 12px;
}

.avatar-hq {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

.avatar-secretary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.avatar-ci {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.avatar-due {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
}

.avatar-customer {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

/* Main text area */
.app-chat-person-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.app-chat-person-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.app-chat-person-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-chat-person-time {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

.app-chat-person-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* Role Pills */
.app-chat-role-pill,
.app-chat-badge-pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-hq {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-secretary {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-ci {
    background: #fef3c7;
    color: #92400e;
}

.badge-due {
    background: #ffe4e6;
    color: #be123c;
}

.badge-customer {
    background: #dcfce7;
    color: #15803d;
}

.app-chat-person-preview {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.app-chat-no-msg {
    color: #94a3b8;
    font-style: italic;
}

.app-chat-unread-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Thread View */
.app-chat-thread {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #f8fafc;
}

.app-chat-thread[hidden] {
    display: none !important;
}

.app-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-chat-bubble {
    max-width: 80%;
    align-self: flex-start;
    padding: 9px 12px;
    border-radius: 14px 14px 14px 3px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.app-chat-bubble.is-mine {
    align-self: flex-end;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: #ffffff;
    border-radius: 14px 14px 3px 14px;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.app-chat-bubble p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.42;
    word-break: break-word;
}

.app-chat-bubble time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.7;
    text-align: right;
}

/* Empty Thread State */
.app-chat-empty-thread {
    margin: auto;
    text-align: center;
    padding: 24px 16px;
    color: #64748b;
}

.app-chat-empty-thread h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.app-chat-empty-thread p {
    margin: 0;
    font-size: 12.5px;
}

/* Empty List State */
.app-chat-empty {
    margin: auto;
    text-align: center;
    padding: 36px 20px;
    color: #94a3b8;
}

.app-chat-empty svg {
    margin-bottom: 8px;
    opacity: 0.6;
}

.app-chat-empty p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

/* Loading state */
.app-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 10px;
    font-size: 13px;
    color: #64748b;
}

.app-chat-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: appChatSpin 0.7s linear infinite;
}

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

/* Compose Bar */
.app-chat-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.app-chat-compose input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 13.5px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

.app-chat-compose input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.app-chat-send-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #1d4ed8;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.app-chat-send-btn:hover {
    background: #1e40af;
}

.app-chat-send-btn:active {
    transform: scale(0.92);
}

.app-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media screen and (max-width: 720px) {
    .app-chat-panel {
        inset: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        padding-top: env(safe-area-inset-top);
        animation: none;
    }

    .app-chat-fab {
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .app-chat-compose {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .app-chat-compose input,
    .app-chat-search-box input {
        font-size: 15px;
        min-height: 42px;
    }

    .app-chat-send-btn {
        width: 42px;
        height: 42px;
    }

    .app-chat-person {
        padding: 12px 14px;
        min-height: 58px;
    }

    body.app-chat-open {
        overflow: hidden;
    }
}

@media print {
    .app-chat-fab,
    .app-chat-panel {
        display: none !important;
    }
}


