.app-shell {
    min-height: 100vh;
    background: #e5ddd5;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #202124;
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18) 0px, transparent 22px),
                      radial-gradient(circle at 80% 10%, rgba(255,255,255,0.12) 0px, transparent 15px),
                      radial-gradient(circle at 50% 80%, rgba(255,255,255,0.16) 0px, transparent 20px);
    background-size: 220px 220px, 180px 180px, 260px 260px;
}

/* SANTRICHAT modern theme */
:root {
    --sc-ink: #14213d;
    --sc-muted: #64748b;
    --sc-deep: #0f766e;
    --sc-primary: #14b8a6;
    --sc-primary-dark: #0f766e;
    --sc-accent: #f59e0b;
    --sc-sky: #e0f2fe;
    --sc-soft: #f8fafc;
    --sc-panel: rgba(255, 255, 255, 0.94);
    --sc-line: #dbe7e4;
    --sc-chat: #f4efe7;
    --sc-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

body {
    margin: 0;
    overflow: hidden;
}

.app-shell {
    height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 10%, rgba(20, 184, 166, 0.18), transparent 28%),
        radial-gradient(circle at 86% 4%, rgba(245, 158, 11, 0.14), transparent 24%),
        linear-gradient(135deg, #f8fafc 0%, #edf7f5 48%, #fff7ed 100%);
    color: var(--sc-ink);
}

.whatsapp-layout {
    background: rgba(248, 250, 252, 0.88);
}

.app-header {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(20, 184, 166, 0.94)),
        radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.28), transparent 22%);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}

.chat-avatar,
.room-avatar {
    background: linear-gradient(135deg, #ccfbf1, #fde68a);
    color: var(--sc-primary-dark);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.chat-title h1,
.sidebar-head h1,
.auth-card h1 {
    letter-spacing: 0;
    color: inherit;
}

.sidebar-head,
.room-sidebar,
.top-room-tabs,
.inline-admin-panel {
    background: var(--sc-panel);
    border-color: var(--sc-line);
}


.top-room-tabs {
    padding: 12px 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.top-room-tab,
.show-all-rooms,
.sidebar-admin,
.sidebar-my-pending,
.admin-login-top,
.header-btn,
.admin-link,
.logout-link {
    border-color: rgba(15, 118, 110, 0.16);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.top-room-tab:hover,
.show-all-rooms:hover,
.sidebar-admin:hover,
.sidebar-my-pending:hover,
.admin-login-top:hover,
.header-btn:hover,
.admin-link:hover,
.logout-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
    filter: none;
}

.top-room-tab.active,
.show-all-rooms,
.header-btn,
.admin-link,
.admin-login-top {
    background: linear-gradient(135deg, #ecfeff, #ccfbf1);
    color: var(--sc-primary-dark);
    border-color: rgba(20, 184, 166, 0.34);
}

.show-all-rooms,
button,
.send-btn,
.copy-link-btn,
.admin-room-form button,
.inline-admin-form button,
.modal-close,
.member-save-btn {
    background: linear-gradient(135deg, var(--sc-primary), var(--sc-primary-dark));
    color: #ffffff;
}

.logout-link {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.auth-page {
    background:
        radial-gradient(circle at 20% 16%, rgba(20, 184, 166, 0.16), transparent 26%),
        radial-gradient(circle at 82% 78%, rgba(245, 158, 11, 0.13), transparent 24%);
}

.auth-card,
.login-box,
.panel,
.settings-section,
.member-modal-panel {
    background: var(--sc-panel);
    border: 1px solid rgba(219, 231, 228, 0.9);
    box-shadow: var(--sc-shadow);
    backdrop-filter: blur(10px);
}

.auth-card {
    border-radius: 22px;
}

.auth-card h1::before,
.sidebar-head h1::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sc-primary), var(--sc-accent));
    vertical-align: middle;
}

input,
textarea,
select,
.message-input,
.member-edit-input {
    border-color: var(--sc-line);
    background: rgba(255, 255, 255, 0.92);
}

input:focus,
textarea:focus,
select:focus,
.message-input:focus,
.member-edit-input:focus {
    outline: 3px solid rgba(20, 184, 166, 0.18);
    border-color: var(--sc-primary);
}

.message-list {
    background:
        radial-gradient(circle at 18% 20%, rgba(20, 184, 166, 0.08) 0 1px, transparent 28px),
        radial-gradient(circle at 78% 32%, rgba(245, 158, 11, 0.08) 0 1px, transparent 24px),
        linear-gradient(180deg, #fbf7ef 0%, #f3eee7 100%);
    background-size: 220px 220px, 180px 180px, auto;
}

.message-row .bubble,
.chat-bubble,
.direct-thread-card {
    border: 1px solid rgba(219, 231, 228, 0.85);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.message-row.outgoing .bubble {
    background: linear-gradient(135deg, #dcfce7, #ccfbf1);
}

.message-row .message-name {
    color: var(--sc-primary-dark);
}

.composer {
    background: rgba(248, 250, 252, 0.92);
    border-top: 1px solid var(--sc-line);
    backdrop-filter: blur(12px);
}

.chat-form {
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.my-pending-panel {
    background: linear-gradient(135deg, #fffbeb, #ecfeff);
    border-color: rgba(245, 158, 11, 0.26);
}

.alert {
    border-radius: 14px;
}

.info-box {
    background: linear-gradient(135deg, #ecfeff, #eef2ff);
    border-color: #bae6fd;
    color: #075985;
}

.whatsapp-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f0f2f5;
}

.room-sidebar {
    background: #ffffff;
    border-bottom: 1px solid #d1d7db;
    box-shadow: 0 3px 12px rgba(17, 27, 33, 0.06);
}

.member-layout .room-sidebar {
    display: none;
}

.sidebar-head {
    min-height: 76px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid #e9edef;
}

.sidebar-head h1 {
    margin: 0;
    font-size: 1.55rem;
}

.sidebar-head p {
    margin: 5px 0 0;
    color: #667781;
    font-size: 0.9rem;
}

.sidebar-admin {
    color: #075e54;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #d1d7db;
    border-radius: 999px;
    padding: 8px 12px;
}

.admin-login-shortcut {
    font-size: 0.78rem;
    padding: 6px 10px;
}

.sidebar-my-pending {
    color: #075e54;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #d1d7db;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
}

.sidebar-my-pending.active {
    background: #0f766e;
    color: #ffffff;
    border-color: transparent;
}

.my-pending-page {
    display: grid;
    align-content: start;
    gap: 0;
    padding: 18px 18px 32px;
    overflow-y: auto;
}

.my-pending-page-head,
.my-notification-page-head {
    padding: 14px 0 8px;
    display: grid;
    gap: 3px;
}

.my-pending-page-head strong,
.my-notification-page-head strong {
    font-size: 0.95rem;
    color: #111827;
}

.my-pending-page-head span {
    font-size: 0.82rem;
    color: #667781;
}

.top-room-tabs {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    flex-wrap: wrap;
    overflow: visible;
    background: #ffffff;
    border-bottom: 1px solid #d1d7db;
}

.top-room-tab,
.show-all-rooms {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    border: 1px solid #d1d7db;
    border-radius: 999px;
    padding: 9px 13px;
    background: #ffffff;
    color: #3b4a54;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.top-room-tab.active {
    background: #d9fdd3;
    color: #075e54;
    border-color: #25d366;
}

.top-room-tab span {
    border-radius: 50%;
    background: #f0f2f5;
    color: #667781;
    padding: 3px 7px;
    font-size: 0.72rem;
}

.top-room-tab.admin-pending-room {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.top-room-tab.direct-room-tab {
    background: #eef7ff;
    color: #075985;
    border-color: #bae6fd;
}

.top-room-tab.direct-room-tab.active {
    background: #d9fdd3;
    color: #075e54;
    border-color: #25d366;
}

.room-menu-bar {
    position: relative;
    align-items: flex-start;
}

.room-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(20, 184, 166, 0.34);
    border-radius: 999px;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.18);
}

.room-menu-toggle::after {
    content: "⌄";
    font-size: 1rem;
    line-height: 1;
}

.room-menu-toggle[aria-expanded="true"]::after {
    content: "⌃";
}

.direct-chat-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid rgba(14, 165, 233, 0.28);
    border-radius: 999px;
    background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
    color: #075985;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    position: relative;
}

.direct-chat-button.active {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #ffffff;
    border-color: rgba(20, 184, 166, 0.45);
}

.direct-chat-button.has-unread {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), 0 12px 28px rgba(15, 118, 110, 0.16);
}

.direct-unread-badge {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.28);
}

.direct-unread-badge[hidden] {
    display: none;
}

/* ── Room unread / pending badges ── */
.room-unread-badge {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff !important;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.38);
}

.room-toggle-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.42);
}

