:root {
    --text-primary: #1f1f1f;
    --text-secondary: #e9e9ea;
    --border: #e6e6e6;
    --brand: #ff7a1a;
    --accent-green: #6bcb3d;
    --brand-pressed: #e56910;
    --sheet-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Google Sans Text", "Roboto", "Segoe UI", sans-serif;
    background: url("../img/bg-ngekost.png") center / cover no-repeat;
    color: var(--text-primary);
}

body.with-overlay {
    background:
        linear-gradient(180deg, rgba(15, 15, 15, 0.45), rgba(15, 15, 15, 0.62)),
        url("../img/bg-ngekost.png") center / cover no-repeat;
}

.material-symbols-rounded {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.screen {
    min-height: 100dvh;
    padding: 0 0 120px;
}

.bottom-login-btn {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 20px;
    z-index: 20;
    width: calc(100% - 32px);
    border: 0;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 15px;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(255, 122, 26, 0.4);
}

.bottom-login-btn:active {
    background: var(--brand-pressed);
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.login-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--sheet-bg);
    border-radius: 22px 22px 0 0;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
}

.login-sheet.active {
    transform: translateY(0);
}

.sheet-handle {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: #d8d8d8;
    margin: 0 auto 14px;
}

.login-sheet h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.sheet-subtitle {
    color: #666b71;
    font-size: 0.92rem;
    margin-bottom: 18px;
}

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    line-height: 1.4;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #4d4f52;
}

.password-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 16px;
    overflow: hidden;
}

input[type="password"],
input[type="text"],
input[type="email"] {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    padding: 14px 14px;
    font-family: inherit;
}

.toggle-btn {
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #6b7280;
}

.toggle-btn:active {
    opacity: 0.65;
}

.primary-btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
}

.primary-btn:active {
    background: var(--brand-pressed);
}

.forgot-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    color: var(--brand);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
}

