/* Paycheckmaster Central — brand tokens (change these to re-brand) */
:root {
    --pcm-primary: #157347;
    --pcm-primary-dark: #0f5132;
    --pcm-gold: #d4a017;
    --pcm-sidebar: #0b3d2a;
    --pcm-sidebar-hover: #13563b;
    --pcm-bg: #f4f6f5;
    --bs-primary: #157347;
    --bs-primary-rgb: 21, 115, 71;
    --bs-link-color: #157347;
    --bs-link-hover-color: #0f5132;
    --bs-link-color-rgb: 21, 115, 71;
}
body { background: var(--pcm-bg); font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: .925rem; }
.btn-primary { --bs-btn-bg: var(--pcm-primary); --bs-btn-border-color: var(--pcm-primary); --bs-btn-hover-bg: var(--pcm-primary-dark); --bs-btn-hover-border-color: var(--pcm-primary-dark); --bs-btn-active-bg: var(--pcm-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--pcm-primary); --bs-btn-border-color: var(--pcm-primary); --bs-btn-hover-bg: var(--pcm-primary); --bs-btn-hover-border-color: var(--pcm-primary); }
.btn-gold { background: var(--pcm-gold); color: #222; border-color: var(--pcm-gold); }
.btn-gold:hover { background: #b98a10; color: #fff; }
.text-gold { color: var(--pcm-gold) !important; }
.bg-purple { background-color: #6f42c1 !important; }
.form-control:focus, .form-select:focus { border-color: #5fb08a; box-shadow: 0 0 0 .2rem rgba(21,115,71,.2); }
.nav-tabs .nav-link.active { color: var(--pcm-primary-dark); border-top: 3px solid var(--pcm-gold); }
.nav-tabs .nav-link { color: #555; }
.page-link { color: var(--pcm-primary); }
.active > .page-link { background: var(--pcm-primary); border-color: var(--pcm-primary); }

/* Shell */
.pcm-shell { display: flex; min-height: 100vh; }
.pcm-sidebar { width: 250px; background: var(--pcm-sidebar); color: #cfe3d8; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s; }
.pcm-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.pcm-brand small { display: block; color: var(--pcm-gold); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.pcm-logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--pcm-gold), #f0c75e); color: var(--pcm-sidebar); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.pcm-nav { padding: .6rem .5rem 2rem; }
.pcm-nav a { display: flex; align-items: center; gap: .75rem; color: #cfe3d8; text-decoration: none; padding: .52rem .8rem; border-radius: 8px; margin-bottom: 2px; font-size: .88rem; }
.pcm-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.pcm-nav a:hover { background: var(--pcm-sidebar-hover); color: #fff; }
.pcm-nav a.active { background: rgba(212,160,23,.16); color: #fff; box-shadow: inset 3px 0 0 var(--pcm-gold); }
.pcm-main { flex: 1; margin-left: 250px; min-width: 0; display: flex; flex-direction: column; }
.pcm-topbar { background: #fff; display: flex; align-items: center; padding: .75rem 1.5rem; border-bottom: 1px solid #e5e9e7; position: sticky; top: 0; z-index: 1020; }
.pcm-content { padding: 1.5rem; flex: 1; }
.pcm-footer { padding: 1rem 1.5rem; }
.pcm-backdrop { display: none; }
@media (max-width: 991.98px) {
    .pcm-sidebar { transform: translateX(-100%); }
    .pcm-main { margin-left: 0; }
    body.nav-open .pcm-sidebar { transform: none; }
    body.nav-open .pcm-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1030; }
    .pcm-content { padding: 1rem; }
}

/* Cards */
.card { border: 1px solid #e5e9e7; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,20,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef1ef; font-weight: 600; border-radius: 12px 12px 0 0 !important; }
.stat-card { display: block; text-decoration: none; color: inherit; padding: 1rem 1.1rem; height: 100%; transition: transform .12s, box-shadow .12s; position: relative; overflow: hidden; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,20,.08); color: inherit; }
.stat-card .stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7a72; font-weight: 600; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin-top: .25rem; color: #17241d; }
.stat-card .stat-icon { position: absolute; right: .9rem; top: .9rem; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-card .stat-delta { font-size: .78rem; margin-top: .2rem; }
.ic-green { background: #e3f3ea; color: var(--pcm-primary); }
.ic-gold { background: #fbf2d9; color: #a67c00; }
.ic-red { background: #fbe4e6; color: #b02a37; }
.ic-blue { background: #e3eefc; color: #1f5fbf; }
.ic-purple { background: #ede5fa; color: #6f42c1; }
.ic-gray { background: #eceff1; color: #546e7a; }
.chart-box { position: relative; height: 260px; }

/* Tables */
.table-pcm { font-size: .86rem; }
.table-pcm thead th { background: #f7f9f8; color: #51605a; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; border-bottom: 1px solid #e5e9e7; }
.table-pcm td { vertical-align: middle; }
.table-responsive { border-radius: 0 0 12px 12px; }
.url-cell { max-width: 220px; }
.url-cell a { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.dot-online { background: #198754; box-shadow: 0 0 0 3px rgba(25,135,84,.18); }
.dot-offline { background: #dc3545; box-shadow: 0 0 0 3px rgba(220,53,69,.18); }
.dot-unknown { background: #adb5bd; }
.filters .form-select, .filters .form-control { font-size: .85rem; }

/* Client header */
.client-head { background: linear-gradient(120deg, var(--pcm-primary-dark), #157347 70%); color: #fff; border-radius: 14px; padding: 1.25rem 1.4rem; }
.client-head .meta { color: #cfe8db; font-size: .85rem; }
.client-head .meta strong { color: #fff; }
.client-head .btn-light { --bs-btn-bg: rgba(255,255,255,.95); }

/* Payment calendar */
.cal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
@media (max-width: 991.98px) { .cal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575.98px) { .cal-grid { grid-template-columns: repeat(2, 1fr); } }
.cal-month { border-radius: 12px; padding: .85rem .9rem; color: #fff; cursor: pointer; min-height: 112px; display: flex; flex-direction: column; position: relative; transition: transform .12s, box-shadow .12s; border: 0; text-align: left; }
.cal-month:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.cal-month .m-name { font-weight: 700; font-size: 1rem; }
.cal-month .m-status { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .95; font-weight: 600; }
.cal-month .m-amt { margin-top: auto; font-size: .8rem; opacity: .95; }
.cal-month .m-flag { position: absolute; top: .6rem; right: .7rem; font-size: .7rem; background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 10px; }
.cal-paid { background: #198754; }
.cal-unpaid { background: #dc3545; }
.cal-overdue { background: #b02a37; }
.cal-pending { background: #fd7e14; }
.cal-partial { background: #6f42c1; }
.cal-no_invoice { background: #adb5bd; color: #2b2f32; }
.cal-covered { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 8px, transparent 8px 16px); }
.cal-current { outline: 3px solid var(--pcm-gold); outline-offset: 2px; }
.legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

/* Misc */
.empty-state { text-align: center; padding: 3rem 1rem; color: #7a8a82; }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: .5rem; color: #b5c4bc; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .55rem 0 .55rem 1.4rem; border-left: 2px solid #e1e7e4; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: var(--pcm-primary); }
.timeline li.src-agent::before { background: var(--pcm-gold); }
.kv th { width: 38%; color: #6b7a72; font-weight: 500; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0b3d2a 0%, #157347 60%, #d4a017 140%); }
.login-card { width: 100%; max-width: 400px; }
pre.cronbox { background: #0f1a14; color: #c8f0d8; padding: .9rem; border-radius: 8px; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
.text-purple { color: #6f42c1 !important; }
.stat-card .stat-label { padding-right: 44px; }
@media (max-width: 575.98px) {
    .stat-card { padding: .8rem .85rem; }
    .stat-card .stat-value { font-size: 1.2rem; word-break: break-word; }
    .stat-card .stat-icon { width: 30px; height: 30px; font-size: .95rem; right: .6rem; top: .6rem; }
    .stat-card .stat-label { padding-right: 32px; font-size: .68rem; }
    .pcm-topbar h1 { font-size: 1rem; }
}
