/* Design System & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
    --bg-main: #0B0F19;
    --bg-panel: rgba(19, 27, 46, 0.7);
    --bg-card: #182238;
    --bg-card-hover: #1E2B47;
    --bg-card-selected: rgba(59, 130, 246, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --accent-glow: rgba(59, 130, 246, 0.35);
    
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --green-online: #10B981;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Auth Overlay Screen */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top, #1E2B47 0%, var(--bg-main) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow-y: auto;
    padding: 20px 10px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(19, 27, 46, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 32px;
    backdrop-filter: blur(16px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    margin: auto;
    box-sizing: border-box;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    color: var(--accent);
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.auth-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.auth-submit-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: all 0.2s ease;
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.auth-toggle-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-toggle-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle-link a:hover {
    text-decoration: underline;
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #EF4444;
    color: #F87171;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 16px;
    text-align: center;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: rgba(13, 18, 30, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-left: 8px;
}

.logo-icon {
    color: var(--accent);
    width: 28px;
    height: 28px;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.compose-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: all 0.2s ease;
    margin-bottom: 24px;
}

.compose-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.folders-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item .badge {
    margin-left: auto;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Sidebar action panel */
.sidebar-action-panel {
    border-top: 1px solid var(--border-color);
    padding: 16px 8px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invite-gen-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.2s ease;
}

.invite-gen-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.invite-gen-btn i {
    width: 16px;
    height: 16px;
}

.invite-feedback-msg {
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
}

.invite-feedback-msg.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--green-online);
    color: #34D399;
}

.invite-feedback-msg.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #EF4444;
    color: #F87171;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--green-online);
    box-shadow: 0 0 8px var(--green-online);
}

.system-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    overflow: hidden;
}

/* Top Header */
.top-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(13, 18, 30, 0.4);
    backdrop-filter: blur(10px);
}

.search-bar {
    position: relative;
    width: 320px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-bar input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px 8px 40px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

/* User Badge Header */
.user-badge-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 8px;
}

.user-badge-info {
    display: flex;
    flex-direction: column;
}

.user-badge-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge-email {
    font-size: 11px;
    color: var(--text-secondary);
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: color 0.15s ease;
}

.logout-btn:hover {
    color: #EF4444;
}

.logout-btn i {
    width: 18px;
    height: 18px;
}

/* Workspace Body columns layout */
.workspace-body {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* List Column */
.list-column {
    width: 360px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: rgba(13, 18, 30, 0.2);
}

.column-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.column-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.refresh-btn:hover {
    color: var(--text-primary);
}

.refresh-btn i, .refresh-btn svg {
    width: 18px;
    height: 18px;
}

.refresh-btn i.spinning, .refresh-btn svg.spinning, .refresh-btn .spinning {
    animation: spin 0.8s linear infinite;
}

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

.email-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.email-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.email-card.selected {
    background: var(--bg-card-selected);
    border-color: var(--accent);
}

.email-card.unread {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--accent);
}

.email-card.unread .sender {
    font-weight: 600;
    color: white;
}

.email-card.unread .subject {
    font-weight: 600;
    color: white;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.card-details {
    flex-grow: 1;
    min-width: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sender {
    font-size: 13px;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 180px;
}

.time {
    font-size: 11px;
    color: var(--text-muted);
}

.subject {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.snippet {
    font-size: 12px;
    color: var(--text-muted);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.empty-list-state, .placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 32px;
}

.empty-list-state {
    height: 200px;
    gap: 8px;
}

.empty-list-state i {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
}

/* Detail Column */
.detail-column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(13, 18, 30, 0.1);
    overflow: hidden;
}

.placeholder-state {
    flex-grow: 1;
    gap: 16px;
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.5;
}

.placeholder-state h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    color: var(--text-secondary);
}

.placeholder-state p {
    font-size: 14px;
    max-width: 320px;
}

/* Conversation Thread View */
.conversation-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.conversation-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.conversation-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.action-btn i {
    width: 14px;
    height: 14px;
}

.action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #EF4444;
    color: #F87171;
}

.messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.message-bubble-wrapper.sent {
    align-self: flex-end;
}

.message-bubble-wrapper.received {
    align-self: flex-start;
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
    margin-bottom: 6px;
}

.message-bubble-wrapper.sent .bubble-header {
    justify-content: flex-end;
}

.bubble-sender {
    color: var(--text-secondary);
    font-weight: 500;
}

.bubble-time {
    color: var(--text-muted);
}

.bubble-body {
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble-wrapper.sent .bubble-body {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.25));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-top-right-radius: 2px;
    color: white;
}

.message-bubble-wrapper.received .bubble-body {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-top-left-radius: 2px;
    color: var(--text-primary);
}

/* Inline Reply Area */
.reply-composer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(13, 18, 30, 0.3);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reply-header {
    font-size: 13px;
    color: var(--text-secondary);
}

.reply-composer textarea {
    width: 100%;
    height: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    resize: none;
    transition: all 0.2s ease;
}

.reply-composer textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

.send-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.send-btn:hover {
    background: var(--accent-hover);
}

