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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    color: #111;
    font-size: 14px;
    line-height: 1.5;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}

.nav-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 24px;
    width: auto;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-size: 12px;
    text-decoration: none;
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #111;
}

.nav-user {
    font-size: 12px;
    color: #555;
    letter-spacing: 1px;
}

/* Flash messages */
.flash-container {
    padding: 0 32px;
}

.flash {
    padding: 12px 20px;
    margin-top: 16px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
}

.flash-error {
    border-color: #d32f2f;
    color: #d32f2f;
}

.flash-success {
    border-color: #2e7d32;
    color: #2e7d32;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Auth pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 40px 24px;
}

.auth-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04),
                0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.logo-circle {
    width: 56px;
    height: 56px;
    border: 2px solid #111;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 300;
    color: #111;
    letter-spacing: 1px;
}

.logo-text {
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 4px;
    color: #111;
    margin-left: 2px;
}

.auth-subtitle {
    text-align: center;
    font-size: 15px;
    color: #666;
    margin-bottom: 32px;
}

.auth-card h2 {
    font-weight: 300;
    font-size: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #344054;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder {
    color: #98a2b3;
}

.form-group input:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.form-group input[readonly] {
    color: #888;
    background: #f9fafb;
}

.btn {
    display: inline-block;
    height: 44px;
    padding: 0 32px;
    background: #111;
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.btn:hover {
    background: #333;
}

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

.btn-full {
    width: 100%;
    text-align: center;
}

.form-errors {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
}

/* Admin panel */
.admin-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 32px;
    width: 100%;
    overflow-y: auto;
    flex: 1;
}

.admin-container h2 {
    font-weight: 300;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

.admin-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-family: inherit;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.admin-tab:hover {
    color: #111;
}

.admin-tab.active {
    color: #111;
    border-bottom-color: #111;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 32px;
    margin-bottom: 32px;
}

.admin-section h3 {
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #555;
}

/* Admin chat */
.admin-chat {
    display: flex;
    border: 1px solid #e0e0e0;
    border-top: none;
    height: 520px;
    background: #fff;
}

.admin-chat-sidebar {
    width: 250px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.admin-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    min-width: 0;
}

.admin-chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 12px;
    min-height: 49px;
}

.admin-chat-header.visible {
    display: flex;
}

.invite-result {
    margin-top: 20px;
    padding: 16px;
    background: #f5f5f5;
    font-size: 13px;
    display: none;
}

.invite-result .invite-link {
    word-break: break-all;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #111;
}

.invite-result .invite-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.code-cell {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
}

.status-used {
    color: #888;
}

.status-pending {
    color: #2e7d32;
}

/* Chat layout */
.chat-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.chat-sidebar {
    width: 260px;
    border-right: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.btn-new-chat {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    color: #555;
    transition: all 0.2s;
}

.btn-new-chat:hover {
    border-color: #111;
    color: #111;
}

.conv-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
}

.conv-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.conv-item:hover {
    background: #f5f5f5;
}

.conv-item.active {
    background: #f0f0f0;
}

.conv-item .conv-name {
    font-size: 13px;
    font-weight: 500;
}

.conv-item .conv-preview {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    min-height: 0;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    padding: 0;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
}

