/* Society Maintenance Management - shared stylesheet (no build step). */

:root {
    --primary: #635bff;
    --primary-contrast: #ffffff;
    --secondary: #49beff;
    --secondary-contrast: #ffffff;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-hover: #f0efff;
    --input-bg: #ffffff;
    --text: #111c2d;
    --muted: #67758d;
    --border: #e5eaf2;
    --danger: #fa5c7c;
    --success: #13deb9;
    --warning: #ffae1f;
    --info: #539bff;
    --radius: 14px;
    --shadow: 0 2px 8px rgba(17, 28, 45, .05);
    --shadow-lg: 0 18px 45px rgba(17, 28, 45, .16);
    --sidebar-width: 270px;
    --header-height: 72px;
    --site-content-width: 1320px;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-width: 0; }
html { overflow-x: hidden; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
img, svg { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: .85rem; word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border: 1px solid transparent; border-radius: 10px; padding: .58rem 1rem;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
    background: var(--primary); color: var(--primary-contrast); transition: filter .15s, background .15s;
    max-width: 100%; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-hover); filter: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-hover); filter: none; }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .45rem; }
.btn .spinner { width: 1rem; height: 1rem; border-width: 2px; }
.btn-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.page-tabs { display: flex; gap: .45rem; margin-bottom: 1rem; padding: .35rem; width: fit-content; background: var(--surface-hover); border-radius: 10px; }
.page-tabs .btn { min-width: 110px; }

/* ------------------------------------------------------------------ forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.form-grid > *, .detail-grid > *, .toolbar > *, .filters > *, .btn-group > * { min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title {
    grid-column: 1 / -1; margin-top: .5rem; padding-bottom: .3rem;
    border-bottom: 1px solid var(--border); font-size: .95rem; color: var(--primary);
}
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-weight: 600; font-size: .88rem; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
    font: inherit; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px;
    background: var(--input-bg); color: var(--text); width: 100%; min-width: 0;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input[type="color"] { padding: .2rem; height: 42px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; min-height: 0; }
.field-help { color: var(--muted); font-size: .8rem; }
.check-row { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check-row input { width: auto; }
.check-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .35rem .9rem;
    max-height: 220px; overflow: auto; padding: .5rem; border: 1px solid var(--border); border-radius: 8px;
}
.form-alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.form-alert.error { background: #fdecea; color: #8a1c1c; border: 1px solid #f5c2c0; }
.form-alert.info { background: #e8f1fb; color: #0d3c78; border: 1px solid #c3daf5; }
.form-alert.warning { background: #fff4e0; color: #7a4a00; border: 1px solid #ffd9a0; }
.form-alert.success { background: #e8f5e9; color: #1b5e20; border: 1px solid #b9dfbb; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.import-errors { max-height: 360px; overflow: auto; margin: .75rem 0; padding-left: 1.6rem; }
.import-errors li { margin-bottom: .4rem; }

/* ----------------------------------------------------------------- layout */
.app { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--surface);
    color: var(--text); display: flex; flex-direction: column; z-index: 40;
    border-right: 1px solid var(--border);
    transition: transform .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; min-height: var(--header-height); }
.sidebar-brand .brand-name { font-weight: 700; line-height: 1.2; }
.sidebar-brand .brand-sub { font-size: .75rem; color: var(--muted); }
.sidebar-brand .brand-initials { background: var(--primary); color: var(--primary-contrast); }
.sidebar nav { flex: 1; overflow-y: auto; padding: .75rem 1rem; }
.nav-link {
    display: flex; align-items: center; gap: .75rem; padding: .72rem .85rem; border-radius: 12px;
    color: var(--text); text-decoration: none; margin-bottom: 4px; font-weight: 500;
    transition: background .15s, color .15s, transform .15s;
}
.nav-link:hover { background: var(--surface-hover); color: var(--primary); }
.nav-link.active { background: var(--primary); color: var(--primary-contrast); box-shadow: 0 8px 18px rgba(99, 91, 255, .2); }
.nav-link .nav-badge {
    margin-left: auto; font-size: .65rem; text-transform: uppercase; letter-spacing: .04em;
    background: color-mix(in srgb, currentColor 12%, transparent); padding: .05rem .4rem; border-radius: 999px;
}
.sidebar-footer { padding: 1rem 1.25rem; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--border); }
.sidebar-footer a { color: var(--primary); }

