/*
AFM Assembly Financial & Membership Management System
Blue, White and Gold Theme
*/

:root {
    --afm-blue: #1d4ed8;
    --afm-blue-dark: #1e3a8a;
    --afm-blue-light: #dbeafe;
    --afm-gold: #f59e0b;
    --afm-gold-dark: #b45309;
    --afm-white: #ffffff;
    --afm-bg: #f3f6fb;
    --afm-text: #1f2937;
    --afm-sidebar-width: 260px;
    --afm-sidebar-collapsed-width: 76px;
}

body.afm-body {
    background: var(--afm-bg);
    color: var(--afm-text);
    font-family: Arial, Helvetica, sans-serif;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--afm-sidebar-width);
    min-width: var(--afm-sidebar-width);
    background: linear-gradient(180deg, var(--afm-blue-dark), var(--afm-blue));
    color: var(--afm-white);
    transition: all 0.2s ease;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 3px;
}

.sidebar-brand i {
    font-size: 1.8rem;
    color: var(--afm-gold);
}

.sidebar-title {
    font-weight: 700;
}

.sidebar-menu {
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-link.active {
    background: var(--afm-gold);
    color: #111827;
    font-weight: 700;
}

.sidebar-collapsed .sidebar {
    width: var(--afm-sidebar-collapsed-width);
    min-width: var(--afm-sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .sidebar-brand div {
    display: none;
}

.main-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--afm-white);
    border-bottom: 1px solid #dbe3f0;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.global-search input {
    min-width: 320px;
}

.content {
    padding: 18px;
}

.page-title {
    margin-bottom: 18px;
}

.card {
    border: 0;
    border-radius: 16px;
}

.card-header {
    background: #fff;
    font-weight: 700;
    border-bottom: 1px solid #e5eaf3;
    border-radius: 16px 16px 0 0 !important;
}

.stat-card {
    border-left: 6px solid var(--afm-blue);
}

.stat-card small {
    color: #6b7280;
}

.stat-blue {
    border-left-color: var(--afm-blue);
}

.stat-red {
    border-left-color: #dc2626;
}

.stat-gold {
    border-left-color: var(--afm-gold);
}

.stat-green {
    border-left-color: #16a34a;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.92), rgba(30, 58, 138, 0.95)),
        #111827;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    border-radius: 20px;
}

.login-icon {
    font-size: 2.8rem;
    color: var(--afm-gold);
}

.member-photo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 14px;
    border: 3px solid var(--afm-gold);
}

.receipt-card {
    max-width: 860px;
    margin: 0 auto;
}

.receipt-logo {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.badge.bg-gold-badge {
    background: var(--afm-gold);
    color: #111827;
}

.report-card {
    color: inherit;
    border: 1px solid #dbe3f0;
    transition: 0.15s ease;
}

.report-card:hover {
    border-color: var(--afm-blue);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.12);
}

.report-icon {
    font-size: 1.5rem;
    color: var(--afm-blue);
    margin-bottom: 8px;
    display: block;
}

/* Dark mode */
body.dark-mode {
    --afm-bg: #0f172a;
    --afm-white: #111827;
    --afm-text: #e5e7eb;
}

body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .topbar {
    background: #111827;
    color: #e5e7eb;
    border-color: #1f2937;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #0b1220;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .table {
    color: #e5e7eb;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    color: #e5e7eb;
}

body.dark-mode .dropdown-menu {
    background: #111827;
    border-color: #1f2937;
}

body.dark-mode .dropdown-item {
    color: #e5e7eb;
}

body.dark-mode .dropdown-item:hover {
    background: #1f2937;
}

body.dark-mode .breadcrumb-item a {
    color: #93c5fd;
}

body.dark-mode .login-body {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 58, 138, 0.9)),
        #020617;
}

body.dark-mode .login-card {
    background: #111827;
    color: #e5e7eb;
}

/* Print */
.print-body {
    background: #fff;
    color: #000;
}

.print-toolbar {
    padding: 12px;
    display: flex;
    gap: 8px;
}

.print-page {
    padding: 16px;
}

@media print {
    .no-print,
    .print-toolbar {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .app-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
    }

    .sidebar-collapsed .sidebar-link span,
    .sidebar-collapsed .sidebar-brand div {
        display: inline;
    }

    .global-search input {
        min-width: 180px;
    }
}

@media (max-width: 576px) {
    .topbar {
        flex-wrap: wrap;
    }

    .global-search {
        width: 100%;
    }

    .global-search input {
        min-width: 0;
        width: 100%;
    }
}