.message .message-sender {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.message .message-time {
    font-size: 11px;
    color: #aaa;
    margin-left: 8px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.message .message-body {
    font-size: 14px;
    line-height: 1.5;
}

.message.own {
    align-self: flex-end;
}

.message.own .message-sender {
    text-align: right;
}

.message.own .message-body {
    text-align: right;
}

.typing-indicator {
    padding: 0 24px 8px;
    font-size: 12px;
    color: #aaa;
    height: 20px;
    flex-shrink: 0;
}

.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}

.chat-input-form {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    outline: none;
}

.chat-input:focus {
    border-bottom-color: #111;
}

.btn-send {
    padding: 10px 24px;
    background: #111;
    color: #fff;
    border: none;
    font-size: 11px;
    font-family: inherit;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #333;
}

.chat-empty {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ccc;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* New chat modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 32px;
    width: 100%;
    max-width: 360px;
}

.modal h3 {
    font-weight: 300;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.user-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.user-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.15s;
}

.user-list li:hover {
    color: #555;
}

.modal-search {
    margin-bottom: 16px;
}

.modal-search .form-group {
    margin-bottom: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.search-result-item:hover {
    border-color: #111;
    background: #f9fafb;
}

.search-result-name {
    font-size: 14px;
    font-weight: 500;
}

.modal-close {
    margin-top: 16px;
    background: none;
    border: 1px solid #e0e0e0;
    padding: 8px 20px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
}

/* Inline form (admin invite) */
.inline-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.inline-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.copy-btn {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 4px 12px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
}

.copy-btn:hover {
    border-color: #111;
}

.btn-report {
    font-size: 11px;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #555;
    border: 1px solid #d0d5dd;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-report:hover {
    border-color: #111;
    color: #111;
}

/* Mic permission help modal */
.mic-help-modal {
    max-width: 380px;
}

.mic-help-intro {
    font-size: 14px;
    color: #555;
    margin-bottom: 16px;
    line-height: 1.5;
}

.mic-help-browser {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.mic-help-list {
    font-size: 13px;
    color: #333;
    line-height: 1.7;
    margin: 0 0 20px 18px;
    padding: 0;
}

.mic-help-list b {
    color: #111;
}

.mic-help-tip {
    font-size: 12px;
    color: #777;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* Face Logs (admin) */
.face-log-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.status-pass {
    color: #2e7d32;
    font-weight: 600;
    font-size: 12px;
}

.status-fail {
    color: #d32f2f;
    font-weight: 600;
    font-size: 12px;
}

.type-login {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 600;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.type-periodic {
    background: #f3e5f5;
    color: #7b1fa2;
    font-weight: 600;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.type-enrollment {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.face-logs-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.face-logs-filters select {
    padding: 6px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.face-logs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.btn-page {
    padding: 4px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}

.btn-page:hover {
    background: #f5f5f5;
}

.page-info {
    font-size: 12px;
    color: #666;
}

/* Face verification / enrollment */
.face-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
}

.webcam-container {
    margin-bottom: 20px;
}

.webcam-container video {
    width: 100%;
    display: none;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
}

.captured-preview {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
}

.face-status {
    font-size: 13px;
    margin: 12px 0;
    min-height: 20px;
}

.face-status-success {
    color: #2e7d32;
}

.face-status-error {
    color: #d32f2f;
}

.btn-outline {
    background: transparent;
    color: #111;
    border: 1px solid #d0d5dd;
}

.btn-outline:hover {
    border-color: #111;
    background: transparent;
}

/* Avatars */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-default {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.nav-right .avatar,
.nav-right .avatar-default {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.conv-item-info {
    flex: 1;
    min-width: 0;
}

.avatar-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
}

.online-dot-header {
    position: static;
    border: none;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

.unread-badge {
    background: #111;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}

.read-receipt {
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
}

.message {
    display: flex;
    gap: 10px;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message.own {
    flex-direction: row-reverse;
}

.message.own .message-content {
    text-align: right;
}

/* Attachment button */
.btn-attach {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.btn-attach:hover {
    color: #111;
}

/* Microphone button */
.btn-mic {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.btn-mic:hover {
    color: #111;
}

.btn-mic.recording {
    color: #d32f2f;
}

/* Recording indicator bar */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: #fff5f5;
    border-bottom: 1px solid #f5c6c6;
    font-size: 13px;
    color: #d32f2f;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #d32f2f;
    border-radius: 50%;
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.recording-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.recording-cancel {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #d32f2f;
    padding: 0 4px;
    margin-left: auto;
    line-height: 1;
}

.recording-cancel:hover {
    color: #b71c1c;
}

/* Attachment preview bar */
.attachment-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    color: #555;
}

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

.attachment-remove {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
    line-height: 1;
}

.attachment-remove:hover {
    color: #d32f2f;
}

/* Attachment in message */
.message-attachment {
    margin: 6px 0;
}

.attachment-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: block;
}

.attachment-link {
    display: inline-block;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    color: #111;
    text-decoration: none;
    transition: border-color 0.15s;
}

.attachment-link:hover {
    border-color: #111;
}

/* Audio player in message bubbles */
.attachment-audio {
    display: block;
    width: 100%;
    max-width: 300px;
    height: 40px;
    border-radius: 20px;
}

/* Download / Landing page */
.download-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 40px 24px;
}

.download-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04),
                0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.download-tagline {
    font-size: 18px;
    font-weight: 400;
    color: #111;
    margin-bottom: 12px;
}

.download-description {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 32px;
}

.download-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 32px;
}

.download-buttons {
    margin-bottom: 12px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 10px;
}

.download-also,
.download-alt {
    font-size: 12px;
    color: #888;
    margin-bottom: 24px;
}

.download-link {
    color: #111;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.download-link:hover {
    color: #555;
}

.download-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 24px 0;
}

.download-note {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.download-mobile {
    font-size: 12px;
    color: #aaa;
}

.download-code-form {
    margin-bottom: 24px;
}

.invite-code-input {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-align: center;
}

.invite-key-display {
    background: #f9fafb;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.invite-key-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.invite-key-code {
    font-size: 16px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    color: #111;
    word-break: break-all;
    letter-spacing: 0.5px;
}

/* Admin header with logout */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-header h2 {
    margin-bottom: 0;
}

.btn-admin-logout {
    font-size: 12px;
    color: #888;
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: color 0.2s, border-color 0.2s;
}

.btn-admin-logout:hover {
    color: #111;
    border-color: #111;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {

    /* Prevent horizontal scroll globally */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Nav */
    .nav {
        padding: 12px 16px;
    }

    .nav-logo {
        height: 20px;
    }

    .nav-right {
        gap: 10px;
    }

    .nav-user {
        display: none;
    }

    /* Flash messages */
    .flash-container {
        padding: 0 16px;
    }

    /* Auth pages */
    main:has(.auth-container) {
        overflow: visible;
        overflow-y: auto;
    }

    .auth-container {
        align-items: flex-start;
        padding: 24px 16px;
        overflow-y: auto;
    }

    .auth-card {
        padding: 32px 20px;
    }

    .auth-logo {
        margin-bottom: 16px;
    }

    .auth-subtitle {
        margin-bottom: 16px;
    }

    .face-subtitle {
        margin-bottom: 16px;
    }

    .webcam-container video {
        max-height: 40vh;
        object-fit: cover;
    }

    .captured-preview {
        max-height: 40vh;
        object-fit: cover;
    }

    .logo-circle {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .logo-text {
        font-size: 18px;
        letter-spacing: 3px;
    }

    /* Chat layout — full-screen single view toggle */
    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100%;
        flex: 1;
        border-right: none;
        border-bottom: none;
    }

    .chat-main {
        display: none;
        width: 100%;
        min-width: 0;
    }

    .chat-container.chat-active .chat-sidebar {
        display: none;
    }

    .chat-container.chat-active .chat-main {
        display: flex;
        flex: 1;
    }

    .back-btn {
        display: block;
    }

    .chat-empty {
        font-size: 12px;
    }

    .sidebar-header {
        padding: 16px;
    }

    .conv-item {
        padding: 14px 16px;
    }

    /* Messages */
    .chat-messages {
        padding: 12px;
    }

    .message {
        max-width: 85%;
    }

    .message .message-sender {
        font-size: 10px;
    }

    .message .message-body {
        font-size: 13px;
    }

    .avatar, .avatar-default {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .online-dot {
        width: 10px;
        height: 10px;
    }

    .unread-badge {
        font-size: 9px;
        min-width: 16px;
        height: 16px;
    }

    /* Chat input — compact for mobile */
    .chat-input-area {
        padding: 10px 12px;
    }

    .chat-input-form {
        gap: 8px;
    }

    .chat-input {
        font-size: 16px;
        min-width: 0;
    }

    .btn-send {
        padding: 10px 16px;
        font-size: 10px;
        letter-spacing: 1px;
        flex-shrink: 0;
    }

    .btn-attach {
        flex-shrink: 0;
    }

    .typing-indicator {
        padding: 0 12px 6px;
    }

    /* Attachments mobile */
    .attachment-preview {
        padding: 8px 12px;
    }

    .attachment-image {
        max-width: 100%;
        max-height: 240px;
    }

    .attachment-link {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .attachment-audio {
        max-width: 100%;
    }

    .recording-indicator {
        padding: 8px 12px;
    }

    /* Modal */
    .modal {
        padding: 24px 20px;
        margin: 0 16px;
        max-width: none;
        width: calc(100% - 32px);
    }

    /* Admin panel */
    .admin-container {
        padding: 24px 16px;
    }

    .admin-tabs {
        overflow-x: auto;
    }

    .admin-tab {
        padding: 10px 16px;
        font-size: 11px;
        white-space: nowrap;
    }

    .admin-section {
        padding: 20px 16px;
        overflow-x: auto;
    }

    .admin-chat {
        flex-direction: column;
        height: 460px;
    }

    .admin-chat-sidebar {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .inline-form {
        flex-direction: column;
    }

    .inline-form .btn {
        width: 100%;
        text-align: center;
    }

    /* Download page mobile */
    .download-container {
        padding: 24px 16px;
    }

    .download-card {
        padding: 32px 20px;
    }
}
