@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 260px;
    --brand-navy: #191970;
    --brand-navy-dark: #12134a;
    --brand-accent: #ff5a1f;
}

body {
    background: #f4f6fb;
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Brand-unified Bootstrap components */
.btn-primary {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: #22228f !important;
    border-color: #22228f !important;
}

.btn-outline-primary {
    color: var(--brand-navy);
    border-color: var(--brand-navy);
}

.btn-outline-primary:hover, .quick-amt.active {
    background: var(--brand-navy) !important;
    border-color: var(--brand-navy) !important;
    color: #fff !important;
}

a {
    color: #2b3cd8;
}

.breadcrumb-item a {
    text-decoration: none;
}

.table thead th {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a90a7;
    font-weight: 600;
    border-bottom-width: 1px;
}

.table tbody tr:hover {
    background: #f8f9fe;
}

/* Dashboard */
.stat-bubble {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.quick-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    background: #fff;
    border: 1px solid #eceef5;
    border-radius: 12px;
    padding: .85rem 1rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--brand-navy);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.quick-action i {
    color: var(--brand-accent);
    font-size: 1.15rem;
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(20, 20, 60, .1);
    border-color: var(--brand-accent);
    color: var(--brand-navy);
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--brand-navy);
    overflow-y: auto;
    z-index: 1030;
    transition: transform .2s ease-in-out;
}

.sidebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    padding: 1.25rem 1.25rem 0.25rem;
}

.sidebar-brand small {
    display: block;
    font-size: .7rem;
    font-weight: 400;
    color: #b9b9d8;
    letter-spacing: .04em;
}

.sidebar .nav-link {
    color: #d6d6ec;
    font-size: .92rem;
    font-weight: 500;
    padding: .65rem 1rem;
    margin: 2px 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: .65rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.3rem;
    text-align: center;
}

.nav-icon-badge {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, 0) 62%);
    box-shadow: 0 4px 12px -3px var(--glow), inset 0 1px 1px rgba(255, 255, 255, .3);
    transition: transform .18s ease, box-shadow .18s ease;
    opacity: 0;
    transform: scale(.5);
    animation: badge-pop .4s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

.nav-item:nth-child(1) .nav-icon-badge { animation-delay: .03s; }
.nav-item:nth-child(2) .nav-icon-badge { animation-delay: .09s; }
.nav-item:nth-child(3) .nav-icon-badge { animation-delay: .15s; }
.nav-item:nth-child(4) .nav-icon-badge { animation-delay: .21s; }
.nav-item:nth-child(5) .nav-icon-badge { animation-delay: .27s; }
.nav-item:nth-child(6) .nav-icon-badge { animation-delay: .33s; }
.nav-item:nth-child(7) .nav-icon-badge { animation-delay: .39s; }

@keyframes badge-pop {
    from { opacity: 0; transform: scale(.5); }
    to { opacity: 1; transform: none; }
}

.nav-icon-badge i {
    color: #fff;
    font-size: 1.05rem !important;
    width: auto !important;
}

.sidebar .nav-link:hover .nav-icon-badge {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 6px 16px -2px var(--glow), inset 0 1px 1px rgba(255, 255, 255, .35);
}

.sidebar .nav-link.active .nav-icon-badge {
    box-shadow: 0 6px 18px -2px var(--glow), inset 0 1px 1px rgba(255, 255, 255, .4);
}

@media (prefers-reduced-motion: reduce) {
    .nav-icon-badge { animation: none; opacity: 1; transform: none; }
}

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

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border-left-color: var(--brand-accent);
}

.sidebar .nav-children .nav-link {
    padding-left: 2.75rem;
    font-size: .85rem;
}

.sidebar .nav-toggle::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    margin-left: auto;
    font-size: .8rem;
    transition: transform .15s ease;
}

.sidebar .nav-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

/* ---------- Main area ---------- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper.no-sidebar {
    margin-left: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e6e8f0;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.wallet-chip {
    background: #eef0fb;
    border: 1px solid #d7dcf5;
    border-radius: 999px;
    padding: .35rem .9rem;
    font-weight: 700;
    color: var(--brand-navy);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.content-area {
    padding: 1.5rem;
    flex: 1;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
}

/* ---------- Pay-a-bill toolbar: sticky search + section quick-jump ---------- */
.category-toolbar {
    position: sticky;
    top: 62px;
    z-index: 900;
    background: #f4f6fb;
    padding: .6rem 0 .8rem;
    margin-bottom: .4rem;
}

.category-search { max-width: 460px; margin-bottom: .7rem; }

.section-jump { display: flex; flex-wrap: wrap; gap: .5rem; }

.section-chip {
    font-size: .82rem;
    font-weight: 600;
    color: var(--brand-navy);
    background: #fff;
    border: 1px solid #e4e6ef;
    border-radius: 999px;
    padding: .35rem .85rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.section-chip:hover {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
}

.section-head { scroll-margin-top: 90px; }

.scroll-top-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--brand-navy);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 6px 18px rgba(20, 20, 60, .25);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, background .15s ease;
    z-index: 1000;
}

