
:root {
    --sidebar: #0d1225;
    --sidebar-2: #141c35;
    --primary: #6155f6;
    --primary-dark: #4f44db;
    --primary-soft: #efedff;
    --bg: #f5f6fb;
    --text: #1a2138;
    --muted: #7c859b;
    --card: #ffffff;
    --border: #eaedf5;
    --success: #22b45f;
    --danger: #ef555a;
    --warning: #efb323;
    --info: #3f8cff;
    --shadow: 0 16px 40px rgba(17, 24, 39, .06);
    --radius-xl: 24px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Noto Sans Thai", "Prompt", "Tahoma", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { text-decoration: none; color: inherit; }

.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 230px;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(103, 89, 255, .18), transparent 26%), linear-gradient(180deg, #091122, #0d1832 60%, #101a34);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.05);
}
.brand {
    padding: 4px 10px 18px;
}
.brand-emblem {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(114, 89, 255, .18), rgba(114,89,255,.03));
    border: 1px solid rgba(255,255,255,.1);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,.25);
}
.brand-emblem-badge {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #d9d4ff;
    font-size: 28px;
    background: linear-gradient(135deg, #5d45ec, #8b64ff);
    box-shadow: 0 12px 26px rgba(102, 88, 246, .35);
}
.brand-title {
    font-weight: 800;
    font-size: 18px;
    line-height: 1.2;
}
.brand-sub {
    color: rgba(255,255,255,.62);
    font-size: 13px;
    margin-top: 4px;
}
.menu {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.menu-link {
    color: rgba(255,255,255,.74);
    padding: 14px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: .18s ease;
    font-weight: 700;
}
.menu-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-link.active {
    background: linear-gradient(135deg, #564de7, #7167ff);
    color: #fff;
    box-shadow: 0 14px 32px rgba(102, 88, 246, .35);
}
.menu-link i { font-size: 22px; min-width: 30px; }
.sidebar-footer {
    margin-top: auto;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.04);
    padding: 16px;
    border-radius: 18px;
}
.sidebar-footer .footer-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-weight: 900;
    margin-bottom: 8px;
}

.main-content {
    flex: 1;
    margin-left: 230px;
    padding: 14px 18px 28px;
}

.header-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 18px 22px;
    margin-bottom: 18px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}
.hamburger-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    display: inline-grid;
    place-items: center;
    color: #27304b;
    font-size: 22px;
}
.page-title {
    font-size: 20px;
    font-weight: 900;
    margin: 0;
}
.page-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}
.topbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.date-pill, .user-pill, .soft-pill {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    color: #4d566b;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(16,24,40,.04);
}
.date-pill i, .user-pill i, .soft-pill i { margin-right: 6px; }