/* Modal Overlay & Card styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    width: 580px;
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.form-row label {
    width: 60px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.body-row {
    border-bottom: none;
    flex-grow: 1;
    height: 250px;
}

.body-row textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    resize: none;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(13, 18, 30, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.save-status {
    font-size: 12px;
    color: var(--green-online);
}

.modal-actions-right {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* Password visibility styles */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-container input {
    width: 100%;
    padding-right: 46px !important; /* space for toggle button */
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: color 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.password-toggle-btn i {
    width: 18px;
    height: 18px;
}

/* AI Reply Button */
.ai-suggest-btn {
    background: rgba(139, 92, 246, 0.15); /* Purple tint */
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #C084FC;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.ai-suggest-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #A855F7;
    color: #E9D5FF;
}

.ai-suggest-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* recovery mode toggle */
.forgot-password-link {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    margin-top: 4px;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness & PWA Installer */
.mobile-back-btn, .mobile-menu-btn {
    display: none;
}

.pwa-prompt-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    z-index: 3000;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-prompt-card {
    background: rgba(19, 27, 46, 0.95);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pwa-prompt-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-prompt-icon i {
    width: 20px;
    height: 20px;
}

.pwa-prompt-info {
    flex-grow: 1;
}

.pwa-prompt-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.pwa-prompt-info p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.pwa-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pwa-btn-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px;
    text-align: center;
}

.pwa-btn-dismiss:hover {
    color: var(--text-secondary);
}

.pwa-btn-action {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.pwa-btn-action:hover {
    background: var(--accent-hover);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .list-column {
        width: 100%;
        border-right: none;
    }
    
    .detail-column {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-main);
        z-index: 50;
        display: none;
    }
    
    .app-container.show-detail .detail-column {
        display: flex;
    }
    
    .app-container.show-detail .list-column {
        display: none;
    }
    
    .mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 8px;
        margin-right: 8px;
        border-radius: 50%;
        transition: background 0.2s ease;
    }
    
    .mobile-back-btn:hover {
        background: rgba(255,255,255,0.05);
        color: var(--text-primary);
    }
    
    .mobile-back-btn i {
        width: 20px;
        height: 20px;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 8px;
        border-radius: 6px;
    }
    
    .mobile-menu-btn:hover {
        background: rgba(255,255,255,0.05);
        color: var(--text-primary);
    }
    
    .mobile-menu-btn i {
        width: 20px;
        height: 20px;
    }
    
    .search-bar {
        width: 180px;
    }
    
    .top-header {
        padding: 0 12px;
    }
    
    .user-badge-container {
        padding: 4px 8px;
        gap: 8px;
    }
    
    .user-badge-name, .user-badge-email {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Auth card mobile adaptations */
    .auth-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    .auth-header {
        margin-bottom: 20px;
    }
    .auth-header h2 {
        font-size: 22px;
    }
}

/* Creator Panel / Admin Styles */
:root {
    --accent-admin: #D97706;
    --accent-admin-hover: #F59E0B;
    --accent-admin-glow: rgba(217, 119, 6, 0.25);
    --accent-admin-purple: #8B5CF6;
}

.nav-admin-item:hover {
    background: rgba(217, 119, 6, 0.08) !important;
    border-color: rgba(217, 119, 6, 0.2) !important;
}

.nav-admin-item.active {
    background: rgba(217, 119, 6, 0.15) !important;
    border-left: 3px solid var(--accent-admin) !important;
    color: var(--accent-admin) !important;
}

.admin-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.4) !important;
}

.admin-table-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.admin-table-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-badge.creator {
    background: rgba(217, 119, 6, 0.15);
    color: var(--accent-admin);
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.admin-badge.standard {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Modal Forwarding Guide Styling */
.forwarding-step {
    margin-bottom: 16px;
}

.forwarding-step h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.forwarding-step p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.code-snippet {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11.5px;
    color: #a78bfa;
    overflow-x: auto;
    white-space: pre;
    margin-top: 6px;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 32px);
    max-width: 480px;
    background: rgba(19, 27, 46, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.pwa-install-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.pwa-install-icon img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.pwa-install-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pwa-install-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-install-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
    transition: all 0.2s ease;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.pwa-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.pwa-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* iOS Install Sheet styling */
.ios-share-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #fff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E") no-repeat center;
    vertical-align: middle;
    margin: 0 4px;
}

.ios-add-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #fff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='12' y1='8' x2='12' y2='16'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='12' y1='8' x2='12' y2='16'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3C/svg%3E") no-repeat center;
    vertical-align: middle;
    margin: 0 4px;
}

/* Trust Mesh Badges */
.trust-mesh-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.15); /* translucent emerald green */
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.trust-mesh-badge.invalid {
    background: rgba(239, 68, 68, 0.15); /* translucent red */
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.trust-mesh-badge svg, .trust-mesh-badge i {
    width: 12px;
    height: 12px;
}

/* Smart Attachments Compose Zone */
.attachment-zone {
    margin-top: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.attachment-zone:hover, .attachment-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.attachment-drop-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.attachment-drop-prompt svg, .attachment-drop-prompt i {
    width: 16px;
    height: 16px;
}

.attachment-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.attachment-item-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.attachment-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
    width: 100px;
}

.attachment-progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s ease;
}


