/* Saranawimala Petty Cash — Maroon theme, compact layout */
:root {
    --bg: #f7f3f4;
    --surface: #ffffff;
    --surface-muted: #faf6f7;
    --surface-hover: #f3ecee;

    --text: #2a1216;
    --text-muted: #6b4f55;
    --text-soft: #9a8086;

    --border: #e8d8dc;
    --border-strong: #d4bcc2;

    --primary: #7a1f2b;
    --primary-hover: #5c151e;
    --primary-dark: #4a1219;
    --primary-soft: #f9ecee;
    --primary-rgb: 122, 31, 43;

    --success: #1f6b3f;
    --success-bg: #e8f5ec;
    --success-border: #b8dfc8;

    --danger: #b42318;
    --danger-bg: #fdecea;
    --danger-border: #f5c4c0;

    --warning: #9a6700;
    --warning-bg: #fff8e6;
    --warning-border: #f5e0a8;

    --sidebar-bg: #ffffff;
    --topbar-bg: linear-gradient(135deg, #5c1519 0%, #3d0e14 100%);
    --topbar-text: #ffffff;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;

    --shadow-xs: 0 1px 2px rgba(58, 18, 25, 0.05);
    --shadow-sm: 0 2px 8px rgba(58, 18, 25, 0.07);
    --shadow-md: 0 6px 18px rgba(58, 18, 25, 0.09);

    --transition: 0.18s ease;
    --container-width: 1200px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;

    /* Bootstrap 5 overrides */
    --bs-primary: #7a1f2b;
    --bs-primary-rgb: 122, 31, 43;
    --bs-link-color: #7a1f2b;
    --bs-link-hover-color: #5c151e;
    --bs-border-radius: 6px;
    --bs-border-radius-sm: 4px;
    --bs-body-font-size: 0.875rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition), background var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.875rem; }

.page-header {
    margin-bottom: var(--spacing-md);
}

.page-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

p {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
}

img {
    max-width: 100%;
    display: block;
}

/* Layout */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    padding: 0 16px;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar .brand {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.navbar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--topbar-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.12);
}

.layout {
    display: flex;
    min-height: calc(100vh - 52px);
}

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform var(--transition);
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8125rem;
}

.sidebar a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar a.active,
.sidebar .active-page {
    background: var(--primary);
    color: #fff !important;
}

.sidebar-footer {
    margin-top: auto;
    padding: 10px 8px 4px;
    border-top: 1px solid var(--border);
}

.orbygen-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.orbygen-brand img {
    height: 56px;
    width: auto;
}

.orbygen-brand span {
    font-size: 10px;
    color: var(--text-soft);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

.content {
    flex: 1;
    padding: 16px;
    width: 100%;
    max-width: 100%;
}

.content-inner {
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Cards */

.card,
.login-card,
.print-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--spacing-md);
}

.card > .card-body {
    padding: 14px 16px;
}

.stat-card {
    padding: 12px 14px;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .value,
.big-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.balance-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.25rem 0 0.5rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.form-card {
    margin-bottom: var(--spacing-md);
}

.panel-muted {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
}

.panel-muted .panel-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

/* Compact form helpers */

.form-compact .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-inline .form-label {
    flex: 0 0 110px;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.field-inline .form-control,
.field-inline .input-group {
    flex: 1;
    min-width: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
}

.total-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--primary-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 0.875rem;
}

.total-bar .total-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Login */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-body.glassmorphism {
    background: url('../images/loginimage.jpg') no-repeat center center fixed;
    background-size: cover;
}

.login-body.glassmorphism::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(45, 12, 18, 0.72);
    z-index: 1;
}

.login-body.glassmorphism .container {
    position: relative;
    z-index: 2;
}

.login-body.glassmorphism .login-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 28px 24px;
    max-width: 380px;
    width: 100%;
}

.login-body.glassmorphism .welcome-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.login-body.glassmorphism .sub-heading {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 20px;
}