.card-soft, .stat-card, .mini-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.card-soft { padding: 22px; }
.stat-card {
    height: 100%;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.stat-icon-ring {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    font-size: 34px;
    font-weight: 900;
}
.stat-icon-ring::after {
    content: '';
    position: absolute;
    inset: 11px;
    background: #fff;
    border-radius: 50%;
    z-index: 0;
}
.stat-icon-ring > i, .stat-icon-ring > span { position: relative; z-index: 1; }
.ring-primary { background: linear-gradient(135deg, #6d59ff, #7f73ff); color: #6c58f8; }
.ring-success { background: linear-gradient(135deg, #30c56b, #6add8e); color: #22a55d; }
.ring-danger { background: linear-gradient(135deg, #ff6a72, #ff9aa0); color: #eb4f57; }
.ring-warning { background: linear-gradient(135deg, #f6b513, #ffd367); color: #d59a13; }
.stat-label { color: #343b52; font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.stat-number { font-size: 42px; line-height: 1; font-weight: 900; letter-spacing: -.8px; }
.stat-suffix { font-size: 18px; font-weight: 700; margin-left: 6px; color: #2f3447; }
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 16px;
}
.section-title i { color: #2f3855; }
.house-card {
    padding: 18px;
    height: 100%;
}
.house-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.house-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #5046d8, #7f6cff);
    box-shadow: 0 8px 18px rgba(96,82,242,.24);
}
.house-name { font-size: 18px; font-weight: 800; }
.house-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #f0f1f7;
    padding-top: 14px;
}
.house-stat {
    text-align: center;
    border-right: 1px solid #f0f1f7;
}
.house-stat:last-child { border-right: 0; }
.house-stat .label { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.house-stat .value { font-size: 18px; font-weight: 900; }
.house-stat .unit { font-size: 13px; color: #363d52; margin-left: 2px; }
.text-success-ui { color: #18a857; }
.text-danger-ui { color: #eb4f57; }
.text-warning-ui { color: #d59a13; }

.btn-rounded { border-radius: 14px; font-weight: 800; padding: 10px 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost {
    background: #fff;
    border: 1px solid var(--border);
    color: #27304b;
}
.btn-ghost:hover { background: #fafbff; }

.dashboard-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 14px; }

.table-card { overflow: hidden; }
.table-card .card-soft { height: 100%; }
.table-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 900; margin-bottom: 14px; }
.collection-cycle-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid rgba(148, 163, 184, .22);
}

.collection-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.collection-metric-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 21px;
    color: #2563eb;
    background: #eff6ff;
}

.collection-metric-icon.metric-danger {
    color: #dc2626;
    background: #fef2f2;
}

.collection-metric-icon.metric-success {
    color: #059669;
    background: #ecfdf5;
}

.collection-metric-icon.metric-warning {
    color: #d97706;
    background: #fffbeb;
}

.collection-metric-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.collection-metric-value {
    color: #0f172a;
    font-size: 25px;
    font-weight: 900;
    line-height: 1.2;
}

.collection-metric-value small {
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}
.table thead th {
    background: #f8f9fd;
    color: #4d566b;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    padding-top: 15px;
    padding-bottom: 15px;
}
.table tbody td {
    vertical-align: middle;
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 14px;
}
.table tbody tr:last-child td { border-bottom: 0; }
.member-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #1a1c28, #3e4166);
    color: #fff;
    font-weight: 900;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
}
.rank-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3d4458;
    font-weight: 700;
}
.rank-chip i { font-size: 16px; }
.rank-leader i { color: #6b56f5; }
.rank-deputy i { color: #f5a623; }
.rank-member i { color: #3182ff; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 11px;
    white-space: nowrap;
}
.status-success { background: rgba(34,180,95,.12); color: #158f4a; }
.status-danger { background: rgba(239,85,90,.12); color: #cf3940; }
.status-warning { background: rgba(239,179,35,.18); color: #a97406; }
.status-info { background: rgba(63,140,255,.12); color: #1d72d4; }
.status-muted { background: rgba(123,132,153,.12); color: #687087; }
.icon-btn, .more-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    display: inline-grid;
    place-items: center;
    color: #48516a;
}
.action-group { display: flex; gap: 6px; }

.upload-card .steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 18px;
}
.upload-card .step {
    text-align: center;
    flex: 1;
}
.upload-card .step .step-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin: 0 auto 6px;
    display: grid;
    place-items: center;
    background: #f2efff;
    color: #6155f6;
    font-size: 18px;
}
.upload-card .step .step-label {
    font-size: 13px;
    line-height: 1.25;
    color: #40485d;
}
.upload-box {
    border: 2px dashed rgba(102,88,246,.35);
    background: rgba(102,88,246,.03);
    border-radius: 22px;
    padding: 34px 22px 24px;
    text-align: center;
}
.upload-cloud {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #f4f1ff;
    color: #6155f6;
    font-size: 34px;
    margin-bottom: 14px;
}
.upload-title { font-weight: 800; font-size: 20px; margin-bottom: 4px; }
.upload-note { color: var(--muted); font-size: 13px; }
.upload-foot { color: #8a91a6; font-size: 13px; text-align: center; margin-top: 12px; }

.form-control, .form-select {
    border-radius: 13px;
    border-color: var(--border);
    padding: 10px 13px;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(102,88,246,.45);
    box-shadow: 0 0 0 .22rem rgba(102,88,246,.12);
}
.metric-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f7;
}
.metric-line:last-child { border-bottom: 0; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 10%, rgba(102,88,246,.22), transparent 28%), radial-gradient(circle at 80% 20%, rgba(32,181,107,.15), transparent 26%), #f4f6fb;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(16,24,40,.13);
}
.brand-login { text-align: center; margin-bottom: 24px; }
.brand-login .login-mark {
    width: 72px; height: 72px; border-radius: 20px; display: inline-grid; place-items: center;
    background: linear-gradient(135deg, #5d45ec, #8b64ff); color: #fff; font-size: 32px; box-shadow: 0 14px 34px rgba(102,88,246,.28);
}
.brand-login h1 { margin-top: 14px; margin-bottom: 4px; font-weight: 900; }
.brand-login p { margin: 0; color: var(--muted); }
.login-hint {
    color: var(--muted);
    background: #f8f9fd;
    border-radius: 16px;
    padding: 14px;
    font-size: 14px;
}

.delete-modal-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(239, 85, 90, .12);
    color: var(--danger);
    font-size: 22px;
}

@media (max-width: 1200px) {
    .stat-number { font-size: 34px; }
    .stat-icon-ring { width: 68px; height: 68px; font-size: 28px; }
}
@media (max-width: 992px) {
    .sidebar { position: static; width: 100%; min-height: auto; }
    .app-shell { display: block; }
    .main-content { margin-left: 0; padding: 12px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .header-card { padding: 16px; }
    .upload-card .steps { flex-wrap: wrap; }
}

/* System-wide UI refresh */
:root {
    --sidebar: #111827;
    --sidebar-2: #1f2937;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --bg: #f3f6fb;
    --text: #111827;
    --muted: #64748b;
    --card: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0891b2;
    --shadow: 0 18px 42px rgba(15, 23, 42, .08);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, .06);
}

body {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, .07), rgba(37, 99, 235, 0) 260px),
        var(--bg);
    line-height: 1.55;
}

.sidebar {
    width: 248px;
    padding: 18px 14px;
    background: linear-gradient(180deg, #0f172a, #111827 56%, #172033);
    box-shadow: 12px 0 34px rgba(15, 23, 42, .12);
}

.main-content {
    margin-left: 248px;
    padding: 18px 24px 34px;
}

.brand {
    padding: 8px 10px 20px;
}

.brand-emblem {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
}

.brand-emblem-badge {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #10b981);
    color: #fff;
    font-size: 24px;
    box-shadow: 0 16px 30px rgba(37, 99, 235, .24);
}

.brand-title {
    font-size: 17px;
    letter-spacing: .2px;
}

.menu {
    gap: 6px;
}

.menu-link {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
}

.menu-link i {
    min-width: 24px;
    font-size: 18px;
}

.menu-link:hover {
    background: rgba(255, 255, 255, .08);
    transform: translateX(2px);
}

.menu-link.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
}

.sidebar-footer {
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, .07);
}

.header-card {
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: var(--shadow-soft);
}

.hamburger-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    border-color: #dbeafe;
    color: var(--primary-dark);
}

.page-title {
    font-size: 22px;
    letter-spacing: 0;
}

.page-subtitle {
    color: #64748b;
}

.date-pill,
.user-pill,
.soft-pill {
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: none;
    background: #f8fafc;
}

.card-soft,
.stat-card,
.mini-card {
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.card-soft {
    padding: 20px;
}

.stat-card {
    border: 0;
    padding: 18px;
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-top: 3px solid rgba(37, 99, 235, .16);
    pointer-events: none;
}

.stat-icon-ring {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 24px;
}

.stat-icon-ring::after {
    display: none;
}

.ring-primary { background: rgba(37, 99, 235, .12); color: #2563eb; }
.ring-success { background: rgba(16, 185, 129, .13); color: #059669; }
.ring-danger { background: rgba(239, 68, 68, .13); color: #dc2626; }
.ring-warning { background: rgba(245, 158, 11, .16); color: #d97706; }
.ring-info { background: rgba(8, 145, 178, .13); color: #0e7490; }

.stat-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 800;
}

.stat-number {
    font-size: 36px;
    letter-spacing: 0;
}

.section-title,
.table-title {
    font-size: 17px;
}

.btn {
    border-radius: 12px;
    font-weight: 800;
}

.btn-rounded {
    border-radius: 12px;
}

.btn-primary {
    box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 10px 24px rgba(16, 185, 129, .16);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-success {
    background: #fff;
}

.table-responsive {
    border-radius: 12px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: none;
    border-bottom: 1px solid var(--border);
}

.table tbody tr {
    transition: background .16s ease;
}

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

.table tbody td {
    border-color: #edf2f7;
}

.avatar-mini {
    width: 34px;
    height: 34px;
    margin-right: 8px;
    background: linear-gradient(135deg, #0f172a, #2563eb);
}

img.avatar-mini,
.avatar-discord {
    object-fit: cover;
    padding: 0;
    background: #e2e8f0;
    border: 2px solid #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .16);
}

.status-badge {
    border-radius: 10px;
    padding: 6px 10px;
}

.status-success { background: rgba(16, 185, 129, .12); color: #047857; }
.status-danger { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.status-warning { background: rgba(245, 158, 11, .16); color: #92400e; }
.status-info { background: rgba(8, 145, 178, .12); color: #0e7490; }
.status-muted { background: rgba(100, 116, 139, .12); color: #475569; }

.form-label {
    color: #334155;
    font-weight: 800;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: #dbe3ef;
    background-color: #fff;
    min-height: 42px;
}

.form-control:hover,
.form-select:hover {
    border-color: #bfccdd;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
}

.form-check-input {
    border-color: #94a3b8;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.modal-content {
    border-radius: 18px;
}

.modal-header,
.modal-footer {
    padding-left: 22px;
    padding-right: 22px;
}

.modal-body {
    padding: 20px 22px;
}

.delete-modal-icon {
    border-radius: 12px;
}

.member-match-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.member-match-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe3ef;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.member-match-chip small {
    color: var(--muted);
    font-weight: 700;
}

.login-page {
    min-height: 100vh;
    align-items: start;
    place-items: start center;
    padding: 34px 18px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(16, 185, 129, .10)),
        #f3f6fb;
}

.login-card {
    border-radius: 20px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .14);
}

.brand-login .login-mark,
.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #10b981);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(37, 99, 235, .22);
}

.brand-login h1 {
    font-size: 28px;
    letter-spacing: 0;
}

.login-hint {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.upload-box {
    border-radius: 16px;
    border-color: rgba(37, 99, 235, .24);
    background: #f8fbff;
}

.upload-cloud,
.upload-card .step .step-icon {
    background: var(--primary-soft);
    color: var(--primary);
}

.house-badge {
    background: linear-gradient(135deg, #2563eb, #0891b2);
}

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.house-management-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 100%;
}

.house-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.house-code {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.house-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.house-meta-grid > div {
    border: 1px solid #e6edf6;
    border-radius: 14px;
    background: #f8fbff;
    padding: 12px;
}

.house-meta-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
}

.house-meta-grid strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.house-description {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    min-height: 20px;
}

.house-member-panel {
    border: 1px solid #e6edf6;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    overflow: hidden;
    flex: 1;
}

.house-member-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e6edf6;
    font-weight: 900;
}

.house-member-title strong {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
}

.house-member-list {
    display: grid;
    gap: 0;
}

.house-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid #eef3f8;
}

.house-member-item:last-child {
    border-bottom: 0;
}

.house-member-name {
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.house-member-rank {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-top: 2px;
}

.empty-inline {
    padding: 22px 14px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.house-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 2px;
}

.leave-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e6edf6;
    border-radius: 16px;
    background: #f8fbff;
}

.leave-all-day [data-leave-activity] {
    opacity: .55;
}

.leave-alert-list {
    display: grid;
    gap: 10px;
}

.leave-alert-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e6edf6;
    border-radius: 14px;
    background: #fff;
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        padding: 14px;
        box-shadow: none;
    }

    .main-content {
        margin-left: 0;
        padding: 14px;
    }

    .brand-emblem {
        width: 54px;
        height: 54px;
    }

    .menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .collection-cycle-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .page-toolbar .btn {
        width: 100%;
    }

    .house-meta-grid {
        grid-template-columns: 1fr;
    }

    .login-card,
    .card-soft {
        padding: 16px;
        border-radius: 16px;
    }

    .menu {
        grid-template-columns: 1fr;
    }

    .stat-card {
        align-items: flex-start;
    }

    .stat-number {
        font-size: 30px;
    }

    .topbar-left {
        gap: 12px;
    }
}

/* Discord / role permission UI */
.btn-discord{
    background:#5865f2!important;
    border-color:#5865f2!important;
    color:#fff!important;
    border-radius:18px;
    font-weight:800;
    box-shadow:0 16px 30px rgba(88,101,242,.22);
}
.btn-discord:hover{filter:brightness(.95);color:#fff!important;}
.login-divider{display:flex;align-items:center;gap:12px;color:#94a3b8;font-size:.82rem;margin:4px 0 14px;}
.login-divider:before,.login-divider:after{content:"";height:1px;flex:1;background:rgba(148,163,184,.28);}
.user-pill-profile{gap:8px!important;}
.user-avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;border:2px solid rgba(255,255,255,.75);box-shadow:0 6px 14px rgba(15,23,42,.12);}
.role-chip{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:.72rem;font-weight:800;line-height:1;}
.role-owner{background:#fee2e2;color:#991b1b;}
.role-leader{background:#dbeafe;color:#1d4ed8;}
.role-vice_leader{background:#fef3c7;color:#92400e;}
.role-member{background:#e2e8f0;color:#475569;}

/* Polished login screen */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.80), rgba(241,245,249,.92)),
        radial-gradient(900px 420px at 16% -130px, rgba(37,99,235,.22), transparent 60%),
        radial-gradient(760px 360px at 100% 12%, rgba(16,185,129,.14), transparent 58%),
        linear-gradient(135deg, rgba(15,23,42,.06), transparent 34%, rgba(37,99,235,.06) 100%),
        repeating-linear-gradient(135deg, rgba(37,99,235,.045) 0, rgba(37,99,235,.045) 1px, transparent 1px, transparent 18px),
        #eef3f8;
}

.login-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
    gap: 0;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 28px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .16);
}

.login-panel {
    padding: 42px;
}

.login-panel-info {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .95), rgba(30, 64, 175, .94)),
        #111827;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 560px;
}

.login-brand-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-brand-row .brand-logo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #10b981);
    box-shadow: 0 18px 38px rgba(16, 185, 129, .22);
}

.login-kicker {
    color: rgba(226, 232, 240, .82);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-brand-row h1 {
    margin: 2px 0 0;
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 0;
}

.login-lead {
    color: rgba(241, 245, 249, .9);
    font-size: 17px;
    line-height: 1.75;
    max-width: 520px;
    margin: 34px 0;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.login-feature {
    padding: 16px;
    border: 1px solid rgba(226, 232, 240, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .08);
}

.login-feature i {
    color: #86efac;
    font-size: 24px;
}

.login-feature span {
    display: block;
    color: rgba(226, 232, 240, .74);
    font-size: 12px;
    font-weight: 800;
    margin-top: 12px;
}

.login-feature strong {
    display: block;
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
    margin-top: 2px;
}

.login-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-top: 34px;
    padding: 12px 14px;
    border-radius: 999px;
    background: rgba(16, 185, 129, .14);
    color: #d1fae5;
    font-weight: 800;
}

.login-card {
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.96)),
        repeating-linear-gradient(135deg, rgba(37,99,235,.035) 0, rgba(37,99,235,.035) 1px, transparent 1px, transparent 16px);
}

.brand-login {
    text-align: left;
    margin-bottom: 24px;
}

.brand-login .login-mark {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: #eef6ff;
    color: #2563eb;
    box-shadow: none;
    font-size: 26px;
}

.brand-login h2 {
    margin: 18px 0 4px;
    font-size: 30px;
    font-weight: 900;
    color: #0f172a;
}

.brand-login p {
    color: #64748b;
    margin: 0;
    font-weight: 700;
}

.login-card .alert {
    border: 0;
    border-radius: 14px;
    font-weight: 800;
}

.login-card .form-label {
    color: #334155;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}

.input-with-icon .form-control {
    padding-left: 44px;
    border-radius: 16px;
    min-height: 52px;
    font-weight: 700;
}

.btn-discord {
    border-radius: 16px;
    min-height: 52px;
}

.login-submit {
    border-radius: 16px;
    min-height: 52px;
    font-weight: 900;
    box-shadow: 0 18px 32px rgba(37, 99, 235, .22);
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-panel-info {
        min-height: auto;
    }
}

@media (max-width: 576px) {
    .login-page {
        padding: 14px;
        place-items: stretch;
    }

    .login-shell {
        border-radius: 22px;
    }

    .login-panel {
        padding: 24px;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
    }

    .login-brand-row h1 {
        font-size: 27px;
    }
}

/* 2026 Modern UI refresh */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --bg: #eef3f8;
    --text: #0f172a;
    --muted: #64748b;
    --card: rgba(255, 255, 255, .92);
    --border: #dbe5f0;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

body:not(.login-page) {
    background:
        linear-gradient(180deg, rgba(255,255,255,.70), rgba(238,243,248,.92)),
        radial-gradient(900px 380px at 20% -120px, rgba(37, 99, 235, .18), transparent 62%),
        radial-gradient(720px 320px at 96% 8%, rgba(6, 182, 212, .13), transparent 60%),
        repeating-linear-gradient(135deg, rgba(15, 23, 42, .035) 0, rgba(15, 23, 42, .035) 1px, transparent 1px, transparent 18px),
        #eef3f8;
    color: var(--text);
}

body:not(.login-page)::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(115deg, rgba(37, 99, 235, .10) 0 18%, transparent 18% 100%),
        linear-gradient(245deg, rgba(6, 182, 212, .09) 0 22%, transparent 22% 100%),
        linear-gradient(90deg, rgba(255,255,255,.46), rgba(255,255,255,.12));
}

.app-shell {
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 248px;
    padding: 18px 12px;
    background:
        linear-gradient(180deg, #0f172a 0%, #111827 54%, #0f172a 100%);
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 12px 0 40px rgba(15, 23, 42, .18);
}

.main-content {
    margin-left: 248px;
    padding: 20px 24px 34px;
}

.brand {
    padding: 4px 12px 16px;
}

.brand-emblem {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    margin-bottom: 12px;
    background: rgba(37, 99, 235, .12);
    border-color: rgba(147, 197, 253, .18);
    box-shadow: none;
}

.brand-emblem-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 21px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 14px 28px rgba(37, 99, 235, .28);
}

.brand-title {
    font-size: 16px;
    letter-spacing: 0;
}

.brand-sub {
    font-size: 12px;
    color: rgba(226, 232, 240, .68);
}

.menu {
    gap: 5px;
}

.menu-link {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(226, 232, 240, .72);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
}

.menu-link i {
    min-width: 24px;
    font-size: 18px;
    color: rgba(125, 211, 252, .86);
}

.menu-link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
    transform: translateX(2px);
}

.menu-link.active {
    color: #0f172a;
    background: linear-gradient(135deg, #ffffff, #dbeafe);
    box-shadow: 0 16px 34px rgba(37, 99, 235, .22);
}

.menu-link.active i {
    color: #2563eb;
}

.sidebar-footer {
    padding: 14px;
    border-radius: 16px;
    border-color: rgba(255,255,255,.1);
    background: rgba(255,255,255,.055);
}

.header-card,
.card-soft,
.stat-card,
.mini-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(219, 229, 240, .88);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.header-card {
    padding: 16px 18px;
    position: sticky;
    top: 14px;
    z-index: 20;
    backdrop-filter: blur(14px);
}

.hamburger-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f8fafc;
}

.page-title {
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: 0;
}

.page-subtitle {
    color: #718096;
}

.date-pill,
.user-pill,
.soft-pill {
    border-radius: 12px;
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: none;
    color: #334155;
    padding: 8px 11px;
    font-size: 13px;
}

.card-soft .soft-pill.w-100 {
    min-height: 48px;
}

.card-soft {
    padding: 20px;
}

.stat-card {
    padding: 16px;
    gap: 14px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.stat-card:hover,
.card-soft:hover,
.mini-card:hover {
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .10);
}

.stat-icon-ring {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 24px;
}

.stat-icon-ring::after {
    display: none;
}

.ring-primary,
.ring-success,
.ring-danger,
.ring-warning,
.ring-info {
    background: #eff6ff;
}

.ring-primary { color: #2563eb; }
.ring-success { color: #059669; background: #ecfdf5; }
.ring-danger { color: #dc2626; background: #fef2f2; }
.ring-warning { color: #d97706; background: #fffbeb; }
.ring-info { color: #0891b2; background: #ecfeff; }

.stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 900;
}

.stat-number {
    font-size: 32px;
    letter-spacing: 0;
}

.stat-suffix {
    font-size: 14px;
    color: #64748b;
}

.section-title,
.table-title {
    color: #0f172a;
    font-size: 16px;
    letter-spacing: 0;
}

.btn,
.form-control,
.form-select {
    border-radius: 12px;
}

.btn-rounded {
    border-radius: 12px;
    padding: 9px 14px;
    font-weight: 900;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-success {
    background: #059669;
    border-color: #059669;
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-secondary {
    background: #fff;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: #d8e2ee;
    background-color: #fff;
    font-weight: 650;
}

.form-label {
    font-size: 13px;
    color: #334155;
}

.table-responsive {
    border-radius: 14px;
    border: 1px solid #e7edf5;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    text-transform: none;
    border-bottom-color: #e7edf5;
}

.table tbody td {
    border-color: #eef3f8;
}

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

.status-badge,
.role-chip {
    border-radius: 999px;
    font-size: 12px;
    padding: 6px 10px;
}

.avatar-mini {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 10px 20px rgba(37, 99, 235, .16);
}

.modal-content {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .22);
}

.house-badge {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.house-management-card,
.house-member-panel,
.house-meta-grid > div,
.leave-member-card,
.leave-alert-item {
    border-color: #e3ebf5;
    background: #fff;
}

.login-hint {
    border-radius: 14px;
}

@media (max-width: 992px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .main-content {
        margin-left: 0;
        padding: 14px;
    }

    .header-card {
        position: static;
    }

    .menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .topbar {
        align-items: stretch;
    }

    .topbar-right,
    .dashboard-actions,
    .house-actions {
        width: 100%;
    }

    .topbar-right > *,
    .dashboard-actions .btn,
    .house-actions .btn {
        flex: 1 1 auto;
    }

    .card-soft,
    .login-card {
        border-radius: 16px;
    }
}

/* Login background depth */
.login-page {
    background:
        linear-gradient(125deg, rgba(15,23,42,.10), transparent 30%, rgba(37,99,235,.12) 100%),
        radial-gradient(900px 420px at 10% -120px, rgba(37,99,235,.30), transparent 62%),
        radial-gradient(760px 360px at 100% 12%, rgba(6,182,212,.20), transparent 58%),
        repeating-linear-gradient(135deg, rgba(15,23,42,.055) 0, rgba(15,23,42,.055) 1px, transparent 1px, transparent 18px),
        #dfe9f6;
}

.login-shell {
    background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(219,234,254,.86));
}

.login-panel.login-card {
    background:
        linear-gradient(180deg, rgba(248,251,255,.98), rgba(228,239,255,.98)),
        repeating-linear-gradient(135deg, rgba(37,99,235,.065) 0, rgba(37,99,235,.065) 1px, transparent 1px, transparent 15px);
}

.login-panel.login-card::before {
    content: '';
    display: block;
    height: 5px;
    width: 100%;
    margin: -42px -42px 28px;
    padding: 0 42px;
    background: linear-gradient(90deg, #2563eb, #06b6d4, #10b981);
}

.login-panel-info {
    background:
        linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,64,175,.94)),
        repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0, rgba(255,255,255,.06) 1px, transparent 1px, transparent 18px),
        #111827;
}

.dashboard-activity-picker {
    width: min(260px, 100%);
}

.dashboard-activity-picker .form-select {
    min-height: 42px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
}

.member-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-search-form .input-with-icon {
    min-width: 260px;
}

.house-member-trigger {
    flex: 0 0 auto;
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.house-member-trigger:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.house-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.house-status-panel {
    border: 1px solid #e3ebf5;
    border-radius: 14px;
    background: #f8fbff;
    overflow: hidden;
}

.house-status-head,
.house-status-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.house-status-head {
    padding: 10px 12px;
    border-bottom: 1px solid #e3ebf5;
    background: #fff;
}

.house-status-list {
    max-height: 260px;
    overflow: auto;
    padding: 8px 10px;
}

.house-status-member {
    padding: 8px 0;
    border-bottom: 1px solid #edf3f8;
}

.house-status-member:last-child {
    border-bottom: 0;
}

.report-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.report-total-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 900;
}

.report-total-pill strong {
    font-size: 28px;
    line-height: 1;
}

.report-house-card {
    padding: 20px;
    border: 1px solid #e3ebf5;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96));
    box-shadow: 0 16px 38px rgba(15, 23, 42, .07);
}

.report-house-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.report-house-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
}

.report-progress {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef6;
}

.report-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #06b6d4, #10b981);
}

.report-house-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.report-house-stats div {
    min-height: 74px;
    padding: 12px 10px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.report-house-stats span {
    display: block;
    font-size: 12px;
    font-weight: 900;
}

.report-house-stats strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
}

.member-stats-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.member-stats-avatar {
    width: 54px;
    height: 54px;
    font-size: 22px;
}

.member-stat-list {
    display: grid;
    gap: 10px;
}

.member-stat-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    background: #fff;
}

.member-stat-list span {
    color: #64748b;
    font-weight: 800;
}

.member-stat-list strong {
    color: #0f172a;
    font-size: 20px;
}

.webhook-setting-box {
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.webhook-setting-box .webhook-url-input {
    display: block;
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    border: 2px solid #93c5fd;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .10);
}

.webhook-setting-box .webhook-url-input::placeholder {
    color: #94a3b8;
}

@media (max-width: 576px) {
    .member-search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .member-search-form .input-with-icon,
    .member-search-form .btn {
        width: 100%;
    }

    .house-status-grid {
        grid-template-columns: 1fr;
    }

    .report-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .report-total-pill {
        justify-content: center;
        width: 100%;
    }

    .report-house-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .member-stats-hero {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Balanced check-in page */
.checkin-page {
    align-items: flex-start;
    padding: 24px 14px 34px;
}

.checkin-page .checkin-shell {
    width: min(1180px, 100%);
    max-width: 1180px;
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.96));
    border: 1px solid rgba(219,229,240,.9);
    box-shadow: 0 24px 70px rgba(15,23,42,.14);
}

.checkin-page .brand-login {
    margin-bottom: 18px;
}

.checkin-page .brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 23px;
}

.checkin-page .brand-login h1 {
    margin-top: 12px;
    font-size: 26px;
    line-height: 1.25;
}

.checkin-page .brand-login p {
    max-width: 660px;
    margin: 4px auto 0;
    font-size: 14px;
    line-height: 1.65;
}

.checkin-page .card-soft {
    padding: 16px;
    border-radius: 16px;
}

.checkin-page .card-soft h2 {
    font-size: 18px;
    line-height: 1.35;
}

.checkin-page .form-label {
    margin-bottom: 6px;
    font-size: 13px;
}

.checkin-page .form-select-lg,
.checkin-page .btn-lg {
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 15px;
}

.checkin-page .stat-card {
    min-height: 88px;
    padding: 13px 14px;
    align-items: center;
    justify-content: center;
}

.checkin-page .stat-label {
    font-size: 13px;
}

.checkin-page .stat-number {
    font-size: 28px;
    line-height: 1.05;
}

.checkin-page .status-badge,
.checkin-page .date-pill {
    padding: 6px 9px;
    font-size: 12px;
}

.checkin-page .table thead th {
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 12px;
    white-space: nowrap;
}

.checkin-page .table tbody td {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 13px;
}

.checkin-page .avatar-mini {
    width: 30px;
    height: 30px;
    margin-right: 7px;
    font-size: 13px;
}

.checkin-page .form-control-sm {
    min-height: 34px;
    font-size: 13px;
}

.checkin-page .btn-sm {
    padding: 5px 9px;
    font-size: 12px;
}

.checkin-page .login-hint {
    padding: 12px;
    font-size: 13px;
}

@media (max-width: 576px) {
    .checkin-page {
        padding: 12px;
    }

    .checkin-page .checkin-shell {
        padding: 16px;
        border-radius: 18px;
    }

    .checkin-page .brand-login h1 {
        font-size: 22px;
    }

    .checkin-page .brand-login p {
        font-size: 13px;
    }

    .checkin-page .stat-number {
        font-size: 24px;
    }

    .checkin-page .table-responsive {
        border-radius: 12px;
    }
}

/* Layered workspace background */
body:not(.login-page) {
    background-color: #eef4f8;
    background-image:
        linear-gradient(120deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,.46) 28%, transparent 58%),
        linear-gradient(305deg, rgba(16,185,129,.07) 0%, transparent 29%),
        linear-gradient(133deg, transparent 0%, transparent 47%, rgba(37,99,235,.055) 47%, rgba(37,99,235,.055) 64%, transparent 64%),
        linear-gradient(rgba(100,116,139,.052) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,116,139,.052) 1px, transparent 1px);
    background-size: auto, auto, auto, 36px 36px, 36px 36px;
    background-attachment: fixed;
}

body:not(.login-page)::before {
    background:
        linear-gradient(124deg, rgba(37,99,235,.065) 0 12%, transparent 12% 100%),
        linear-gradient(305deg, rgba(6,182,212,.045) 0 18%, transparent 18% 100%),
        linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.36));
}

.brand-emblem-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.brand-logo.has-image {
    padding: 5px;
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
}

.brand-logo.has-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.branding-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.branding-preview img,
.branding-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: contain;
    padding: 5px;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
}

.branding-placeholder {
    display: grid;
    place-items: center;
    font-size: 23px;
    color: #2563eb;
}

.branding-favicon-preview img,
.branding-favicon-preview .branding-placeholder {
    width: 40px;
    height: 40px;
}

.login-page {
    background-color: #e9f0f6;
    background-image:
        linear-gradient(116deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.46) 32%, transparent 62%),
        linear-gradient(315deg, rgba(16,185,129,.085) 0%, transparent 28%),
        linear-gradient(132deg, transparent 0%, transparent 42%, rgba(37,99,235,.09) 42%, rgba(37,99,235,.09) 59%, transparent 59%),
        linear-gradient(rgba(100,116,139,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,116,139,.055) 1px, transparent 1px);
    background-size: auto, auto, auto, 38px 38px, 38px 38px;
    background-attachment: fixed;
}

.login-shell {
    border-color: rgba(148, 163, 184, .36);
    box-shadow: 0 32px 84px rgba(15, 23, 42, .17), 0 3px 10px rgba(15, 23, 42, .05);
}