.main { margin-left: var(--sidebar-width); min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--header-height); background: var(--surface);
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .8rem; padding: 0 1.5rem;
}
.topbar h1 { min-width: 0; font-size: 1.15rem; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle { display: none; }
.profile-menu { position: relative; }
.profile-button { display: flex; align-items: center; gap: .55rem; background: none; border: 0; cursor: pointer; font: inherit; color: var(--text); padding: .3rem .5rem; border-radius: 8px; }
.profile-button:hover { background: var(--surface-hover); }
.avatar {
    width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 15%, #fff); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.profile-meta { text-align: left; line-height: 1.15; }
.profile-meta .role { font-size: .75rem; color: var(--muted); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 200px; padding: .4rem; z-index: 50;
}
.dropdown button, .dropdown a {
    display: flex; width: 100%; gap: .5rem; align-items: center; padding: .55rem .7rem; border: 0; background: none;
    font: inherit; color: var(--text); cursor: pointer; border-radius: 6px; text-decoration: none;
}
.dropdown button:hover, .dropdown a:hover { background: var(--surface-hover); }
.content { min-width: 0; padding: 1.6rem; flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; }
.backdrop { display: none; }

.brand-logo {
    width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; flex-shrink: 0;
}
.brand-initials {
    width: 40px; height: 40px; border-radius: 8px; background: var(--secondary); color: var(--secondary-contrast);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
}

/* ------------------------------------------------------------------ cards */
.card { min-width: 0; background: var(--surface); border: 1px solid #edf1f6; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; margin-bottom: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card-header h2, .card-header h3 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.stat {
    background: var(--surface); border: 1px solid #edf1f6; border-radius: var(--radius); padding: 1.2rem 1.25rem;
    box-shadow: var(--shadow);
}
.stat.accent .stat-value { color: var(--primary); }
.stat.good .stat-value { color: #0aae8f; }
.stat.bad .stat-value { color: #e94868; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-value { font-size: 1.8rem; font-weight: 700; margin-top: .35rem; color: var(--text); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem 1.2rem; }
.detail-grid .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.detail-grid .value { font-weight: 500; word-break: break-word; }
.planned {
    text-align: center; padding: 2.5rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}
.planned h2 { margin-bottom: .4rem; }

/* --------------------------------------------------------------- toolbar */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .9rem; }
.toolbar .search { flex: 1 1 220px; min-width: 180px; }
.toolbar input, .toolbar select {
    font: inherit; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); color: var(--text); width: 100%;
}
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: .78rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: var(--surface-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-hover); }
table.data td.actions { white-space: nowrap; text-align: right; }
.cell-sub { font-size: .8rem; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .2rem; flex-wrap: wrap; }
.pagination .pages { display: flex; gap: .3rem; align-items: center; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty .empty-title { font-weight: 600; color: var(--text); margin-bottom: .2rem; }

.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge.success { background: #e5f4e7; color: #1b5e20; }
.badge.danger { background: #fdecea; color: #8a1c1c; }
.badge.warning { background: #fff2dc; color: #7a4a00; }
.badge.info { background: #e3eefb; color: #0d3c78; }
.badge.neutral { background: #eef0f4; color: #475467; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ------------------------------------------------------ money / finance */
table.data th.num, table.data td.num { text-align: right; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: var(--surface-soft); border-top: 2px solid var(--border); }
tr.row-muted td { color: var(--muted); }
tr.row-muted td .entry-text { text-decoration: line-through; }
.amount-due { color: var(--danger); font-weight: 700; }
.amount-advance { color: var(--success); font-weight: 700; }
.amount-debit { color: var(--danger); font-weight: 700; }
.amount-credit { color: var(--success); font-weight: 700; }
.changed-by { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.quick-actions .btn { justify-content: flex-start; padding: .75rem .9rem; white-space: normal; text-align: left; }
.proof-img { max-width: 100%; max-height: 70vh; border-radius: 8px; border: 1px solid var(--border); display: block; margin: .3rem auto 0; }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.history-list li { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; }
.history-list .who { font-weight: 600; }
.history-list .changes { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
.notice-card { border-left: 4px solid var(--secondary); }
.notice-card .notice-meta { font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.notice-card .notice-body { white-space: pre-wrap; }
.notice-card.unread { border-left-color: #D93025; background: #FFF8F6; }
.notice-card .new-tag {
    display: inline-block; margin-left: .45rem; padding: .05rem .45rem; border-radius: 999px;
    background: #D93025; color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .04em; vertical-align: middle;
}
.nav-link .nav-count, .bell-count {
    min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: #D93025; color: #fff;
    font-size: .72rem; font-weight: 700; line-height: 1.25rem; text-align: center;
}
.nav-link .nav-count { margin-left: auto; }
.nav-link .nav-badge + .nav-count { margin-left: .3rem; }
.topbar-bell { position: relative; color: var(--text); }
.topbar-bell .bell-count { position: absolute; top: -2px; right: -4px; border: 2px solid var(--surface); }
.unassigned {
    display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
    background: #FFF1E0; color: #B45309; border: 1px solid #F5C58A;
}
.seen-yes { color: #1E7E34; font-weight: 600; }
.seen-no { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .9rem; }
.filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters input, .filters select { font: inherit; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); color: var(--text); }

/* ------------------------------------------------------ loading/spinner */
.spinner {
    display: inline-block; width: 1.6rem; height: 1.6rem; border: 3px solid rgba(0,0,0,.12);
    border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
.btn .spinner { border-color: rgba(255,255,255,.4); border-top-color: currentColor; }
.loading { display: flex; justify-content: center; align-items: center; gap: .7rem; padding: 2.5rem 1rem; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ modal/toast */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(16, 24, 40, .5); display: flex; align-items: flex-start;
    justify-content: center; padding: 4vh 1rem; z-index: 100; overflow-y: auto;
}
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); }
.modal.lg { max-width: 860px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 1.2rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--border); }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast {
    background: #1d2433; color: #fff; padding: .75rem 1rem; border-radius: 8px; box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--info); animation: slide-in .2s ease;
}
.toast.success { border-left-color: #66bb6a; }
.toast.error { border-left-color: #ef5350; }
.toast.warning { border-left-color: #ffa726; }
@keyframes slide-in { from { transform: translateY(10px); opacity: 0; } }

/* ------------------------------------------------------------- login page */
.brand-row { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; }
.brand-row strong { font-size: 1.1rem; }
.accent { color: var(--secondary); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .5rem; }
.eyebrow.light { color: color-mix(in srgb, var(--primary-contrast) 75%, transparent); margin-top: 0; }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; }
.btn-accent { background: var(--secondary); color: var(--secondary-contrast); }
.btn-outline-light { background: transparent; color: var(--primary-contrast); border-color: color-mix(in srgb, var(--primary-contrast) 55%, transparent); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); filter: none; }

.login-page { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.login-visual {
    background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 9%, #fff), color-mix(in srgb, var(--secondary) 10%, #fff));
    padding: 1.6rem 2.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; overflow-y: auto;
}
.login-visual-body { text-align: center; max-width: 460px; margin: 0 auto; }
.login-illustration { display: block; width: auto; max-width: min(100%, 360px); max-height: 40vh; margin: 0 auto 1.4rem; border-radius: 18px; box-shadow: var(--shadow-lg); }
.login-visual-body h2 { font-size: clamp(1.4rem, 2.3vw, 1.9rem); color: var(--text); }
.login-visual-body .accent { color: var(--primary); }
.login-visual-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; }
.login-visual-foot a { color: inherit; text-decoration: none; }
.login-visual-foot a:hover { color: var(--primary); }
.login-form-side { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 2rem 1.5rem; overflow-y: auto; }
.login-card { width: 100%; max-width: 430px; margin: auto 0; }
.login-card h1 { font-size: 2rem; margin-bottom: .25rem; }
.login-card .field { margin-bottom: 1rem; }
.login-card .btn-block + .btn-block { margin-top: .6rem; }
.role-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; padding: .3rem; background: var(--surface-hover); border-radius: 12px; margin-bottom: 1rem; }
.role-tab { font: inherit; font-weight: 600; font-size: .9rem; border: 0; background: transparent; color: var(--muted); padding: .55rem .4rem; border-radius: 9px; cursor: pointer; }
.role-tab:hover { color: var(--text); }
.role-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.tab-hint { margin-bottom: 1rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--primary); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: .3rem .5rem; }
.otp-input { font-size: 1.4rem !important; letter-spacing: .5em; text-align: center; font-family: Consolas, "Courier New", monospace; }
.otp-sent { font-size: .9rem; }
.continue-box { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.choice-list { display: grid; gap: .6rem; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left; font: inherit; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.choice:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.auth-links { margin-top: 1.4rem; font-size: .9rem; }
.demo-box { margin-top: 1.2rem; padding: .7rem .9rem; border: 1px dashed var(--warning); background: #fffaf0; border-radius: 8px; font-size: .85rem; }
.demo-box strong, .demo-box summary { color: var(--warning); font-weight: 700; cursor: pointer; }
.demo-box ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.demo-otp { font-size: 1.1rem; }

/* ----------------------------------------------------------- home page */
.site-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-nav-inner { max-width: var(--site-content-width); margin: 0 auto; padding: .7rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-nav-inner > .brand-row { min-width: 0; }
.site-nav-inner > .brand-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav-links { display: flex; align-items: center; gap: 1.2rem; }
.site-nav-links a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.site-nav-links a:not(.btn):hover { color: var(--primary); }
.site-hero { background: linear-gradient(140deg, #f3f7ff 0%, #edf5ff 55%, #f6f9ff 100%); color: var(--text); border-bottom: 1px solid var(--border); }
.site-hero-inner { max-width: var(--site-content-width); margin: 0 auto; padding: 4rem 1.5rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; }
.site-hero h1 { font-size: 2.7rem; line-height: 1.15; margin-bottom: 1rem; }
.site-hero .eyebrow.light, .site-hero .accent { color: var(--primary); }
.site-hero .lead { max-width: 560px; margin-bottom: 1.6rem; color: var(--muted); font-size: 1.1rem; opacity: 1; }
.site-hero .btn-accent { background: var(--primary); color: var(--primary-contrast); }
.site-hero .btn-outline-light { background: var(--surface); color: var(--text); border-color: var(--border); }
.site-hero .btn-outline-light:hover { background: var(--surface-hover); border-color: var(--primary); }
.site-hero .support { margin-top: 1rem; }
.site-hero .support a { color: inherit; }
.site-hero-art { width: 100%; border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 20px 50px rgba(17,28,45,.12); }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2.2rem; }
.hero-stats div { display: flex; flex-direction: column; border-left: 3px solid var(--primary); padding-left: .7rem; }
.hero-stats strong { font-size: 1.5rem; }
.hero-stats span { color: var(--muted); font-size: .8rem; }
.site-section { padding: 4rem 1.5rem; }
.site-section:nth-of-type(even) { background: var(--surface); }
.site-section-inner { max-width: var(--site-content-width); margin: 0 auto; }
.site-section h2 { font-size: 1.9rem; }
.site-section .lead { max-width: 720px; font-size: 1.02rem; margin-bottom: 2rem; }
.site-section .eyebrow { color: var(--primary); margin-top: 0; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.role-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--secondary); border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.role-card h3 { color: var(--primary); font-size: 1.2rem; }
.role-card .btn { margin-top: auto; align-self: flex-start; }
.role-step { position: absolute; top: 1.1rem; right: 1.1rem; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, #fff); color: var(--primary); font-weight: 800; display: grid; place-items: center; }
.check-list-plain { list-style: none; padding: 0; margin: .4rem 0 1.2rem; display: grid; gap: .45rem; }
.check-list-plain li { position: relative; padding-left: 1.5rem; font-size: .92rem; }
.check-list-plain li::before { content: "\2713"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.feature { padding: 1.3rem; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); }
.feature h3 { color: var(--primary); }
.feature p { margin: 0; font-size: .93rem; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1.2rem; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.steps li::before { content: counter(step); width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); display: grid; place-items: center; font-weight: 800; margin-bottom: .4rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.roadmap li { display: grid; grid-template-columns: auto 80px 1fr; gap: .9rem; align-items: center; padding: .9rem 1.1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.roadmap li.planned { background: #fffcf6; }
.tech-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { padding: .35rem .8rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); font-weight: 600; font-size: .85rem; }
.site-cta { padding: 3.5rem 1.5rem; text-align: center; background: linear-gradient(140deg, var(--primary), color-mix(in srgb, var(--primary) 62%, #000)); color: var(--primary-contrast); }
.site-cta p { opacity: .9; }
.site-footer { padding: 3.5rem 1.5rem 1.5rem; font-size: .9rem; color: var(--muted); border-top: 1px solid var(--border); background: var(--surface-soft); }
.site-footer .site-section-inner { display: block; }
.site-footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, 1fr)); gap: 3rem; }
.site-footer-about .brand-row { margin-bottom: 1rem; color: var(--text); font-size: 1.05rem; }
.site-footer-about p { max-width: 34rem; margin: 0; line-height: 1.8; }
.site-footer-column h3 { margin: .15rem 0 1rem; color: var(--text); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.site-footer-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.site-footer-list li { display: grid; gap: .15rem; }
.site-footer-label { color: var(--text); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.site-footer address { margin: 0; font-style: normal; line-height: 1.8; white-space: pre-line; }
.site-footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-weight: 600; }

@media (max-width: 800px) {
    .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .site-footer-about { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .site-footer { padding: 2.5rem 1rem 1.25rem; }
    .site-footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .site-footer-about { grid-column: auto; }
    .site-footer-bottom { margin-top: 2rem; }
}

/* ----------------------------------------------------------- contact details (login-page-details API) */
.contact-details h3 { margin-top: 0; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.contact-list li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; align-items: baseline; }
.contact-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.social-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.social-links a { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .85rem; font-weight: 600; text-decoration: none; }
.social-links a:hover { border-color: var(--primary); }
.login-visual-body .contact-details { text-align: left; margin-top: 1.2rem; font-size: .9rem; }

/* ----------------------------------------------------------- admin console pages */
.admin-pill { padding: .15rem .55rem; border-radius: 6px; background: #e5f4e7; color: #1b5e20; font-size: .72rem; font-weight: 700; }
.admin-status { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-radius: 999px; background: rgba(255,255,255,.14); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1rem; }
.admin-status .dot, .console-preview .dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.2); }
.admin-status.secure { display: flex; background: #e8f5e9; color: #1b5e20; border: 1px solid #b9dfbb; border-radius: 8px; padding: .6rem .9rem; margin: .4rem 0 1.2rem; }

.tag-light { background: rgba(255,255,255,.16); color: var(--primary-contrast); }
.console-preview { background: var(--surface); color: var(--text); border-radius: 18px; padding: 1.3rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); display: grid; gap: .6rem; }
.console-preview-head { display: flex; align-items: center; gap: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.console-row { display: flex; justify-content: space-between; align-items: center; padding: .65rem .8rem; border-radius: 10px; background: var(--bg); font-weight: 600; font-size: .92rem; }
.console-foot { color: var(--muted); padding-top: .3rem; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .sidebar { width: min(var(--sidebar-width), calc(100vw - 2rem)); transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .app.sidebar-open .sidebar { transform: translateX(0); }
    .app.sidebar-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .profile-meta { display: none; }
    .login-page {
        height: auto; min-height: 100vh; min-height: 100dvh; display: grid;
        grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(min-content, 1fr) auto;
        padding: clamp(1rem, 5vw, 2.5rem); background: var(--surface);
    }
    .login-visual { display: contents; }
    .login-visual > .brand-row { grid-row: 1; align-self: start; justify-self: start; }
    .login-form-side {
        grid-row: 2; width: min(100%, 430px); min-width: 0; align-self: center; justify-self: center;
        display: block; padding: 2rem 0; overflow: visible; background: transparent;
        border: 0; border-radius: 0; box-shadow: none;
    }
    .login-card { max-width: none; margin: 0; }
    .login-visual-body { display: none; }
    .login-visual-foot {
        grid-row: 3; align-self: end; justify-self: center; justify-content: center;
        text-align: center; margin: 0; padding-top: 1rem;
    }
    .site-hero-inner { grid-template-columns: 1fr; padding: 2.5rem 1.5rem; }
    .site-hero-art { max-width: 420px; }
    .site-nav-links a:not(.btn) { display: none; }
    .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .content { padding: .8rem; }
    .topbar { padding: 0 .65rem; gap: .35rem; }
    .topbar h1 { font-size: 1rem; }
    .profile-button { padding: .25rem; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .stat-value { font-size: 1.4rem; }
    table.data.responsive thead { display: none; }
    table.data.responsive, table.data.responsive tbody, table.data.responsive tr, table.data.responsive td { display: block; width: 100%; }
    table.data.responsive tr { border-bottom: 1px solid var(--border); padding: .4rem 0; }
    table.data.responsive td { border: 0; padding: .3rem .8rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; overflow-wrap: anywhere; }
    table.data.responsive td > * { min-width: 0; }
    table.data.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; font-size: .8rem; }
    table.data.responsive td.actions { justify-content: flex-end; }
    table.data.responsive td.actions::before { content: none; }
    .modal-overlay { padding: 0; }
    .modal { border-radius: 0; min-height: 100vh; min-height: 100dvh; }
    .toolbar select { flex: 1 1 140px; }
    .site-hero h1 { font-size: 1.9rem; }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-section { padding: 2.5rem 1rem; }
    .roadmap li { grid-template-columns: auto 1fr; }
    .roadmap li > span:last-child { grid-column: 1 / -1; }
    .login-card h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    .login-page { padding: 1rem; }
    .login-form-side { padding: 1.5rem 0; }
    .brand-row { min-width: 0; max-width: 100%; }
    .brand-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .brand-logo, .brand-initials { width: 36px; height: 36px; }
    .role-tab { min-width: 0; padding: .5rem .2rem; font-size: .8rem; overflow-wrap: anywhere; }
    .btn:not(.btn-icon) { white-space: normal; }
    .stats, .detail-grid, .check-list { grid-template-columns: minmax(0, 1fr); }
    .card { padding: .85rem; }
    .card-header { align-items: stretch; }
    .card-header > .btn, .card-header > .btn-group { width: 100%; }
    .card-header > .btn-group .btn { flex: 1 1 auto; }
    .toolbar, .filters { align-items: stretch; }
    .toolbar > *, .toolbar .search, .toolbar select, .filters > *, .filters label, .filters input, .filters select { width: 100%; min-width: 0; flex-basis: 100%; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .pagination { align-items: flex-start; flex-direction: column; }
    .pagination .pages { width: 100%; justify-content: space-between; }
    .modal-header, .modal-body, .modal-footer { padding-left: .9rem; padding-right: .9rem; }
    .modal-footer { flex-wrap: wrap; }
    .modal-footer .btn { flex: 1 1 100%; }
    .site-nav-inner { padding: .6rem .75rem; gap: .5rem; }
    .site-nav-links { gap: .4rem; }
    .site-nav-links .btn { padding: .45rem .7rem; }
    .site-hero-inner { padding: 2rem 1rem; }
    .site-hero h1 { font-size: clamp(1.7rem, 9vw, 2.15rem); }
    .site-section h2 { font-size: 1.55rem; }
    .hero-stats { grid-template-columns: minmax(0, 1fr); }
    .contact-list li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
    .roadmap li { grid-template-columns: minmax(0, 1fr); }
    .roadmap li > span:last-child { grid-column: auto; }
}
