/* ===== Halaman profil & dashboard ===== */
.page { min-height: calc(100vh - 64px); padding: 28px 4vw 70px; }
.page-inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page-wide { max-width: 1100px; }
.page-title { font-family: var(--display); font-weight: 400; font-size: 44px; letter-spacing: 1px; line-height: 1; }

.panel { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.panel h2, .panel h3 { font-size: 17px; margin-bottom: 12px; }

/* ----- Profil ----- */
.profile-card { display: flex; align-items: center; gap: 20px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.profile-avatar { flex: none; width: 92px; height: 92px; display: grid; place-items: center; font-size: 52px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--red); }
.profile-id h1 { font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 8px; }
.avatar-option { aspect-ratio: 1; font-size: 26px; border-radius: 12px; border: 2px solid var(--line); background: var(--input); transition: transform .12s, border-color .12s; }
.avatar-option:hover { transform: scale(1.08); border-color: #5a5f73; }
.avatar-option.active { border-color: var(--red); background: rgba(229, 9, 20, .16); }

/* ----- Dashboard ----- */
.tabs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-pane { display: flex; flex-direction: column; gap: 16px; }
.manage-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.manage-toolbar > div { flex: 1; min-width: 220px; }
.manage-toolbar h2 { font-size: 20px; }
.manage-search { width: min(240px, 100%); }
.manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.manage-card, .room-manage { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.manage-card { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.manage-card.inactive, .room-manage.inactive { opacity: .72; }
.manage-thumb { flex: none; width: 58px; height: 82px; border-radius: 6px; }
.manage-thumb .poster-title { display: none; }
.sticker-thumb { flex: none; width: 82px; height: 82px; border-radius: 8px; background: var(--input); display: grid; place-items: center; overflow: hidden; font-size: 28px; }
.sticker-thumb img { width: 100%; height: 100%; object-fit: contain; }
.manage-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.manage-info strong { overflow-wrap: anywhere; }
.manage-info span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.manage-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.badge-pill { padding: 1px 8px; border-radius: 999px; background: #2b2e3b; font-size: 11px; font-weight: 600; color: #cfd1da !important; }
.badge-pill.ok { background: rgba(52, 211, 153, .15); color: var(--green) !important; }

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 36px; height: 20px; border-radius: 99px; background: #4a4e5e; transition: background .15s; }
.switch-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid #fff; outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }

/* ----- Room ----- */
.room-manage-list { display: grid; gap: 12px; }
.room-manage-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.room-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.room-members { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.room-members summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.member-rows { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13px; }
.member-row.kicked { opacity: .7; }
.member-row-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.presence { font-size: 12px; color: var(--muted); white-space: nowrap; }
.presence.online { color: var(--green); }
.presence.kicked { color: #fca5a5; }

/* ----- Intro ----- */
.intro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.intro-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.intro-card .form-grid { width: 100%; }

/* ----- Formulir dialog ----- */
.dialog-form { width: min(560px, calc(100vw - 32px)); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .form-full { grid-column: 1 / -1; }
.field-hint { display: block; margin-top: 5px; font-weight: 400; color: var(--muted); font-size: 12px; }
textarea.input { resize: vertical; font-family: inherit; }

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .tabs-4 { grid-template-columns: 1fr 1fr; }
  .profile-card { flex-direction: column; text-align: center; }
  .manage-actions { width: 100%; }
}