.room-menu-item.has-unread {
    border-color: rgba(239, 68, 68, 0.2);
    background: #fff5f5;
}

.room-menu-item.has-unread:hover {
    background: #fee2e2;
}

.room-menu-item.active.has-unread {
    background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
    border-color: rgba(20, 184, 166, 0.32);
}

.room-menu-toggle span:not(.room-toggle-badge) {
    max-width: min(48vw, 360px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    padding: 4px 9px;
    font-size: 0.8rem;
}

.room-menu-panel {
    position: fixed;
    top: 60px;
    left: 10px;
    z-index: 9999;
    width: min(420px, calc(100vw - 20px));
    max-height: min(420px, 58vh);
    overflow-y: auto;
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--sc-line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
}

.room-menu-panel[hidden] {
    display: none;
}

.room-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--sc-ink);
    text-decoration: none;
    background: #ffffff;
    border: 1px solid transparent;
}

.room-menu-item:hover {
    background: #f1f5f9;
}

.room-menu-item.active {
    background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
    border-color: rgba(20, 184, 166, 0.32);
    color: #0f766e;
}

.room-menu-item strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-menu-item span:not(.room-unread-badge) {
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
    padding: 3px 8px;
    font-size: 0.76rem;
    font-weight: 800;
}

.show-all-rooms {
    background: #075e54;
    color: #ffffff;
}

.room-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 12px;
}

.room-item {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 8px 10px;
    border-radius: 12px;
    color: #111b21;
    text-decoration: none;
}

.room-item.active,
.room-item:hover {
    background: #f0f2f5;
}

.room-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #d9fdd3;
    color: #075e54;
    font-weight: 800;
}

.admin-pending-room .room-avatar {
    background: #fee2e2;
    color: #b91c1c;
}

.room-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.room-copy strong,
.room-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-copy span {
    color: #667781;
    font-size: 0.9rem;
}

.inline-admin-panel {
    border-top: 1px solid #e9edef;
    padding: 14px 18px 18px;
    background: #ffffff;
}

.inline-admin-panel h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.inline-admin-form {
    display: grid;
    gap: 8px;
}

.inline-admin-form label {
    color: #3b4a54;
    font-size: 0.84rem;
    font-weight: 700;
}

.inline-admin-form input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d7db;
    border-radius: 10px;
    padding: 10px 11px;
    font-family: inherit;
}

.inline-admin-form button,
.admin-panel-actions button {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    background: #00a884;
    font-size: 0.92rem;
}

.admin-panel-actions .clear-room-btn {
    background: #ef4444;
}

.admin-panel-actions .delete-room-btn {
    background: #991b1b;
}