.scroll-top-btn.show { opacity: 1; transform: none; pointer-events: auto; }
.scroll-top-btn:hover { background: var(--brand-accent); }

@keyframes tile-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.reveal-tile { animation: tile-in .4s ease both; }
.category-grid .reveal-tile:nth-child(2) { animation-delay: .03s; }
.category-grid .reveal-tile:nth-child(3) { animation-delay: .06s; }
.category-grid .reveal-tile:nth-child(4) { animation-delay: .09s; }
.category-grid .reveal-tile:nth-child(5) { animation-delay: .12s; }
.category-grid .reveal-tile:nth-child(n+6) { animation-delay: .15s; }

@media (prefers-reduced-motion: reduce) {
    .reveal-tile { animation: none; }
}

/* ---------- Bill Payments big icon grid ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.5rem;
}

.category-tile {
    background: #fff;
    border-radius: 10px;
    padding: 2.4rem 1rem 1.8rem;
    text-align: center;
    text-decoration: none;
    border: 1px solid #e4e6ef;
    box-shadow: 0 2px 6px rgba(20, 20, 60, .04);
    transition: transform .15s ease, box-shadow .15s ease;
    display: block;
}

.category-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(20, 20, 60, .12);
}

.category-icon {
    width: 86px;
    height: 86px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.1rem;
    font-size: 2.6rem;
    line-height: 1;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, 0) 60%);
    box-shadow: 0 8px 20px -6px var(--glow), inset 0 2px 2px rgba(255, 255, 255, .3);
    transition: transform .2s ease, box-shadow .2s ease;
}

.category-icon i { color: #fff; }

.category-tile:hover .category-icon {
    transform: scale(1.07) rotate(-2deg);
    box-shadow: 0 12px 26px -6px var(--glow), inset 0 2px 2px rgba(255, 255, 255, .35);
}

.category-tile .category-name {
    font-weight: 500;
    font-size: 1.05rem;
    color: #2b3cd8;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eceef5;
    padding: 1.25rem;
}

/* Colored card header bars (payment flow) */
.card-topbar {
    margin: -1.25rem -1.25rem 1.25rem;
    padding: .95rem 1.25rem;
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(100deg, var(--brand-navy) 0%, #2d2a7a 100%);
}

.card-topbar h5 {
    color: #fff;
    margin: 0;
    font-weight: 700;
}

.card-topbar.topbar-success { background: linear-gradient(100deg, #157347 0%, #1d8f4e 100%); }
.card-topbar.topbar-danger { background: linear-gradient(100deg, #b02a37 0%, #d9414e 100%); }
.card-topbar.topbar-warning { background: linear-gradient(100deg, #b3810b 0%, #d9a40b 100%); }

.bc-chip {
    background: #fff;
    border-radius: 8px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
}

/* Provider selection */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.provider-tile {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: #fff;
    border: 1px solid #e4e6ef;
    border-radius: 12px;
    padding: .9rem 1rem;
    font-weight: 600;
    font-size: .93rem;
    color: #2b2b3d;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: provider-in .35s ease forwards;
}

.provider-grid .provider-tile:nth-child(1) { animation-delay: .02s; }
.provider-grid .provider-tile:nth-child(2) { animation-delay: .05s; }
.provider-grid .provider-tile:nth-child(3) { animation-delay: .08s; }
.provider-grid .provider-tile:nth-child(4) { animation-delay: .11s; }
.provider-grid .provider-tile:nth-child(n+5) { animation-delay: .14s; }

@keyframes provider-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.provider-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(20, 20, 60, .12);
    border-color: var(--brand-accent);
    color: #2b2b3d;
}

.provider-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, 0) 60%);
    box-shadow: 0 3px 10px -3px var(--glow, rgba(20, 20, 60, .3)), inset 0 1px 1px rgba(255, 255, 255, .3);
    transition: transform .18s ease;
}

.provider-logo {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eceef5;
    padding: 6px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(20, 20, 60, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.provider-monogram {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .02em;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, 0) 60%);
    box-shadow: 0 3px 10px -3px var(--glow), inset 0 1px 1px rgba(255, 255, 255, .3);
    transition: transform .18s ease;
}

.provider-tile:hover .provider-logo {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(20, 20, 60, .12);
}

.provider-tile:hover .provider-monogram,
.provider-tile:hover .provider-icon {
    transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
    .provider-tile { animation: none; opacity: 1; transform: none; }
}

.quick-amt.active {
    background: var(--brand-navy);
    color: #fff;
}

/* Print only the receipt content */
@media print {
    .sidebar, .topbar, .receipt-actions, .alert .btn-close {
        display: none !important;
    }
    .main-wrapper { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    .stat-card { border: none; box-shadow: none; }
}
