/* ===== Login Page ===== */
.login-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #eef2f7;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px 32px;
    width: min(420px, 100%);
    box-shadow: var(--shadow-lg);
}

.login-mark {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.login-title {
    font-size: 23px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

.room-subtitle {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

/* ===== Topbar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    min-height: 64px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 17px;
    font-weight: 800;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

/* ===== Dashboard ===== */
.dashboard-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-panel { padding: 20px; }
.sessions-panel { padding: 20px; min-width: 0; }

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.panel-heading h1 { font-size: 20px; margin-bottom: 4px; }
.panel-heading p,
.sessions-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.settings-form { display: flex; flex-direction: column; gap: 2px; }

.profile-setting {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.profile-setting:last-of-type { border-bottom: 1px solid var(--border); margin-bottom: 14px; }

.avatar-preview,
.session-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: #e0f2fe;
    color: #075985;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    overflow: hidden;
    border: 1px solid #bae6fd;
}
.avatar-preview img,
.session-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-setting-body strong { font-size: 14px; }
.profile-setting-body p { color: var(--text-muted); font-size: 12px; margin: 2px 0 10px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.form-status {
    min-height: 20px;
    color: var(--success);
    font-size: 13px;
    margin-bottom: 8px;
}
.form-status.is-error { color: var(--danger); }

.sessions-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.sessions-header h2 {
    font-size: 19px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sessions-sort select {
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
    cursor: pointer;
    outline: none;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color .15s, background .15s;
}
.session-item:hover { border-color: #93c5fd; }
.session-item.has-unread { border-color: var(--primary); background: #eff6ff; }
.session-item.is-pending { background: #fffdf5; }

.session-avatar {
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.session-info { min-width: 0; cursor: pointer; }
.session-name {
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.session-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.session-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.status-pending { background: #fef3c7; color: var(--warning); }
.status-active  { background: #dcfce7; color: #166534; }

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

.btn-danger-ghost {
    background: #fff;
    color: var(--danger);
    border: 1px solid #fecaca;
}
.btn-danger-ghost:hover { background: #fef2f2; }

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
    font-size: 15px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.room-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 12px;
    padding: 10px 12px;
    background: #eff6ff;
    border-radius: var(--radius-sm);
}
.room-name-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.room-name-value { font-size: 16px; font-weight: 800; color: var(--primary); }
.generated-result { margin-top: 10px; }

/* ===== About ===== */
.about-card {
    max-width: 640px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px 32px;
    box-shadow: var(--shadow);
    text-align: center;
}
.about-mark { margin-bottom: 14px; }
.about-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.about-version { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }
.about-section {
    text-align: left;
    margin-bottom: 26px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}
.about-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.about-section h2 { font-size: 14px; font-weight: 800; color: var(--text-muted); margin-bottom: 12px; }
.about-license {
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
}
.about-license p { margin-bottom: 8px; }
.about-license p:last-child { margin-bottom: 0; }
.contact-item { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.contact-label { color: var(--text-muted); width: 32px; }
.contact-value { color: var(--primary); font-weight: 700; }
.about-tech { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tag {
    padding: 5px 10px;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

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

@media (max-width: 640px) {
    .login-card { padding: 28px 20px; }
    .topbar { padding: 10px 12px; align-items: flex-start; flex-direction: column; }
    .topbar-actions { width: 100%; justify-content: stretch; }
    .topbar-actions .btn { flex: 1; }
    .dashboard-main { padding: 14px 10px; }
    .settings-panel,
    .sessions-panel { padding: 16px; }
    .sessions-header { flex-direction: column; }
    .sessions-sort,
    .sessions-sort select { width: 100%; }
    .session-item { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
    .session-avatar { width: 44px; height: 44px; }
    .session-actions { grid-column: 1 / -1; justify-content: stretch; }
    .session-actions .btn { flex: 1; }
    .profile-setting { grid-template-columns: 48px minmax(0, 1fr); }
    .avatar-preview { width: 48px; height: 48px; }
    .about-card { padding: 26px 18px; }
}