.compact-alert {
    margin-bottom: 10px;
    padding: 10px 12px;
    font-size: 0.86rem;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.admin-stat-grid div,
.admin-stat-grid a {
    border-radius: 12px;
    background: #f0f2f5;
    padding: 10px;
    display: grid;
    gap: 2px;
}

.admin-stat-pending {
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.admin-stat-pending:hover {
    background: #e0f2fe;
}

.admin-stat-pending strong {
    color: #0369a1;
}

.admin-stat-grid strong {
    font-size: 1.25rem;
}

.admin-stat-grid span {
    color: #667781;
    font-size: 0.82rem;
}

.admin-note {
    margin: 10px 0 12px;
    color: #54656f;
    font-size: 0.86rem;
    line-height: 1.45;
}

.admin-panel-actions {
    display: grid;
    gap: 8px;
}

.admin-room-manage {
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    background: #f0f2f5;
    display: grid;
    gap: 10px;
}

.room-manage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.room-manage-head strong {
    font-size: 0.88rem;
    color: #3b4a54;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: #54656f;
    cursor: pointer;
}

.room-check-list {
    display: grid;
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
}

.room-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.88rem;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.room-check-item:has(input:checked) {
    border-color: #14b8a6;
    background: #f0fdf9;
}

.room-check-item.protected {
    opacity: 0.6;
    cursor: not-allowed;
}

.room-check-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-lock-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.bulk-delete-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    background: #991b1b;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

/* Modal konfirmasi hapus massal */
.delete-rooms-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 16px;
}

.delete-rooms-modal[hidden] { display: none; }

.delete-rooms-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.delete-rooms-box {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 20px;
    width: min(380px, 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: grid;
    gap: 10px;
}

.delete-rooms-box h3 {
    margin: 0;
    font-size: 1rem;
    color: #991b1b;
}

.delete-rooms-box p {
    margin: 0;
    font-size: 0.88rem;
    color: #374151;
}

.delete-rooms-box ul {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 0.88rem;
    color: #111827;
    display: grid;
    gap: 3px;
}

.delete-rooms-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.delete-rooms-actions #deleteRoomsCancel {
    padding: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    width: 100%;
}

.delete-rooms-confirm-btn {
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    background: #991b1b;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.admin-room-form {
    display: grid;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    border-radius: 12px;
    background: #f0f2f5;
}

.invite-box,
.join-requests {
    display: grid;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    border-radius: 12px;
    background: #f7faf9;
    border: 1px solid #e9edef;
}

.invite-box label,
.join-requests strong {
    color: #3b4a54;
    font-size: 0.84rem;
    font-weight: 800;
}

.invite-box input,
.invite-link {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d7db;
    border-radius: 10px;
    padding: 9px 10px;
    font-family: inherit;
    font-size: 0.8rem;
}

.invite-link {
    display: block;
    color: #075e54;
    background: #ffffff;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.invite-link:hover {
    text-decoration: underline;
}

.invite-box small {
    color: #667781;
    line-height: 1.35;
}

.invite-box button,
.join-request-item button {
    padding: 8px 10px;
    border-radius: 999px;
    background: #00a884;
    font-size: 0.82rem;
}

.copy-link-btn {
    width: 100%;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3b4a54;
    font-size: 0.86rem;
}

.check-row input {
    width: auto;
}

.join-requests p {
    margin: 0;
    color: #667781;
    font-size: 0.84rem;
}

.join-request-item {
    display: grid;
    gap: 5px;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e9edef;
}

.join-request-item span,
.join-request-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.join-request-item small {
    color: #667781;
}

.join-request-item form {
    display: flex;
    gap: 6px;
}

.join-request-item button[value="reject"] {
    background: #ef4444;
}

.admin-room-form label {
    color: #3b4a54;
    font-size: 0.84rem;
    font-weight: 800;
}

.admin-room-form label.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.admin-room-form label.toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    cursor: pointer;
}

.admin-room-form input,
.admin-room-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d7db;
    border-radius: 10px;
    padding: 9px 10px;
    font-family: inherit;
}

.admin-room-form textarea {
    resize: vertical;
}

.admin-room-form button {
    padding: 9px 12px;
    border-radius: 999px;
    background: #00a884;
    font-size: 0.9rem;
}

.admin-panel-actions a {
    display: block;
    text-align: center;
    border: 1px solid #d1d7db;
    border-radius: 999px;
    padding: 10px 12px;
    color: #075e54;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}

.chat-pane {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.join-room {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #efeae2;
}

.app-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #075e54;
    color: white;
    gap: 16px;
}

.chat-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #25d366;
    color: #075e54;
    font-weight: 800;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.chat-title h1 {
    margin: 0;
    font-size: 1.3rem;
}

.chat-title {
    min-width: 0;
}

.chat-title p {
    margin: 6px 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.app-header p {
    display: none;
}

.admin-link {
    padding: 10px 16px;
    color: #075e54;
    background: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.logout-link {
    padding: 8px 14px;
    color: white;
    background: #075e54;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.header-btn {
    padding: 10px 14px;
    color: #075e54;
    background: #ffffff;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
}

.switch-room-link {
    padding: 10px 16px;
    color: #075e54;
    background: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
}

.admin-login-top {
    padding: 7px 11px;
    color: #075e54;
    background: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hdr-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.hdr-label {
    display: inline;
}

.room-list-focus {
    outline: 3px solid rgba(37, 211, 102, 0.45);
    outline-offset: -3px;
    background: #f4fff8;
}

.modal-open {
    overflow: hidden;
}

.member-modal[hidden] {
    display: none;
}

.member-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
}

.member-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 27, 33, 0.55);
}

.member-modal-panel {
    position: relative;
    width: min(920px, 100%);
    max-height: min(720px, 88vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.member-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #e9edef;
}

.member-modal-head h2 {
    margin: 0;
    font-size: 1.18rem;
}

.member-modal-head p {
    margin: 5px 0 0;
    color: #667781;
    font-size: 0.88rem;
}

.modal-close {
    padding: 9px 13px;
    font-size: 0.86rem;
    background: #075e54;
}

.member-table-wrap {
    overflow: auto;
    padding: 0;
}

.member-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.member-table th,
.member-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #e9edef;
    text-align: left;
    vertical-align: top;
}

.member-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f0f2f5;
    color: #3b4a54;
    font-size: 0.82rem;
}

.member-table td {
    color: #202124;
}

.member-edit-input {
    width: 100%;
    min-width: 140px;
    box-sizing: border-box;
    border: 1px solid #d1d7db;
    border-radius: 9px;
    padding: 8px 9px;
    font: inherit;
    background: #ffffff;
}

.member-save-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
    background: #00a884;
    white-space: nowrap;
}

.member-row-actions {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
}