.login-body.glassmorphism .form-label {
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-body.glassmorphism .form-control,
.login-body.glassmorphism .input-group-text {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.login-body.glassmorphism .input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.login-body.glassmorphism .input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.login-body.glassmorphism .form-control:focus {
    border-color: #c9a0a8;
    box-shadow: 0 0 0 3px rgba(122, 31, 43, 0.2);
}

.login-body.glassmorphism .btn-primary {
    background: linear-gradient(135deg, #7a1f2b 0%, #5c151e 100%);
    border: none;
    min-height: 38px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.login-body.glassmorphism .btn-primary:hover {
    background: linear-gradient(135deg, #5c151e 0%, #4a1219 100%);
}

.login-body.glassmorphism .alert {
    font-size: 0.8125rem;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* Portal staff sign-in — garden background with light cream card */

.login-body.portal-login-page {
    background: url('../images/portal-login-bg.png') no-repeat center center fixed;
    background-size: cover;
}

.login-body.portal-login-page::before {
    background: linear-gradient(180deg, rgba(60, 40, 15, 0.10) 0%, rgba(60, 30, 15, 0.22) 100%);
}

.login-body.portal-login-page .login-card {
    background: rgba(253, 249, 240, 0.72);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(201, 160, 110, 0.45);
    box-shadow: 0 18px 44px rgba(58, 34, 12, 0.28);
}

.login-body.portal-login-page .welcome-heading {
    color: var(--primary);
}

.login-body.portal-login-page .sub-heading {
    color: var(--text-muted);
}

.login-body.portal-login-page .form-label {
    color: var(--text);
}

.login-body.portal-login-page .form-control,
.login-body.portal-login-page .input-group-text {
    background: #fff;
    border: 1px solid #e2d5c2;
}

.login-body.portal-login-page .input-group-text {
    color: var(--primary);
    background: #faf4e8;
}

/* Landing page */

.landing-page .landing-panel {
    max-width: 720px;
    width: 100%;
}

.landing-page .portal-staff-panel {
    max-width: 960px;
}

.portal-staff-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 12px 16px;
}

.portal-staff-header-side {
    display: flex;
    align-items: flex-start;
    min-width: 0;
}

.portal-staff-header-start {
    justify-content: flex-start;
}

.portal-staff-header-end {
    justify-content: flex-end;
}

.portal-staff-header-center {
    justify-self: center;
    max-width: 100%;
}

.portal-staff-header-center .sub-heading {
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .portal-staff-header {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .portal-staff-header-side {
        justify-content: center;
        width: 100%;
    }

    .portal-staff-header-center {
        order: -1;
    }
}

.landing-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.landing-card {
    display: block;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 24px 20px;
    color: #fff;
    height: 100%;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.landing-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
    color: #fff;
}

.landing-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.95;
}

.landing-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.landing-card-desc {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    min-height: 2.5rem;
}

.landing-card-action {
    font-size: 0.875rem;
    font-weight: 600;
}

.landing-card-monk,
.landing-card-staff,
.landing-card-donor {
    border-color: rgba(255, 220, 225, 0.35);
}

.landing-card .landing-card-title {
    color: #fff;
}

/* Staff portal hub — also in portal.css; kept here for prod cache fallback */

.portal-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: linear-gradient(145deg, #4a1219 0%, #2d0c12 45%, #1a080c 100%);
}

.portal-hub {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid #e8d8dc;
}

.portal-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #7a1f2b 0%, #5c151e 100%);
    color: #fff;
}

.portal-hub-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.portal-hub-brand img {
    height: 26px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.portal-page .portal-hub-brand h1 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
}

.portal-page .portal-hub-brand h1 span {
    font-weight: 500;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.78);
    margin-left: 4px;
}

.portal-hub-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.portal-hub-username {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.portal-hub-signout {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.18s ease;
}

.portal-hub-signout:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.portal-hub-body {
    padding: 10px 12px 12px;
}

.portal-modules {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-module-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: #faf6f7;
    border: 1px solid #e8d8dc;
    border-radius: 6px;
    color: #2a1216;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.portal-module-card:hover {
    background: #ffffff;
    border-color: #d4bcc2;
    box-shadow: 0 1px 2px rgba(58, 18, 25, 0.05);
    color: #2a1216;
}

.portal-module-content {
    flex: 1;
    min-width: 0;
}

.portal-module-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-module-icon {
    font-size: 0.75rem;
    color: #7a1f2b;
    line-height: 1;
    flex-shrink: 0;
}

.portal-page .portal-module-title-row h2 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #4a1219;
    line-height: 1.2;
}

.portal-module-desc {
    margin: 2px 0 0 1.125rem;
    font-size: 0.75rem;
    color: #6b4f55;
    line-height: 1.25;
}

.portal-module-arrow {
    color: #9a8086;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: color 0.18s ease, transform 0.18s ease;
}

.portal-module-card:hover .portal-module-arrow {
    color: #7a1f2b;
    transform: translateX(2px);
}

@media (max-width: 400px) {
    .portal-hub-brand h1 span {
        display: none;
    }
}

/* Public forms (monk registration) — same maroon theme as petty cash */

.public-form-page {
    align-items: flex-start;
    padding-top: 24px;
    padding-bottom: 32px;
}

.public-form-page .public-form-container {
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.public-form-page .public-form-brand .landing-logo {
    height: 52px;
}

.public-form-page .form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.public-form-page .section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.public-form-page .section-title .text-muted,
.public-form-page .form-label .text-muted,
.public-form-page .form-check-label .text-muted {
    font-weight: 400;
    font-size: 0.8125rem;
}

.public-form-page .page-title-bilingual {
    line-height: 1.35;
}

.public-form-page .page-title-bilingual .text-muted {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    margin-top: 2px;
}

/* Maroon buttons — portal, monk registration, and public forms */

.btn-maroon,
.landing-page .btn-maroon,
.public-form-page .btn-maroon,
.public-form-page .btn-primary {
    background: linear-gradient(135deg, #7a1f2b 0%, #5c151e 100%);
    border: 1px solid #5c151e;
    color: #fff !important;
}

.btn-maroon:hover,
.btn-maroon:focus,
.landing-page .btn-maroon:hover,
.landing-page .btn-maroon:focus,
.public-form-page .btn-maroon:hover,
.public-form-page .btn-primary:hover,
.public-form-page .btn-maroon:focus,
.public-form-page .btn-primary:focus {
    background: linear-gradient(135deg, #5c151e 0%, #4a1219 100%);
    border-color: #4a1219;
    color: #fff !important;
}

.btn-maroon-outline,
.landing-page .btn-maroon-outline,
.public-form-page .btn-maroon-outline {
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(122, 31, 43, 0.45);
}

.btn-maroon-outline:hover,
.btn-maroon-outline:focus,
.landing-page .btn-maroon-outline:hover,
.landing-page .btn-maroon-outline:focus,
.public-form-page .btn-maroon-outline:hover,
.public-form-page .btn-maroon-outline:focus {
    color: #fff !important;
    background: linear-gradient(135deg, #7a1f2b 0%, #5c151e 100%);
    border-color: #7a1f2b;
}

.public-form-page .public-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.public-form-page .success-icon {
    font-size: 3rem;
    color: var(--primary);
}

.public-form-page .detail-list {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr;
    gap: 4px 12px;
    font-size: 0.8125rem;
}

.public-form-page .detail-list dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted);
}

.public-form-page .detail-list dd {
    margin: 0;
    color: var(--text);
}

.public-form-page .form-card .form-label,
.public-form-page .form-card .form-check-label {
    color: var(--text);
}

.public-form-page .form-card .form-control,
.public-form-page .form-card .form-select {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.public-form-page .form-card .form-control:focus,
.public-form-page .form-card .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.registration-record-page .registration-split .card {
    height: 100%;
}

/* Check-in page */

.checkin-card {
    border-top: 3px solid var(--primary);
}

.checkin-office-card {
    border-top-color: var(--primary-dark);
    background: var(--primary-soft);
}

.checkin-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.checkin-section-title .text-muted {
    font-weight: 400;
    font-size: 0.8125rem;
}

.checkin-consent-panel {
    background: var(--primary-soft);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
}

.checkin-consent-panel strong {
    color: var(--primary);
}

.registration-record-page .official-section-card {
    border-color: rgba(122, 31, 43, 0.25);
}

.content .detail-list {
    display: grid;
    grid-template-columns: minmax(120px, 38%) 1fr;
    gap: 2px 12px;
    font-size: 0.8125rem;
}

.content .detail-list dt {
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.content .detail-list dd {
    margin: 0;
}

/* Forms — compact defaults */

label.form-label {
    margin-bottom: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 0.875rem;
    border-color: var(--border-strong);
    border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.input-group-text {
    padding: 5px 10px;
    font-size: 0.8125rem;
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text-muted);
}

/* Buttons */

.btn {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
    transform: none;
    box-shadow: none;
}

.btn-sm {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-lg {
    min-height: 38px;
    padding: 8px 18px;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-secondary,
.btn-outline-secondary {
    font-weight: 600;
}

.text-primary {
    color: var(--primary) !important;
}

.alert-primary {
    background: var(--primary-soft);
    border-color: var(--border);
    color: var(--text);
}

.table-primary {
    --bs-table-bg: var(--primary-soft);
    --bs-table-color: var(--text);
}

/* Toolbar & tables */

.page-toolbar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-section {
    flex: 1;
    min-width: 200px;
}

.search-section .input-group .form-control {
    min-height: 34px;
}

.action-section {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 0;
}

.table {
    font-size: 0.8125rem;
    margin-bottom: 0;
    border-radius: var(--radius-md);
}

.table th,
.table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.table th {
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table .total-amount {
    font-weight: 700;
    color: var(--primary);
}

/* Badges & chips */

.badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    min-height: auto;
}

.badge.bg-secondary {
    background-color: var(--primary) !important;
}

.mode-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    min-height: 22px;
}

.mode-badge.mode-quick {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--border);
}

.fund-type-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    min-height: 22px;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    min-height: 20px;
}

/* Action buttons */

.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 30px;
    height: 30px;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.action-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
    transform: none;
}

.action-btn.action-signout {
    color: var(--maroon, #7b1e3a);
    border-color: rgba(123, 30, 58, 0.35);
}

.action-btn.action-signout:hover {
    background: rgba(123, 30, 58, 0.08);
    color: var(--maroon, #7b1e3a);
    border-color: var(--maroon, #7b1e3a);
}

.table-actions {
    gap: 6px;
}

.table-action-btn {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Alerts */

.alert {
    padding: 8px 12px;
    margin: 0 0 10px;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
}

.alert-danger {
    background: var(--danger-bg);
    color: #7f1d1d;
    border-color: var(--danger-border);
}

.alert-success {
    background: var(--success-bg);
    color: #14532d;
    border-color: var(--success-border);
}

/* Pagination */

.pagination a {
    min-width: 32px;
    min-height: 32px;
    padding: 4px 10px;
    font-size: 0.8125rem;
}

.active-page,
.pagination a.active-page {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.analytics-summary-cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.analytics-summary-cards .stat-period {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    margin: -2px 0 6px;
}

.analytics-widget .section-title {
    font-size: 1rem;
    margin-bottom: 0;
}

.analytics-chart-wrap {
    position: relative;
    height: 280px;
}

.badge.bg-maroon {
    background-color: var(--primary);
    color: #fff;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-widget {
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(122, 31, 43, 0.12);
    border-radius: 14px;
    padding: 16px 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 247, 0.98)),
        radial-gradient(circle at top right, rgba(122, 31, 43, 0.08), transparent 55%);
    box-shadow: 0 8px 24px rgba(60, 20, 28, 0.06);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-widget:hover,
.dashboard-widget.is-active {
    transform: translateY(-2px);
    border-color: rgba(122, 31, 43, 0.28);
    box-shadow: 0 12px 28px rgba(60, 20, 28, 0.1);
}

.dashboard-widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.35rem;
    color: #fff;
}

.dashboard-widget-residents .dashboard-widget-icon {
    background: linear-gradient(145deg, #7a1f2b, #a84858);
}

.dashboard-widget-approvals .dashboard-widget-icon {
    background: linear-gradient(145deg, #8b5a2b, #c49a6c);
}

.dashboard-widget-upcoming .dashboard-widget-icon {
    background: linear-gradient(145deg, #3d5a45, #6d8f78);
}

.dashboard-widget-body {
    min-width: 0;
}

.dashboard-widget-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dashboard-widget-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.dashboard-widget-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dashboard-panel .section-title {
    font-size: 1rem;
}

.dashboard-clickable-table tbody tr.dashboard-row-link {
    cursor: pointer;
}

.dashboard-clickable-table tbody tr.dashboard-row-link:hover {
    background-color: rgba(122, 31, 43, 0.05);
}

.dashboard-section-divider {
    border: 0;
    border-top: 1px solid rgba(122, 31, 43, 0.12);
    opacity: 1;
}

@media (max-width: 992px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Print */

.print-page {
    background: #fff;
    padding: 16px;
    font-size: 13px;
}

.print-card {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-shadow: none;
}

.registration-print-card p {
    margin-bottom: 0.35rem;
    font-size: 13px;
}

.registration-print-card .h6 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Responsive */

@media (max-width: 900px) {
    .hamburger-menu {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -220px;
        top: 52px;
        height: calc(100vh - 52px);
        z-index: 999;
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(220px);
    }

    .sidebar-footer {
        display: none;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .field-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .field-inline .form-label {
        flex: none;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 12px;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .topbar-right span {
        display: none;
    }

    .login-body.glassmorphism .login-card {
        padding: 22px 18px;
    }
}

@media print {
    .topbar,
    .sidebar,
    .no-print {
        display: none !important;
    }

    .layout,
    .content {
        display: block;
        padding: 0;
    }
}

/* Staff portal hero (full-image landing) */

.staff-portal-hero-body {
    margin: 0;
    min-height: 100vh;
    background: #2a0f12;
}

.staff-portal-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.staff-portal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}

.staff-portal-topbar-end {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-portal-user {
    color: #fff;
    font-size: 0.85rem;
    background: rgba(42, 15, 18, 0.55);
    padding: 5px 12px;
    border-radius: 999px;
    backdrop-filter: blur(3px);
}

.staff-portal-alert {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 18px;
}

/* Maroon band pinned to the bottom, covering the strip in the image */
.staff-portal-band {
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    background: linear-gradient(180deg, #4a1219 0%, #3a0e14 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -10px 30px rgba(20, 6, 8, 0.45);
}

.staff-portal-band-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px 18px;
    text-decoration: none;
    color: #fff;
    transition: background 0.18s ease;
}

.staff-portal-band-link + .staff-portal-band-link {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.staff-portal-band-link:hover,
.staff-portal-band-link:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.staff-portal-band-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    font-size: 1.25rem;
    color: #f3d9a4;
}

.staff-portal-band-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.staff-portal-band-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.staff-portal-band-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 768px) {
    .staff-portal-band {
        grid-template-columns: 1fr;
    }

    .staff-portal-band-link + .staff-portal-band-link {
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .staff-portal-band-link {
        justify-content: flex-start;
        padding: 14px 20px;
    }
}