.forgot-screen {
    min-height: 100dvh;
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

.forgot-card {
    width: 100%;
    background: #fff;
    border-radius: 22px;
    padding: 18px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.forgot-title {
    color: #1f1f1f;
    font-size: 1.45rem;
    margin-bottom: 6px;
}

.forgot-subtitle {
    color: #666b71;
    font-size: 0.92rem;
    margin-bottom: 16px;
}

input[type="email"] {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    padding: 14px 14px;
    font-family: inherit;
}

.app-body {
    background: #f4f6fb;
    color: #1f1f1f;
}

.app-shell {
    min-height: 100dvh;
    padding: 0 16px 96px;
}

.app-top-banner {
    margin: 0 -16px 14px;
    padding: 16px;
    border-radius: 0 0 20px 20px;
    background:
        linear-gradient(180deg, rgba(21, 25, 35, 0.20), rgba(21, 25, 35, 0.38)),
        url("../img/bg-banner-main.jpg") center top / cover no-repeat;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-greeting {
    color: #f3f4f6;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.app-title {
    font-size: 1.35rem;
    color: #fff;
}

.icon-circle-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #343a44;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    display: grid;
    place-items: center;
    text-decoration: none;
    position: relative;
}

.icon-circle-btn--green {
    background: var(--accent-green);
    color: #fff;
    box-shadow: 0 6px 16px rgba(107, 203, 61, 0.35);
}

.icon-circle-btn--green.has-badge .material-symbols-rounded {
    color: #fff;
}

.icon-circle-btn.has-badge .material-symbols-rounded {
    font-size: 1.35rem;
}

.icon-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

.highlight-card {
    border-radius: 20px;
    background: linear-gradient(145deg, #ff7a1a, #ff9f4a);
    color: #fff;
    padding: 16px;
    margin-bottom: 0;
}

.highlight-label {
    font-size: 0.86rem;
    opacity: 0.95;
}

.highlight-value {
    font-size: 1.55rem;
    font-weight: 700;
    margin: 6px 0 10px;
}

.highlight-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.menu-icon-sm {
    width: 22px;
    height: 22px;
}

.quick-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.quick-menu-item {
    background: #fff;
    border-radius: 14px;
    padding: 12px 8px;
    text-decoration: none;
    color: #2f343b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    box-shadow: 0 7px 18px rgba(18, 28, 45, 0.08);
}

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

.stat-card {
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 7px 18px rgba(18, 28, 45, 0.08);
}

.stat-card p {
    color: #6b7280;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.stat-card strong {
    color: #1f2937;
    font-size: 1.3rem;
}

.stats-grid .stat-card:first-child {
    border: 1px solid rgba(107, 203, 61, 0.45);
    background: linear-gradient(180deg, #ffffff, #f6fff1);
}

.stats-grid .stat-card:first-child strong {
    color: var(--accent-green);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e9edf4;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 50;
}

.bottom-nav-item {
    text-decoration: none;
    color: #8b93a1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.68rem;
    font-weight: 500;
}

.bottom-nav-item .bottom-nav-icon {
    font-size: 1.75rem;
    line-height: 1;
    opacity: 0.75;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.bottom-nav-item.active {
    color: var(--brand);
}

.bottom-nav-item.active .bottom-nav-icon {
    opacity: 1;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.app-shell-page {
    padding-top: 16px;
}

.page-header-card {
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(145deg, #ff7a1a, #ff9f4a);
    color: #fff;
    margin-bottom: 12px;
}

.page-header-card.warning {
    background: linear-gradient(145deg, #ea580c, #f97316);
}

.page-kicker {
    font-size: 0.8rem;
    opacity: 0.95;
    margin-bottom: 4px;
}

.page-title {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.86rem;
}

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

.list-card {
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: 0 7px 18px rgba(18, 28, 45, 0.08);
}

.list-card-action-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.list-card-action-btn:active {
    opacity: 0.7;
}

.open-room-delete-modal {
    color: #dc2626;
    background: #fee2e2;
}

.account-edit-sheet .password-wrap {
    margin-bottom: 12px;
}

.account-edit-backdrop {
    z-index: 60;
}

.account-edit-sheet {
    z-index: 70;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.list-card h3 {
    font-size: 0.95rem;
    color: #1f2937;
    margin-bottom: 2px;
}

.list-card p {
    color: #6b7280;
    font-size: 0.8rem;
}

.status-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-ok {
    color: #2f7a12;
    background: #eafadf;
}

.status-warn {
    color: #b45309;
    background: #fff4dd;
}

.status-empty {
    color: #334155;
    background: #e9eef5;
}

.amount-text {
    font-size: 0.9rem;
    color: #1f2937;
}

.amount-text.due {
    color: #dc2626;
}

.profile-header {
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(145deg, #ff7a1a, #ff9f4a);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    display: grid;
    place-items: center;
}

.profile-avatar .material-symbols-rounded {
    font-size: 1.9rem;
    color: #fff;
}

.profile-name {
    color: #fff;
    font-size: 1.2rem;
}

.profile-email {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.95);
}

.profile-menu-item {
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: 0 7px 18px rgba(18, 28, 45, 0.08);
}

.profile-menu-item h3 {
    font-size: 0.95rem;
    color: #1f2937;
    margin-bottom: 2px;
}

.profile-menu-item p {
    color: #6b7280;
    font-size: 0.8rem;
}

.profile-menu-item .material-symbols-rounded {
    color: #9aa3b2;
}

.profile-logout-btn {
    display: block;
    margin-top: 14px;
    width: 100%;
    border-radius: 14px;
    background: #fff;
    color: #dc2626;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    padding: 12px;
    box-shadow: 0 7px 18px rgba(18, 28, 45, 0.08);
}

.help-card {
    display: block;
    padding: 0;
}

.help-card-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    cursor: pointer;
}

.help-card-summary::-webkit-details-marker {
    display: none;
}

.help-card-chevron {
    color: #9aa3b2;
    transition: transform 0.2s ease;
}

.help-card[open] .help-card-chevron {
    transform: rotate(180deg);
}

.help-card-content {
    border-top: 1px solid #eef1f5;
    padding: 10px 12px 12px;
}

.help-card-content p {
    color: #4b5563;
    font-size: 0.82rem;
    line-height: 1.5;
}

.help-card-content p + p {
    margin-top: 8px;
}

.wa-contact-link {
    margin-top: 10px;
    border-radius: 10px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #128c7e;
    font-weight: 600;
    background: #e8f7f3;
}

.wa-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.room-card-row {
    padding: 8px 10px;
    gap: 8px;
}

.room-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.room-card-main:link,
.room-card-main:visited,
.room-card-main:hover,
.room-card-main:focus {
    text-decoration: none;
    color: inherit;
}

.room-card-main h3,
.room-card-main p,
.room-card-main .amount-text,
.room-card-main .status-badge {
    text-decoration: none;
}

.room-card-main:active {
    opacity: 0.8;
}

.room-share-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    color: #16a34a;
    background: #ecfdf3;
    flex: 0 0 auto;
}

.add-room-btn {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.room-form-section {
    gap: 12px;
}

.room-form-card {
    display: block;
}

.room-form-grid {
    display: grid;
    gap: 6px;
}

.room-form-grid input.room-input,
.room-form-grid select.room-select,
.room-form-grid textarea.room-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: #fff;
    padding: 12px;
    font-family: inherit;
    margin-bottom: 8px;
    display: block;
}

.room-textarea {
    resize: vertical;
    min-height: 88px;
}

.room-alert-success {
    margin-bottom: 10px;
    border: 1px solid #b7ebc6;
    background: #ecfdf3;
}

.room-alert-success p {
    color: #166534;
    font-size: 0.86rem;
    font-weight: 500;
}

.danger-btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px;
    cursor: pointer;
}

.danger-btn:active {
    opacity: 0.86;
}

.delete-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.delete-modal {
    width: min(100%, 360px);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(18, 28, 45, 0.22);
    padding: 14px;
}

.delete-modal h3 {
    font-size: 1rem;
    color: #111827;
    margin-bottom: 6px;
}

.delete-modal p {
    color: #4b5563;
    font-size: 0.86rem;
    line-height: 1.45;
}

.delete-modal-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.delete-modal-cancel {
    width: 100%;
    border-radius: 10px;
    background: #f3f4f6;
}

.delete-modal-confirm {
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.92rem;
}

.inline-action-form {
    margin-top: -4px;
    margin-bottom: 6px;
}

.inline-action-form .primary-btn {
    padding: 11px;
    font-size: 0.92rem;
}

.payment-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.payment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #16a34a;
    text-decoration: none;
    border: 1px solid #bbf7d0;
    padding: 0;
    cursor: pointer;
}

.wa-share-btn:active {
    transform: scale(0.98);
}

.wa-share-btn[data-missing-wa="1"] {
    opacity: 0.55;
}

.wa-share-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