.member-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    color: #075e54;
    background: #d9fdd3;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
}

.auth-page {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 30px 20px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: 12px;
}

.auth-card p {
    margin-top: 0;
    margin-bottom: 24px;
    color: #555;
}

.auth-menu {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.auth-menu a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dfe1e5;
    border-radius: 999px;
    color: #075e54;
    background: #f8faf9;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
}

.auth-menu a:hover {
    background: #eef7f3;
}

.auth-card form {
    display: grid;
    gap: 10px;
}

.auth-card label {
    font-weight: 600;
}

.auth-card input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dfe1e5;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
}

.auth-card button {
    justify-self: start;
    margin-top: 4px;
}

.info-box {
    background: #e8f7ff;
    border: 1px solid #bbe5ff;
    color: #01597f;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 18px;
    line-height: 1.6;
}

.small-note {
    display: inline-block;
    margin-top: 8px;
    color: #777;
    font-size: 0.86rem;
}

.chat-sim {
    display: grid;
    gap: 18px;
}

.chat-bubble {
    max-width: 100%;
    padding: 16px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.user-bubble {
    align-self: start;
    background: #dcf8c6;
}

.admin-bubble {
    align-self: start;
    background: white;
}

.chat-name {
    font-weight: 700;
    margin-bottom: 8px;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hint.small {
    margin: 0;
    font-size: 0.82rem;
    opacity: 0.85;
}

.chat-container,
.admin-container {
    flex: 1;
    padding: 0;
    max-width: 1024px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.chat-container {
    display: flex;
    min-height: 0;
    flex-direction: column;
    max-width: none;
    height: calc(100vh - 72px);
}

.my-pending-panel {
    background: #fff8e1;
    border-bottom: 1px solid #efd37a;
    padding: 10px 18px;
    max-height: 240px;
    overflow-y: auto;
}

.my-pending-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.my-pending-head strong {
    color: #7a5400;
}

.my-pending-head span,
.pending-empty {
    color: #8a6d1d;
    font-size: 0.86rem;
}

.my-pending-list {
    display: grid;
    gap: 8px;
}

.pending-edit {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid #efd37a;
    border-radius: 12px;
    background: #fffdf4;
}

.pending-edit-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-edit-meta small {
    margin-left: auto;
    color: #8a6d1d;
}

.pending-badge {
    display: inline-flex;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    flex-shrink: 0;
}

.pending-room-name {
    display: inline-flex;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-edit textarea {
    min-height: 42px;
    border: 1px solid #e8cf76;
    border-radius: 10px;
    padding: 9px 10px;
    resize: vertical;
    font-family: inherit;
}

.pending-edit button {
    align-self: stretch;
    padding: 8px 12px;
    border-radius: 999px;
    background: #00a884;
    font-size: 0.86rem;
}

.pending-edit .attachment {
    grid-column: 1 / -1;
    margin-top: 2px;
}

.my-notification-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.user-notification {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff;
    color: #7f1d1d;
}

.user-notification strong {
    color: #991b1b;
}

.user-notification span {
    line-height: 1.4;
}

.user-notification small {
    color: #9f7b7b;
}

.admin-container {
    padding: 20px;
    max-width: 1024px;
    overflow: visible;
    height: auto;
}

.message-list {
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
    background: #e5ddd5;
    border-radius: 0;
    padding: 18px 18px 96px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.45);
    overflow-y: auto;
    margin-bottom: 0;
    background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.2) 0 1px, transparent 24px),
                      radial-gradient(circle at 80% 30%, rgba(255,255,255,0.18) 0 1px, transparent 20px);
    background-size: 210px 210px, 170px 170px;
}

.direct-thread-list {
    padding-bottom: 18px;
}

.direct-thread-grid {
    display: grid;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
}

.direct-thread-card {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    color: #111b21;
    background: #ffffff;
    text-decoration: none;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.direct-thread-card:hover {
    background: #f0f2f5;
}

.direct-thread-card.has-unread {
    background: #f0fdf9;
    border-left: 3px solid #14b8a6;
}

.direct-thread-card.has-unread .direct-thread-copy strong {
    color: #0f766e;
}

.direct-thread-card.has-unread .direct-thread-copy small {
    color: #374151;
    font-weight: 600;
}

.direct-thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #d9fdd3;
    color: #075e54;
    font-weight: 900;
    position: relative;
}

.thread-unread-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #14b8a6;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(20, 184, 166, 0.4);
}

.direct-thread-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.direct-thread-copy strong,
.direct-thread-copy span,
.direct-thread-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.direct-thread-copy span,
.direct-thread-copy small,
.direct-thread-card time {
    color: #667781;
    font-size: 0.82rem;
}

.pull-refresh-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    opacity: 0;
    user-select: none;
    pointer-events: none;
}

.pull-refresh-indicator.visible {
    display: flex;
}

.pull-circle-svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(20, 184, 166, 0.3));
}

.pull-circle-track {
    stroke: rgba(20, 184, 166, 0.2);
}

.pull-circle-arc {
    stroke: #14b8a6;
    transform-origin: center;
    transition: stroke-dashoffset 0.08s linear;
}

.pull-refresh-indicator.ready .pull-circle-arc {
    stroke: #0f766e;
}

.pull-refresh-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f766e;
    letter-spacing: 0.01em;
}

.pull-refresh-indicator.loading .pull-circle-arc {
    stroke-dashoffset: 0;
    animation: pull-spin 0.7s linear infinite;
}

.pull-refresh-indicator.loading .pull-refresh-label {
    color: #14b8a6;
}

@keyframes pull-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.chat-notice {
    position: absolute;
    left: 50%;
    top: 166px;
    transform: translateX(-50%) translateY(-12px);
    z-index: 90;
    max-width: min(520px, calc(100% - 32px));
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff3cd;
    border: 1px solid #f4d06f;
    color: #7a5400;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.app-header.has-new-message {
    animation: newMessagePulse 1.15s ease-in-out 2;
}

@keyframes newMessagePulse {
    0%,
    100% {
        box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 18px 42px rgba(15, 118, 110, 0.3);
    }
}

