/* MG Agent portal theme (PFG Money brand red #c4171b). */
:root {
    --brand: #c4171b;
    --brand-dark: #9e1216;
    --brand-soft: #fdecec;
    --ink: #2b2f33;
    --muted-bg: #f4f5f7;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    color: var(--ink);
    background: var(--muted-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.text-brand { color: var(--brand) !important; }

.brand-logo { height: 44px; width: auto; }

/* Buttons */
.btn-brand, .btn-brand:disabled {
    color: #fff;
    background-color: var(--brand);
    border-color: var(--brand);
}
.btn-brand:hover, .btn-brand:focus, .btn-brand:active {
    color: #fff;
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}
.btn-brand:focus { box-shadow: 0 0 0 .2rem rgba(196, 23, 27, .35); }

input[type="date"] { cursor: pointer; }

.form-control:focus, .form-select:focus {
    border-color: #e58a8c;
    box-shadow: 0 0 0 .2rem rgba(196, 23, 27, .15);
}

/* Header */
.navbar .nav-link { font-weight: 500; color: #4a4f55; }
.navbar .nav-link.active, .navbar .nav-link:hover { color: var(--brand) !important; }
.subbar { background: #3a3f44; }
.subbar .agent-switch { min-width: 16rem; max-width: 28rem; }
#refNo { width: 15rem; }

/* Cards and tabs */
.page-card { border: 0; border-radius: .5rem; overflow: hidden; }
.page-card > .card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 3px solid var(--brand);
    padding: .85rem 1.25rem;
}
.page-card > .card-header .fa { color: var(--brand); margin-right: .35rem; }

.brand-tabs { border-bottom: 0; padding: .5rem .75rem 0; background: #fff; flex-wrap: wrap; }
.brand-tabs .nav-link {
    color: #555;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: .75rem 1rem;
    display: inline-flex;
    gap: .5rem;
    align-items: center;
}
.brand-tabs .nav-link .fa { font-size: 1.1rem; }
.brand-tabs .nav-link:hover { color: var(--brand); }
.brand-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; font-weight: 600; }

.tab-intro { color: #666; margin-bottom: 1.25rem; }

/* Reports */
.report-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.report-zoom-label { min-width: 4rem; font-variant-numeric: tabular-nums; }
.report-pages {
    height: 80vh; min-height: 32rem; overflow: auto; padding: 1rem;
    background: #525659; border-radius: .375rem;
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.report-page { flex: none; background: #fff; box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .35); }

/* Profile / documents / payments */
.doc-category { color: var(--brand); border-bottom: 2px solid #eee; padding-bottom: .4rem; }
.doc-link { display: inline-flex; gap: .75rem; align-items: center; text-decoration: none; color: var(--ink); }
.doc-link:hover span { text-decoration: underline; color: var(--brand); }
.payid-banner { text-align: center; font-size: 1.4rem; color: var(--brand-dark); font-weight: 300; margin-bottom: 1.5rem; }
.payid-banner span { font-weight: 500; }
.note-box { background: #fff7e6; border: 1px solid #f3dcae; border-radius: .375rem; padding: .75rem 1rem; }
.policy-box { background: var(--muted-bg); border-radius: .5rem; padding: 1rem 1.25rem; }
.accordion-button:not(.collapsed) { color: var(--brand-dark); background: var(--brand-soft); }
.accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(196, 23, 27, .15); }

/* Login */
.auth-body { background: linear-gradient(135deg, #3a3f44 0%, #1f2326 60%, var(--brand-dark) 140%); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 26rem; border: 0; border-radius: .75rem; }

/* Busy overlay */
.busy-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, .35);
    display: flex; align-items: center; justify-content: center;
}
.busy-overlay.d-none { display: none !important; }

/* Profile */
.profile-hero { border: 0; border-radius: .5rem; border-top: 4px solid var(--brand); }
.profile-avatar {
    width: 4.5rem; height: 4.5rem; flex: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-dark);
    font-size: 1.6rem; font-weight: 600; letter-spacing: .02em;
}
.profile-name { font-size: 1.5rem; font-weight: 600; margin: 0 0 .15rem; overflow-wrap: anywhere; }
.id-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .2rem .65rem; border-radius: 999px;
    background: var(--muted-bg); border: 1px solid #e3e5e8;
    font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.id-chip > span { font-weight: 400; color: #6c757d; }
.profile-quick a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.profile-quick a:hover { color: var(--brand); }
.profile-quick .fa { color: var(--brand); }

.stat-tile { border: 0; border-radius: .5rem; }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.stat-label .fa { color: var(--brand); }
.stat-value { font-size: 1.5rem; font-weight: 600; margin-top: .25rem; font-variant-numeric: tabular-nums; }

.detail-card { border: 0; border-radius: .5rem; }
.detail-card > .card-header { background: #fff; font-weight: 600; padding: .85rem 1.25rem; border-bottom: 1px solid #eceef0; }
.detail-card > .card-header .fa { color: var(--brand); margin-right: .4rem; width: 1rem; text-align: center; }
.detail-list .detail-row { display: flex; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed #eceef0; }
.detail-list .detail-row:last-child { border-bottom: 0; }
.detail-list dt { flex: 0 0 38%; font-weight: 400; color: #6c757d; }
.detail-list dd { flex: 1; margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.detail-list address { font-style: normal; }
.profile-footnote { color: #6c757d; font-size: .9rem; margin: 1.5rem 0 0; text-align: center; }

/* Change password */
.password-page { max-width: 60rem; margin: 0 auto; }
.password-group .input-group-text { background: #fff; color: #6c757d; }
.password-rules li { padding: .3rem 0; color: #6c757d; transition: color .15s; }
.password-rules li.met { color: #198754; }
.password-rules li .fa { margin-right: .25rem; }
.password-match { min-height: 1.25rem; margin-top: -.5rem; }

/* Transaction details popup */
.txn-modal { border: 0; border-radius: .6rem; overflow: hidden; }
.txn-modal .modal-header { border-bottom: 3px solid var(--brand); }
.txn-modal .modal-title { font-weight: 600; }
.txn-modal .modal-body { background: var(--muted-bg); }
.txn-modal-icon {
    width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand);
}
.txn-card { --tone: #6c757d; --tone-soft: #f1f3f5; background: #fff; border-radius: .5rem; border-left: 4px solid var(--tone); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.txn-card.txn-send { --tone: var(--brand); --tone-soft: var(--brand-soft); }
.txn-card.txn-receive { --tone: #198754; --tone-soft: #e8f5ee; }
.txn-card.txn-reversal { --tone: #b7791f; --tone-soft: #fdf3e1; }
.txn-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid #eceef0; }
.txn-type { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; background: var(--tone-soft); color: var(--tone); font-weight: 600; font-size: .85rem; }
.txn-code { font-weight: 400; opacity: .75; margin-left: .25rem; }
.txn-meta { color: #6c757d; font-size: .875rem; margin-top: .4rem; }
.txn-amount { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .25rem 1.5rem; padding: .75rem 1.25rem 1rem; margin: 0; }
.txn-item { padding: .4rem 0; }
.txn-item dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; color: #6c757d; }
.txn-item dd { margin: .1rem 0 0; font-weight: 500; overflow-wrap: anywhere; }
.txn-copy { color: #6c757d; line-height: 1; vertical-align: baseline; }
.txn-copy:hover { color: var(--brand); }

@media print {
    body.modal-open > *:not(#txnModal) { display: none !important; }
    #txnModal { position: static; }
    #txnModal .modal-dialog { max-width: none; margin: 0; }
    #txnModal .modal-footer, #txnModal .btn-close, .txn-copy { display: none !important; }
    #txnModal .modal-body { background: #fff; overflow: visible; }
}

/* Home */
.home-welcome { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.home-title { font-size: 1.6rem; font-weight: 600; margin: 0 0 .25rem; overflow-wrap: anywhere; }
.home-subtitle { color: #6c757d; }
.home-subtitle .fa { color: var(--brand); }

.home-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.home-tabs .home-tab {
    display: flex; align-items: center; gap: .9rem; text-align: left;
    padding: 1rem 1.15rem; background: #fff; color: var(--ink);
    border: 1px solid #e6e8eb; border-radius: .6rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.home-tabs .home-tab:hover { border-color: #e9a5a7; box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06); transform: translateY(-1px); color: var(--ink); }
.home-tabs .home-tab.active { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(196, 23, 27, .12); background: #fff; color: var(--ink); }
.home-tab-icon {
    width: 2.75rem; height: 2.75rem; flex: none; border-radius: .6rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--muted-bg); color: #6c757d; font-size: 1.2rem; transition: background .15s, color .15s;
}
.home-tab.active .home-tab-icon, .home-tab:hover .home-tab-icon { background: var(--brand-soft); color: var(--brand); }
.home-tab-text { display: flex; flex-direction: column; min-width: 0; }
.home-tab-title { font-weight: 600; }
.home-tab-desc { font-size: .85rem; color: #6c757d; }

.filter-bar { background: var(--muted-bg); border-radius: .5rem; padding: 1rem 1.25rem 1.15rem; }
.filter-bar .form-label { font-size: .85rem; font-weight: 500; color: #555; }
.btn-chip { background: #fff; border: 1px solid #dee2e6; border-radius: 999px; color: #555; padding: .3rem .8rem; }
.btn-chip:hover { border-color: #e9a5a7; color: var(--brand); }
.btn-chip.active, .btn-chip:active { background: var(--brand-soft) !important; border-color: var(--brand) !important; color: var(--brand-dark) !important; }

.report-empty {
    border: 2px dashed #e1e4e8; border-radius: .5rem; padding: 2.5rem 1rem;
    text-align: center; color: #6c757d;
}
.report-empty .fa { font-size: 2.25rem; color: #c9ced4; margin-bottom: .5rem; }