.chat-notice {
    background: linear-gradient(135deg, #fef3c7, #ccfbf1);
    border-color: rgba(245, 158, 11, 0.38);
    color: #134e4a;
}

.message-row {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.message-row.incoming {
    align-items: flex-start;
}

.message-row.outgoing {
    align-items: flex-end;
}

.message-row .bubble {
    width: fit-content;
    max-width: min(72%, 680px);
    padding: 7px 10px 6px;
    border-radius: 8px;
    background: white;
    line-height: 1.42;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow-wrap: anywhere;
}

.message-row.outgoing .bubble {
    background: #dcf8c6;
}

.message-row .message-name {
    font-weight: 700;
    color: #075e54;
    margin-bottom: 3px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1d9bf0;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 900;
    flex-shrink: 0;
    line-height: 1;
}

.room-origin {
    display: inline-flex;
    margin-bottom: 5px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 800;
}

/* ── Compact pending list ── */
.admin-pending-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pending-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    min-height: 0;
    transition: background 0.15s;
}
.pending-row:hover {
    background: #f8fafc;
}

.pending-room-tag {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    padding: 2px 5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-sender {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f766e;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-preview {
    flex: 1;
    font-size: 0.8rem;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-time {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

.pending-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pending-approve-btn,
.pending-reject-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 1;
}

.pending-approve-btn {
    background: #14b8a6;
    color: #fff;
}
.pending-approve-btn:hover {
    background: #0f766e;
}

.pending-reject-btn {
    background: #fee2e2;
    color: #dc2626;
}
.pending-reject-btn:hover {
    background: #fca5a5;
}

.pending-dm-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.7rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    text-decoration: none;
    line-height: 1;
}
.pending-dm-btn:hover {
    background: #0284c7;
    color: #fff;
}

.admin-pending-list .message-row {
    align-items: flex-start;
}

.admin-pending-list .message-row .bubble {
    max-width: min(680px, 92%);
    border-left: 4px solid #ef4444;
}

.message-row.outgoing .message-name {
    display: none;
}

.group-meta {
    color: #d9e3e1;
    font-size: 0.95rem;
    margin-top: 4px;
}

.active-room-label {
    display: inline-flex;
    align-items: center;
    max-width: min(520px, 68vw);
    margin-top: 7px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-members {
    color: #d9e3e1;
    font-size: 0.9rem;
    margin-top: 6px;
    line-height: 1.4;
}

.message-row .meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.82rem;
    color: #555;
}

.message-text {
    white-space: normal;
}

.message-text a {
    color: #065fd4;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.bubble-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: #667781;
    font-size: 0.72rem;
}

.msg-status {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.check-svg {
    width: 16px;
    height: 11px;
    display: block;
}

.msg-sent      { color: #9ca3af; }
.msg-delivered { color: #9ca3af; }
.msg-read      { color: #1d9bf0; }

.message-status {
    min-width: 58px;
    border-radius: 999px;
    padding: 2px 7px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.message-status.pending {
    background: #ef4444;
}

.message-status.approved {
    background: #16a34a;
}

.approve-inline {
    margin-top: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #128c7e;
    color: white;
    font-size: 0.8rem;
}

.pending-admin-actions {
    display: flex;
    gap: 6px;
    margin-top: 7px;
}

.reject-inline {
    padding: 7px 11px;
    border-radius: 999px;
    background: #ef4444;
    color: white;
    font-size: 0.8rem;
}

.message-menu {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
}

.message-row.incoming .message-menu {
    right: 6px;
}

.message-menu-toggle {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #0f766e;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.message-menu-list {
    position: absolute;
    top: 32px;
    right: 0;
    min-width: 148px;
    display: none;
    padding: 6px;
    border: 1px solid var(--sc-line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.message-menu.open .message-menu-list {
    display: grid;
    gap: 4px;
}

.message-menu-list button,
.message-menu-list a {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    background: transparent;
    color: #14213d;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: left;
}

.message-menu-list button:hover,
.message-menu-list a:hover {
    background: #f1f5f9;
}

.message-menu-list .admin-delete-message,
.message-menu-list .reject-inline {
    color: #dc2626;
}

.attachment {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment img,
.attachment video {
    width: 100%;
    border-radius: 18px;
    max-height: 320px;
    object-fit: cover;
}

.attachment audio {
    width: 100%;
}

.attachment-file {
    padding: 12px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #dfe1e5;
}

.attachment-file a {
    color: #075e54;
    text-decoration: none;
    font-weight: 600;
}

.attachment-label {
    color: #555;
    font-size: 0.9rem;
}

.placeholder,
.empty-state {
    color: #666;
    text-align: center;
    padding: 40px 0;
}

.composer {
    position: sticky;
    bottom: 0;
    background: #f0f2f5;
    border-radius: 0;
    padding: 10px 14px;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.08);
}

.chat-form {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 8px;
    align-items: end;
}

.file-input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.attach-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: #54656f;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

.composer-row {
    display: flex;
    margin-bottom: 8px;
}

.message-input {
    border: none;
    border-radius: 22px;
    padding: 12px 16px;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
    min-height: 44px;
    max-height: 130px;
    background: white;
}

.send-btn {
    height: 42px;
    padding: 0 18px;
    align-self: end;
    background: #00a884;
}

.field-group,
.composer-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.field-group label {
    font-weight: 600;
    margin-bottom: 8px;
}

.field-group input,
.field-group textarea,
.message-input,
.composer-row input[type="file"],
.composer-row input[type="text"] {
    border: 1px solid #dfe1e5;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.composer-row input[type="file"] {
    padding: 8px 10px;
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hint.small {
    margin: 0;
    font-size: 0.82rem;
    opacity: 0.85;
}

button {
    border: none;
    border-radius: 999px;
    padding: 14px 20px;
    background: #25d366;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 700;
}

button:hover {
    filter: brightness(0.95);
}

.hint {
    margin-top: 12px;
    color: #555;
    font-size: 0.9rem;
}

.login-box,
.panel {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.login-box h2,
.panel h2 {
    margin-top: 0;
}

.login-box label,
.login-box input,
.login-box button {
    width: 100%;
}

.login-box input {
    margin-bottom: 16px;
}

.alert {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.pending-message,
.approved-message {
    border: 1px solid #ebedef;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    background: #fafafa;
}

.pending-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 0.95rem;
}

.moderation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-approve {
    background: #25d366;
}

.btn-reject {
    background: #ff5c5c;
}

.logout-form {
    text-align: right;
}

@media (max-width: 720px) {
    .whatsapp-layout {
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: 100vh;
    }

    .room-sidebar {
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid #d1d7db;
    }

    .member-layout .room-sidebar {
        display: none;
    }

    .top-room-tabs {
        flex-wrap: wrap;
        overflow: visible;
        gap: 8px;
        padding: 8px 10px;
    }

    .room-menu-toggle {
        flex: 1 1 auto;
        justify-content: center;
    }

    .direct-chat-button {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.84rem;
    }

    .room-menu-toggle span {
        max-width: 54vw;
    }

    .room-menu-panel {
        width: calc(100vw - 20px);
        max-height: 52vh;
    }

    .top-room-tab,
    .show-all-rooms {
        flex: 0 0 auto;
        padding: 8px 11px;
        font-size: 0.82rem;
    }

    .chat-pane {
        min-height: 0;
        flex: 1;
    }

    .app-header {
        flex-direction: row;
        align-items: center;
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .member-layout .app-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .chat-top {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        gap: 8px;
    }

    .member-layout .chat-top {
        flex: 1 1 0;
        min-width: 0;
        gap: 8px;
    }

    .member-layout .chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        flex: 0 0 36px;
    }

    .header-actions {
        flex: 0 0 auto;
        display: flex;
        gap: 4px;
        align-items: center;
    }

    .hdr-label {
        display: none !important;
    }

    .hdr-icon {
        display: inline !important;
        font-size: 1.05rem;
        line-height: 1;
    }

    .logout-link,
    .admin-login-top {
        padding: 6px 9px;
        min-width: 32px;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.82rem;
    }

    .header-btn.search-trigger-btn {
        padding: 6px 8px;
        min-width: 32px;
        min-height: 32px;
    }

    .sidebar-head {
        padding: 0 12px;
    }

    .sidebar-head h1 {
        font-size: 1.2rem;
    }

    .chat-title h1 {
        font-size: 1rem;
    }

    .member-layout .chat-title h1,
    .member-layout .active-room-label,
    .member-layout .group-meta,
    .member-layout .group-members {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .group-meta,
    .group-members {
        font-size: 0.78rem;
    }

    .member-layout .header-actions .header-btn {
        display: none;
    }

    .switch-room-link {
        padding: 6px 9px;
        font-size: 0.8rem;
    }

    .logout-link,
    .admin-login-top {
        padding: 7px 10px;
        min-width: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-actions {
        gap: 6px;
    }

    .member-modal {
        padding: 10px;
        align-items: stretch;
    }

    .member-modal-panel {
        max-height: 92vh;
        border-radius: 12px;
    }

    .member-modal-head {
        align-items: flex-start;
        padding: 14px;
    }

    .member-table {
        min-width: 560px;
    }

    .chat-container {
        height: auto;
        flex: 1;
        min-height: 0;
    }

    .message-row .bubble {
        max-width: 88%;
    }

    .chat-notice {
        top: 154px;
        max-width: calc(100% - 24px);
    }

    /* Admin layout mobile compact elements */
    .admin-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .room-edit-summary {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .room-edit-body {
        padding: 8px 10px 10px;
    }

    .admin-room-form label.toggle-row {
        padding: 8px 0;
    }

    .invite-box,
    .join-requests {
        padding: 8px;
    }

    .asn-quick-links {
        gap: 4px;
    }

    .asn-quick-btn {
        font-size: 0.75rem;
        padding: 5px 9px;
    }

    .new-room-form {
        padding: 8px 10px 10px;
    }
}

/* Compact message action menu */
.message-row .bubble:has(.message-menu) {
    padding-right: 42px;
}

.message-menu {
    position: absolute;
    top: 6px;
    right: 7px;
    z-index: 8;
}

.message-menu-toggle,
button.message-menu-toggle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    box-shadow: none;
}

.message-menu-toggle:hover,
button.message-menu-toggle:hover,
.message-menu.open .message-menu-toggle {
    background: #ffffff;
    color: #0f766e;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
    transform: none;
}

.message-menu-list {
    position: absolute;
    top: 30px;
    right: 0;
    min-width: 154px;
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px;
    border: 1px solid #dbe7e4;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
}

.message-menu.open .message-menu-list {
    display: grid;
}

.message-menu-list button,
.message-menu-list a,
.message-menu-list .admin-delete-message,
.message-menu-list .reject-inline {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #14213d;
    box-shadow: none;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.message-menu-list button:hover,
.message-menu-list a:hover {
    background: #f1f5f9;
    transform: none;
    box-shadow: none;
}

.message-menu-list .admin-delete-message,
.message-menu-list .reject-inline {
    color: #dc2626;
}

.message-row.incoming .message-menu {
    right: 7px;
}

.message-row.incoming .message-menu-list {
    right: auto;
    left: 0;
}

.message-row.outgoing .message-menu-list {
    right: 0;
    left: auto;
}

.admin-pending-list .message-row .bubble,
.message-row.incoming .bubble {
    overflow: visible;
}

/* Final SANTRICHAT polish overrides */
.whatsapp-layout {
    background: rgba(248, 250, 252, 0.9);
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.chat-pane {
    min-height: 0;
    height: 100vh;
    overflow: hidden;
}

.app-header,
.top-room-tabs {
    flex: 0 0 auto;
}

.chat-container,
.direct-chat-container {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.message-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.composer {
    flex: 0 0 auto;
    position: relative;
    bottom: auto;
}

.room-menu-panel {
    max-height: min(420px, calc(100vh - 180px));
}

.app-header {
    background:
        radial-gradient(circle at 86% 18%, rgba(253, 230, 138, 0.22), transparent 24%),
        linear-gradient(135deg, #0f766e 0%, #14b8a6 58%, #0ea5e9 100%);
}

.top-room-tabs {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: var(--sc-line);
    backdrop-filter: blur(14px);
}

.top-room-tab {
    border-color: rgba(15, 118, 110, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--sc-ink);
}

.top-room-tab.active {
    background: linear-gradient(135deg, #ccfbf1, #e0f2fe);
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.42);
}

.top-room-tab span {
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
}

.message-list {
    background:
        radial-gradient(circle at 18% 20%, rgba(20, 184, 166, 0.09) 0 1px, transparent 30px),
        radial-gradient(circle at 78% 32%, rgba(245, 158, 11, 0.09) 0 1px, transparent 24px),
        linear-gradient(180deg, #fbf7ef 0%, #f3eee7 100%);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.composer {
    background: rgba(248, 250, 252, 0.94);
    border-top: 1px solid var(--sc-line);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    flex: 0 0 auto;
    position: relative;
    bottom: auto;
}

.chat-form {
    gap: 10px;
}

.message-input {
    border: 1px solid var(--sc-line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.attach-btn {
    background: linear-gradient(135deg, #ffffff, #ecfeff);
    color: #0f766e;
    border: 1px solid var(--sc-line);
}

.send-btn,
button {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.admin-menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
    color: #0f766e;
    text-decoration: none;
    font-weight: 800;
}

.admin-menu-link-primary {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #ffffff;
}

.settings-container,
.admin-container {
    width: min(1100px, calc(100% - 28px));
    margin-inline: auto;
}

@media (max-width: 720px) {
    .app-header {
        box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
    }

    .top-room-tabs {
        padding: 9px 10px;
    }

    .room-menu-bar {
        overflow: visible;
    }

    .top-room-tab {
        min-height: 34px;
    }
}

/* Fixed chat viewport: header and composer stay visible, only messages scroll */
html,
body {
    height: 100%;
    overflow: hidden;
}

.app-shell,
.whatsapp-layout,
.chat-pane {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.chat-pane {
    display: flex;
    flex-direction: column;
}

.chat-container,
.direct-chat-container {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.message-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 18px;
}

.composer {
    flex: 0 0 auto;
    position: relative;
    z-index: 12;
    bottom: auto;
}

.room-sidebar {
    max-height: 100dvh;
    overflow-y: auto;
}

/* ── Reply bar ── */
.reply-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-top: 1px solid #c8e6c9;
    border-left: 4px solid #075e54;
}
.reply-bar-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.reply-bar-icon {
    font-size: 1rem;
    color: #075e54;
    flex-shrink: 0;
}
.reply-bar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.reply-bar-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #075e54;
}
.reply-bar-text {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.reply-bar-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}
.reply-bar-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #dc2626;
}

/* ── Reply quote in bubble ── */
.reply-quote {
    background: rgba(0, 0, 0, 0.06);
    border-left: 3px solid #075e54;
    border-radius: 0 6px 6px 0;
    padding: 5px 9px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    max-width: 100%;
}
.message-row.outgoing .reply-quote {
    border-left-color: #128c7e;
    background: rgba(0, 0, 0, 0.07);
}
.reply-quote-name {
    font-weight: 700;
    color: #075e54;
    margin-bottom: 2px;
}
.reply-quote-text {
    color: #475569;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Message menu toggle — always visible ── */
.message-menu-toggle {
    opacity: 0.5;
    transition: opacity 0.15s;
}
.bubble:hover .message-menu-toggle,
.message-menu.open .message-menu-toggle {
    opacity: 1;
}

/* ── Delete button red ── */
.msg-delete-action {
    color: #dc2626 !important;
}

/* ── Forward modal ── */
.forward-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.forward-modal[hidden] {
    display: none;
}
.forward-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.forward-box {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 18px;
    width: min(92%, 360px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
}
.forward-box h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #14213d;
}
.forward-rooms {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 14px;
}
.forward-room-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #14213d;
    font-weight: 600;
}
.forward-room-option:hover {
    background: #f1f5f9;
}
.forward-room-option input[type="radio"] {
    accent-color: #075e54;
    flex-shrink: 0;
}
.forward-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.forward-actions button {
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 700;
}
.forward-actions button:first-child {
    background: #f1f5f9;
    color: #475569;
}
#forwardConfirm {
    background: #075e54;
    color: #fff;
}
#forwardConfirm:disabled {
    background: #94a3b8;
}

/* ── Attach menu wrap ── */
.attach-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

/* popup positions above the + button */
.attach-popup {
    position: absolute;
    bottom: 52px;
    left: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    padding: 14px 10px 10px;
    display: flex;
    gap: 2px;
    z-index: 300;
    transform-origin: bottom left;
    animation: attachPopupIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.attach-popup[hidden] {
    display: none;
}

@keyframes attachPopupIn {
    from { opacity: 0; transform: scale(0.75) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.attach-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 10px;
    cursor: pointer;
    border-radius: 14px;
    min-width: 72px;
    transition: background 0.13s;
    animation: attachItemIn 0.22s ease both;
}
.attach-popup-item:nth-child(1) { animation-delay: 0ms; }
.attach-popup-item:nth-child(2) { animation-delay: 50ms; }
.attach-popup-item:nth-child(3) { animation-delay: 100ms; }

@keyframes attachItemIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.attach-popup-item:hover {
    background: #f1f5f9;
}
.attach-popup-item:active {
    background: #e2e8f0;
}

.attach-popup-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.attach-popup-item span {
    font-size: 0.71rem;
    color: #475569;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* ── Attach file preview bar ── */
.attach-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e8f4fd;
    border-left: 4px solid #0284c7;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    margin-bottom: 2px;
}
.attach-preview[hidden] {
    display: none;
}
.attach-preview-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0369a1;
    font-weight: 600;
}
.attach-preview-clear {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}
.attach-preview-clear:hover {
    background: rgba(0,0,0,0.08);
    color: #dc2626;
}

/* Upload progress bar — floats above the composer, doesn't shift layout */
.upload-progress {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(226, 232, 240, 0.7);
    overflow: hidden;
    z-index: 20;
}
.upload-progress[hidden] {
    display: none;
}
.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6, #0284c7, #7c3aed);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.25s ease;
}

/* attach-preview is first in HTML, spans full width, collapses when hidden */
.chat-form {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 8px;
    align-items: end;
}

/* ── Search panel ── */
.search-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.search-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: #ffffff;
    box-shadow: -4px 0 28px rgba(15, 23, 42, 0.18);
    z-index: 500;
    display: flex;
    flex-direction: column;
}
.search-panel[hidden] {
    display: none;
}

.search-panel-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.search-panel-icon {
    flex-shrink: 0;
    color: #64748b;
}

.search-panel-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    color: #0f172a;
    font-family: inherit;
}
.search-panel-input::placeholder {
    color: #94a3b8;
}

.search-panel-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.85rem;
    display: grid;
    place-items: center;
}
.search-panel-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.search-hint {
    padding: 24px 20px;
    color: #94a3b8;
    font-size: 0.88rem;
    text-align: center;
}
.search-hint strong {
    color: #475569;
}

.search-result-row {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: default;
    transition: background 0.12s;
}
.search-result-row:hover {
    background: #f8fafc;
}

.search-result-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 3px;
}

.search-result-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: #0f766e;
    flex-shrink: 0;
}

.search-result-ctx {
    font-size: 0.72rem;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}

.search-result-time {
    font-size: 0.72rem;
    color: #cbd5e1;
    margin-left: auto;
    flex-shrink: 0;
}

.search-result-text {
    font-size: 0.83rem;
    color: #475569;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-text mark {
    background: #fef08a;
    color: #713f12;
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
}

@media (max-width: 720px) {
    .search-panel {
        width: 100vw;
    }
}

/* ─── Room Edit List (admin) ────────────────────────────────────────────── */
.room-edit-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-edit-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.room-edit-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    transition: background 0.12s;
}

.room-edit-summary::-webkit-details-marker { display: none; }

.room-edit-summary::after {
    content: '▸';
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.15s;
}

details[open] > .room-edit-summary::after {
    transform: rotate(90deg);
}

.room-edit-summary:hover { background: #f1f5f9; }

.room-edit-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-edit-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.reb {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.reb-private  { background: #fef3c7; color: #92400e; }
.reb-approval { background: #dbeafe; color: #1e40af; }
.reb-free     { background: #d1fae5; color: #065f46; }

.room-edit-body {
    padding: 10px 12px 12px;
    border-top: 1px solid #f1f5f9;
}

.room-edit-body .admin-room-form {
    margin-bottom: 0;
}

/* ─── Welcome / Home View ──────────────────────────────────────────────── */
.welcome-view {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 32px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    background: linear-gradient(160deg, #f0fdfa 0%, #e0f2fe 100%);
}

.welcome-hero {
    text-align: center;
    max-width: 520px;
}

.welcome-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #14b8a6, #0284c7);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    letter-spacing: -1px;
}

.welcome-hero h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.25;
}

.welcome-hero p {
    color: #475569;
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
}

.welcome-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 720px;
}

.wroom-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.wroom-card:hover {
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
    border-color: #14b8a6;
}

.wroom-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f0fdfa, #e0f2fe);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wroom-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wroom-info strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wroom-info span {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wroom-info small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.wroom-arrow {
    font-size: 1rem;
    color: #14b8a6;
    flex-shrink: 0;
}

/* ─── Admin Sidebar Nav ──────────────────────────────────────────────────── */
.admin-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
}

.admin-badge {
    background: linear-gradient(135deg, #14b8a6, #0284c7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 6px;
}

.admin-name-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.admin-sidebar-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.asn-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: background 0.13s, color 0.13s;
    position: relative;
}

.asn-item:hover { background: #f1f5f9; color: #0f172a; }

.asn-item.active {
    background: linear-gradient(135deg, #f0fdfa, #e0f2fe);
    color: #0f766e;
}

.asn-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    margin-left: 2px;
}

.asn-tab-content { display: none; padding: 0 4px 12px; }
.asn-tab-content.active { display: block; }

.asn-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 4px;
}

.asn-quick-btn {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.13s, border-color 0.13s;
}

.asn-quick-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }

.asn-logout-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.asn-logout-btn {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.13s;
}

.asn-logout-btn:hover { background: #fecaca; }

.invite-box-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn-approve, .btn-reject {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.13s;
}

.btn-approve { background: #d1fae5; color: #065f46; }
.btn-approve:hover { background: #6ee7b7; }
.btn-reject { background: #fee2e2; color: #b91c1c; }
.btn-reject:hover { background: #fca5a5; }

.join-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.join-request-item > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.join-request-item > div span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.join-request-item > div small {
    font-size: 0.75rem;
    color: #64748b;
}

.join-request-item form {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Admin Panel Full-Page Mode ── */
.admin-panel-page {
    display: block;
    height: 100dvh;
    overflow-y: auto;
    background: #f0f2f5;
}

.admin-panel-page .room-sidebar {
    display: block !important;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    height: auto;
    max-height: none;
    overflow: visible;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    padding-bottom: 40px;
}

.admin-panel-page .chat-pane {
    display: none !important;
}

.admin-panel-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f0fdfa, #e0f2fe);
    flex-wrap: wrap;
}

.admin-panel-back {
    color: #0f766e;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    transition: background 0.13s;
    white-space: nowrap;
}

.admin-panel-back:hover {
    background: rgba(20, 184, 166, 0.22);
}

.admin-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Nav bar "Pengaturan" button */
.nav-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #075e54;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid rgba(7, 94, 84, 0.18);
    transition: background 0.13s;
}

.nav-settings-btn:hover {
    background: rgba(255, 255, 255, 0.32);
}

@media (max-width: 720px) {
    .admin-panel-page .room-sidebar {
        max-width: 100%;
        border-radius: 0;
        padding-bottom: 20px;
    }
    .nav-settings-btn {
        padding: 6px 9px;
        font-size: 0.78rem;
    }
}
