@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* 
 * Alumni Mail Premium Theme Stylesheet
 * Advanced dark-mode, glassmorphism, responsive E2EE client dashboard
 */

:root {
    --bg-base: #131313;
    --bg-card: #1f1f1f;
    --bg-panel: #1b1b1b;
    --border-color: #444748;
    --border-glow: #8e9192;
    
    --text-main: #e2e2e2;
    --text-muted: #cbd5e1;
    --text-dark: #8e9192;
    
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.15);
    --accent-light: #ffffff;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    --success-light: #34d399;
    
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    
    --danger: #ff453a;
    --danger-glow: rgba(255, 69, 58, 0.25);
    
    --font-sans: 'Hanken Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

body {
    font-family: var(--font-sans);
    font-weight: 300;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Background Glowing Orbs */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.bg-glow-monochrome {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation: floatingGlow 15s infinite alternate;
}

.bg-glow-emerald {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation: floatingGlow 18s infinite alternate-reverse;
}

@keyframes floatingGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Glassmorphism Panel styles */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 12px;
}

/* -----------------------------------------
   UTILITIES
   ----------------------------------------- */
.hidden { display: none !important; }
.bold { font-weight: 400; }
.font-mono { font-family: var(--font-mono); }
.font-size-sm { font-size: 0.8rem; }
.text-center { text-align: center; }
.margin-t { margin-top: 1rem; }
.margin-b { margin-bottom: 1rem; }
.border-b { border-bottom: 1px solid var(--border-color); }
.highlight { color: var(--accent-light); }

.badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    display: inline-block;
    border: 1px solid transparent;
}
.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.3);
}
.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.badge-mini {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.pulsing {
    animation: pulsing 1.5s infinite alternate;
}
@keyframes pulsing {
    0% { transform: scale(0.9); opacity: 0.5; box-shadow: 0 0 2px var(--success-glow); }
    100% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 10px var(--success); }
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    border: 1px solid transparent;
}
.alert.warning {
    background: rgba(245, 158, 11, 0.08);
    color: #f7ac25;
    border-color: rgba(245, 158, 11, 0.2);
}
.alert.success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.2);
}

/* -----------------------------------------
   BUTTONS
   ----------------------------------------- */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}
.btn.primary {
    background: var(--accent);
    color: #000000;
}
.btn.primary:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}
.btn.primary.glow:hover {
    box-shadow: 0 0 15px var(--accent-glow);
}
.btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
.btn.danger {
    background: var(--danger);
    color: white;
}
.btn.danger:hover {
    background: #e03b30;
    box-shadow: 0 0 15px var(--danger-glow);
}
.btn.full-width { width: 100%; }
.btn.btn-tiny {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* -----------------------------------------
   INPUT FIELDS
   ----------------------------------------- */
.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.input-field:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px var(--border-glow);
    background: rgba(0, 0, 0, 0.4);
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    right: 14px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* -----------------------------------------
   SECTION 1: AUTH SCREEN
   ----------------------------------------- */
.auth-wrapper {
    display: none;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}
.auth-wrapper.active {
    display: flex;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 40px;
    animation: authCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes authCardEntrance {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.auth-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.brand-logo {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(0,0,0,0.6) 100%);
    border: 1px solid var(--border-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow);
}
.brand-logo .logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.logo-img {
    max-width: 24px;
    max-height: 24px;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.auth-header .logo-img {
    max-width: 100%;
    max-height: 100%;
}
.logo-img-inline {
    vertical-align: middle;
    height: 1.1em;
    width: 1.1em;
    object-fit: contain;
    margin-right: 4px;
    display: inline-block;
}
.secure-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px var(--success-light));
}
.logo-lock {
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tab-btn.active {
    background: #050505;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.auth-form {
    display: none;
    flex-direction: column;
    gap: 18px;
}
.auth-form.active {
    display: flex;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.domain-select-wrapper .input-field {
    padding-right: 140px;
}
.domain-badge {
    position: absolute;
    right: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    pointer-events: none;
}
.helper-text {
    font-size: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
}
.auth-error-msg {
    color: var(--danger);
    font-size: 0.8rem;
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 10px 14px;
    border-radius: 6px;
    line-height: 1.4;
}

/* -----------------------------------------
   SECTION 2: CRYPTO LOADING OVERLAY
   ----------------------------------------- */
.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.overlay-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}
.crypto-spinner {
    width: 80px;
    height: 80px;
    border: 3px solid transparent;
    border-top-color: var(--accent-light);
    border-bottom-color: var(--success-light);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}
.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.crypto-steps {
    width: 100%;
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.8rem;
}
.step {
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}
.step.active {
    color: var(--accent-light);
}
.step.completed {
    color: var(--success-light);
}

/* -----------------------------------------
   SECTION 3: MAILBOX DASHBOARD VIEW
   ----------------------------------------- */
.dashboard-wrapper {
    display: flex;
    width: 100vw;
    height: calc(100vh - 44px); /* Leaving room for auditor console minimized height */
    overflow: hidden;
    z-index: 5;
}
.sidebar {
    width: 280px;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    flex-shrink: 0;
    z-index: 10;
    overflow: hidden;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.sidebar .brand h2 {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.5px;
}
.logo-glow {
    font-size: 1.4rem;
    text-shadow: 0 0 10px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-glow .logo-img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.25));
}

.session-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.25);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    flex-shrink: 0;
}
.session-user-info .avatar {
    font-size: 1.4rem;
}
.session-user-info .user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.session-user-info .username {
    font-size: 0.85rem;
    font-weight: 700;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--font-mono);
}
.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.status-indicator-wrapper .status-text {
    font-size: 0.7rem;
    color: var(--text-dark);
}

.compose-btn {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
    flex-shrink: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.nav-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-links li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}
.nav-links li:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}
.nav-links li.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-light);
    border-color: rgba(255, 255, 255, 0.15);
}
.nav-badge {
    position: absolute;
    right: 12px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}
.nav-divider {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-top: 15px;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    padding-left: 10px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.system-node {
    font-size: 0.7rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* -----------------------------------------
   MAIN CONTENT AREA
   ----------------------------------------- */
.main-content {
    flex-grow: 1;
    height: 100%;
    background: #0a0a0a;
    padding: 15px;
}
.view-section {
    width: 100%;
    height: 100%;
    padding: 24px;
    overflow-y: auto;
    animation: fadeView 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeView {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.view-header {
    margin-bottom: 24px;
}
.view-header h2 {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: -0.5px;
}

/* MAIL WORKSPACE */
.mail-workspace {
    display: none;
    width: 100%;
    height: 100%;
    gap: 15px;
}
.mail-workspace.active {
    display: flex;
}
.email-list-pane {
    width: 360px;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.pane-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pane-header h2 {
    font-size: 1.1rem;
    font-weight: 400;
}
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar .input-field {
    padding-right: 36px;
    font-size: 0.8rem;
}
.search-icon {
    position: absolute;
    right: 12px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.email-list-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.empty-state-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.empty-icon {
    font-size: 2.2rem;
}
.email-card {
    padding: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.email-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}
.email-card.active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}
.email-card.unread {
    border-left: 3px solid var(--accent-light);
}
.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-sender {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-main);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 180px;
    font-family: var(--font-mono);
}
.card-date {
    font-size: 0.7rem;
    color: var(--text-dark);
}
.card-subject {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-muted);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.card-snippet {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* EMAIL VIEW DETAIL PANE */
.email-detail-pane {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.detail-empty {
    margin: auto;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}
.detail-empty:empty {
    display: none !important;
}
.secure-logo-glow {
    width: 64px;
    height: 64px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--success-glow);
    animation: pulseGlow 2s infinite alternate;
}
@keyframes pulseGlow {
    from { box-shadow: 0 0 10px var(--success-glow); }
    to { box-shadow: 0 0 25px var(--success); }
}
.crypto-badge-group {
    display: flex;
    gap: 8px;
}
.crypt-pill {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-muted);
}

.mobile-back-nav {
    display: none;
}

.detail-active {
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 18px;
}
.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.meta-row {
    font-size: 0.8rem;
    display: flex;
    gap: 8px;
}
.meta-label { color: var(--text-dark); width: 45px; }
.meta-value { color: var(--text-muted); }
.detail-actions {
    display: flex;
    gap: 8px;
}

.security-card {
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.04) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}
.security-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.secure-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.secure-indicator-dot.secure { background: var(--success); box-shadow: 0 0 8px var(--success); }
.secure-indicator-dot.warning { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.security-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success-light);
}
.security-card-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.email-subject {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.email-body-wrapper {
    flex-grow: 1;
    min-height: 150px;
}
.email-body-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
}

.email-body-cipher {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.email-body-cipher label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--accent-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.email-body-cipher pre {
    background: #050505;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-size: 0.75rem;
    color: #00ff88;
    overflow-x: auto;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

/* -----------------------------------------
   VIEW B: DOMAINS WORKSPACE
   ----------------------------------------- */
.domain-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 15px;
    height: calc(100% - 60px);
}
.domain-card {
    padding: 20px;
    height: 100%;
}
.domain-card.expand-2 {
    overflow-y: auto;
}
.flex-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.domain-card h3 {
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.simple-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.active-domains-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.active-domains-list h4 {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-dark);
    text-transform: uppercase;
}
.active-domains-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}
.active-domains-list li {
    padding: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.active-domains-list li:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.active-domains-list li.active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}
.active-domains-list .empty-li {
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    justify-content: center;
    pointer-events: none;
}

.dns-empty {
    margin: auto;
    text-align: center;
    max-width: 320px;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.dns-icon {
    font-size: 2rem;
}

.dns-panel-active {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.dns-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dns-table {
    width: 100%;
    border-collapse: collapse;
}
.dns-table th, .dns-table td {
    padding: 10px;
    font-size: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.dns-table th {
    color: var(--text-dark);
    text-transform: uppercase;
    font-weight: bold;
}
.record-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.65rem;
}
.record-badge.mx { background: rgba(255, 255, 255, 0.12); color: var(--accent-light); }
.record-badge.txt { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.copyable {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.copyable:hover {
    background: rgba(255, 255, 255, 0.08);
}
.status-icon {
    font-family: var(--font-sans);
    font-weight: 600;
}
.status-icon.verified { color: var(--success-light); }

.dns-wizard-actions {
    display: flex;
    justify-content: flex-end;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.alias-form {
    display: flex;
    gap: 10px;
}
.alias-input-wrapper {
    flex-grow: 1;
}
.alias-input-wrapper .input-field {
    padding-right: 140px;
}
.alias-domain-badge {
    position: absolute;
    right: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
}
.deployed-aliases-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.deployed-aliases-list h4 {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-dark);
    text-transform: uppercase;
}
.deployed-aliases-list ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.deployed-aliases-list li {
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.15);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alias-badge-secure {
    font-size: 0.65rem;
    background: var(--success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* -----------------------------------------
   VIEW C: KEY MANAGER
   ----------------------------------------- */
.keys-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    height: calc(100% - 60px);
}
.key-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}
.key-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.key-meta-info {
    font-size: 0.85rem;
    display: flex;
    gap: 8px;
}
.key-meta-info label { color: var(--text-dark); }
.key-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.key-field label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-muted);
}
.key-field pre {
    background: #050505;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.7rem;
    color: var(--accent-light);
    max-height: 110px;
    overflow-y: auto;
    word-break: break-all;
    white-space: pre-wrap;
}
.key-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.key-panel table {
    width: 100%;
    border-collapse: collapse;
}
.key-panel th, .key-panel td {
    padding: 10px;
    font-size: 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.key-panel th {
    color: var(--text-dark);
    text-transform: uppercase;
}
.key-panel td {
    font-family: var(--font-mono);
}

/* -----------------------------------------
   VIEW D: SETTINGS
   ----------------------------------------- */
.settings-content {
    max-width: 600px;
}
.settings-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.settings-card h3 {
    font-size: 1rem;
    color: var(--danger);
}

/* -----------------------------------------
   MODAL DIALOG POPUPS
   ----------------------------------------- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 9, 19, 0.75);
    backdrop-filter: blur(4px);
    z-index: 300; /* Sit clearly above mobile header, sidebar, and backdrops */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.modal-card {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 24px;
    width: 100%;
    animation: modalEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.composer-card {
    width: 100%;
    max-width: 640px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: modalEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalEntrance {
    from { opacity: 0; transform: scale(0.97) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.composer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.close-composer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.close-composer-btn:hover { color: var(--danger); }

.btn-icon-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.btn-icon-close:hover {
    color: var(--danger);
    background: rgba(255, 69, 58, 0.1);
    transform: rotate(90deg);
}

.composer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.composer-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    width: 60px;
}
.composer-row .input-field, .composer-row select {
    flex-grow: 1;
}

.composer-security-status {
    padding: 10px 14px;
    margin-bottom: 10px;
    background: rgba(16, 185, 129, 0.04) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}
.composer-security-status.plaintext {
    background: rgba(245, 158, 11, 0.04) !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
}
.composer-sec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.composer-sec-row .status-dot.emerald { background: var(--success); box-shadow: 0 0 8px var(--success); }
.composer-sec-row .status-dot.amber { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.composer-sec-row .status-dot.blue { background: var(--accent-light); box-shadow: 0 0 8px var(--accent-light); }

.sec-right-options {
    font-size: 0.75rem;
}
.switch-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}
.switch-wrapper input {
    cursor: pointer;
}

.password-opts-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    animation: panelSlide 0.25s forwards;
}
@keyframes panelSlide {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.composer-body {
    width: 100%;
}
.composer-textarea {
    min-height: 200px;
    font-family: var(--font-sans);
    resize: vertical;
}
.composer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 5px;
}

/* EXTERNAL READER MODAL */
.external-reader-card {
    width: 100%;
    max-width: 480px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.reader-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
}
.hint-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--warning);
    margin-top: 10px;
}

/* -----------------------------------------
   SECTION 6: SECURITY AUDITOR PANEL
   ----------------------------------------- */
.auditor-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: #050505;
    border-top: 2px solid var(--border-color);
    z-index: 80;
    display: flex;
    flex-direction: column;
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.auditor-container.minimized {
    height: 44px;
}
.auditor-container.expanded {
    height: 350px;
}

.auditor-header {
    height: 42px;
    min-height: 42px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
    user-select: none;
}
.auditor-header:hover {
    background: rgba(255,255,255,0.05);
}
.auditor-header-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}
.auditor-pulse {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 6px #00ff88;
    animation: miniPulse 1s infinite alternate;
}
@keyframes miniPulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}
.btn-icon-auditor {
    background: transparent;
    border: none;
    color: var(--accent-light);
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
}

.auditor-tabs {
    display: flex;
    background: #0e0e0e;
    border-bottom: 1px solid var(--border-color);
}
.auditor-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-dark);
    padding: 10px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 1px solid var(--border-color);
}
.auditor-tab-btn:hover {
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}
.auditor-tab-btn.active {
    color: var(--accent-light);
    background: #010205;
    border-bottom: 2px solid var(--accent);
}

.auditor-body {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}
.auditor-panel-content {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding: 15px;
}
.auditor-panel-content.active {
    display: flex;
}

.auditor-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.logs-container {
    flex-grow: 1;
    background: #000000;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    font-size: 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}
.log-line {
    line-height: 1.4;
    word-break: break-all;
}
.log-line.system { color: #888888; }
.log-line.select { color: #cbd5e1; } /* SQL select */
.log-line.insert { color: #34d399; } /* SQL insert */
.log-line.update { color: #fbbf24; } /* SQL update */
.log-line.delete { color: #f87171; } /* SQL delete */
.log-line.payload-info {
    color: #e2e8f0;
    padding-left: 15px;
    font-size: 0.7rem;
    opacity: 0.8;
}

/* In-Memory Tab Specific */
.memory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    height: calc(100% - 30px);
}
.memory-box {
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.memory-box h4 {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--accent-light);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}
.value-label {
    background: #000000;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    font-size: 0.7rem;
    color: #00ff88;
    overflow-y: auto;
    word-break: break-all;
    white-space: pre-wrap;
    flex-grow: 1;
}

/* Mobile Header Styles */
.mobile-header {
    display: none;
}
.sidebar-backdrop {
    display: none;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 60px;
        padding: 0 20px;
        background: rgba(6, 9, 19, 0.85);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 160; /* Raised above backdrop (140) and sidebar (150) to keep menu button visible and clickable */
        flex-shrink: 0;
    }
    
    .mobile-menu-btn {
        background: transparent;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px; /* Increased to 44px for perfect mobile accessibility tap target */
        height: 44px;
        padding: 0;
        z-index: 170;
        margin-left: -11px; /* Align visually with header bounds */
    }
    
    .hamburger-bar {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-main);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .mobile-menu-btn.active .hamburger-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-btn.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active .hamburger-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .mobile-brand h2 {
        font-size: 1rem;
        font-weight: 800;
        margin: 0;
        letter-spacing: -0.5px;
    }
    
    .dashboard-wrapper {
        flex-direction: column;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
    }
    
    .sidebar {
        position: fixed;
        top: 60px; /* Offset completely by mobile header */
        left: 0;
        width: 280px;
        height: calc(100vh - 60px); /* Fill remaining viewport */
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        border-right: 1px solid var(--border-color);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
        background: rgba(6, 9, 19, 0.96);
        backdrop-filter: blur(20px);
        overflow-y: auto;
        border-radius: 0;
        padding: 20px;
        visibility: hidden; /* Hide completely when closed to prevent touch interception */
    }
    
    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }
    
    .sidebar .brand {
        display: none; /* Redundant on mobile header layout */
    }
    
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: 60px; /* Offset completely by mobile header */
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px); /* Fill remaining viewport */
        background: rgba(2, 4, 9, 0.7);
        backdrop-filter: blur(4px);
        z-index: 140;
        opacity: 0;
        pointer-events: none;
        visibility: hidden; /* Hide completely when inactive to prevent touch/render interference */
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }
    
    .main-content {
        height: calc(100vh - 60px);
        overflow: hidden;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    
    .mail-workspace {
        flex-direction: column;
        height: 100%;
        display: flex;
        overflow: hidden;
    }
    
    .email-list-pane {
        width: 100% !important;
        height: 100% !important;
        border-right: none !important;
        border-bottom: none !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Hide Inbox list completely when email is active */
    .mail-workspace:has(#email-detail-active:not(.hidden)) .email-list-pane {
        display: none !important;
    }
    
    .email-detail-pane {
        width: 100% !important;
        height: 100% !important;
        display: none !important;
        flex-direction: column !important;
        border-left: none !important;
    }
    
    /* Display Email detail full-height when active */
    .mail-workspace:has(#email-detail-active:not(.hidden)) .email-detail-pane {
        display: flex !important;
        overflow-y: auto !important;
    }
    
    /* Mobile Glassy Back Navigation Bar */
    .mobile-back-nav {
        display: block !important;
        margin-bottom: 12px;
        width: 100%;
    }
    .back-to-list-btn {
        width: 100%;
        justify-content: flex-start !important;
        font-weight: 600;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-main) !important;
        backdrop-filter: blur(12px) !important;
        border-radius: 6px !important;
        padding: 10px 14px !important;
        transition: all 0.2s ease !important;
    }
    .back-to-list-btn:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: var(--accent-light) !important;
    }
    
    .domain-grid {
        grid-template-columns: 1fr;
    }
    
    .keys-grid {
        grid-template-columns: 1fr;
    }
    
    .memory-grid {
        grid-template-columns: 1fr;
    }

    /* PREMIUM MOBILE LAYOUT COMPATIBILITY OVERRIDES (NO SIDE SCROLLING) */
    html, body, .dashboard-wrapper, .main-content, .mail-workspace, .email-detail-pane, .email-list-pane {
        max-width: 100vw;
        overflow-x: hidden !important;
    }

    .detail-active {
        padding: 16px;
        gap: 15px;
        overflow-x: hidden !important;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding-bottom: 14px;
    }
    
    .detail-meta {
        width: 100%;
        overflow: hidden;
    }

    .meta-row {
        flex-wrap: wrap;
        word-break: break-all;
    }
    
    .detail-actions {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    
    .detail-actions .btn {
        flex-grow: 1;
        padding: 8px 12px;
        font-size: 0.8rem;
        justify-content: center;
    }

    .calendar-layout, .calls-layout {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .dialer-actions {
        flex-direction: column;
        gap: 8px;
    }

    .dialer-actions .btn {
        width: 100%;
    }
}

/* -----------------------------------------
   ALUMNI L1 BLOCKCHAIN WALLET WIDGET
   ----------------------------------------- */
.wallet-widget {
    background: rgba(6, 9, 19, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 8px;
    transition: all 0.3s ease;
}
.wallet-widget:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 25px rgba(255, 255, 255, 0.08);
}
.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}
.wallet-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.wallet-status {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.wallet-status.disconnected {
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}
.wallet-status.connected {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}
.wallet-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
}
.wallet-text-sm {
    font-size: 0.7rem;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 4px;
}
.wallet-tag-row, .wallet-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}
.wallet-label {
    color: var(--text-dark);
    font-size: 0.75rem;
}
.wallet-value {
    color: var(--text-main);
    font-size: 0.8rem;
}
.wallet-value.accent-green {
    color: var(--success-light);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.primary-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    background: var(--accent);
    color: #000000;
}
.primary-sm:hover {
    background: #cbd5e1;
    box-shadow: 0 0 10px var(--accent-glow);
}
.secondary-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.secondary-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
.link-action-btn {
    margin-top: 6px;
    width: 100%;
}

/* Drag and Drop PEM area */
.drag-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}
.drag-drop-area:hover {
    border-color: var(--accent-light);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}
.drag-drop-area.dragover {
    border-color: var(--success-light);
    background: rgba(16, 185, 129, 0.05);
}
.drag-icon {
    font-size: 1.8rem;
}

/* Stitch Premium Aesthetics & Textures */
.brushed-metal {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #2a2a2a 100%);
    position: relative;
    overflow: hidden;
}
.brushed-metal::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
}
.micro-bevel {
    box-shadow: inset 1px 1px 0px rgba(255,255,255,0.1), inset -1px -1px 0px rgba(0,0,0,0.5);
}
.active-glow {
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}
.brushed-metal-border {
    border: 1px solid transparent;
    background: linear-gradient(#131313, #131313) padding-box,
                linear-gradient(135deg, #444748 0%, #8e9192 50%, #444748 100%) border-box;
}
.unread-indicator {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}
.input-mercury {
    border: none;
    border-bottom: 1px solid #444748;
    background: transparent;
    transition: border-color 0.3s ease;
}
.input-mercury:focus {
    outline: none;
    border-bottom: 1px solid #FFF;
    box-shadow: none;
}
.grain-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url(https://lh3.googleusercontent.com/aida-public/AB6AXuDeEMWeFVqurmcPOIQ0s5t3GcqPIE9e7TvRW_BliWUFBYJYnbQJbBEuu64j6UtfErNcOsuCVYYIvJWgiv2U-3WQbXbU25cEh4OeF0NFqlwNO-NWcT6uyPa2RLwr-zD3Q2ezQ6vhuFWTUQCkhFNO2gRWICK9IOoAOh2bOuVzowFGU124XjY1OfZT7i3TBypBUgO_TlPL753gRhKG9UCtTnqQWoh506HBRnR8vUHRRTp-jwpFf_VJ5HU3TaScT--Xf_61bCLyI4Eoif5z);
}

/* Material Symbols Integration */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
}

/* WebRTC Call HUD Floating Panel and Elements */
#call-overlay {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    z-index: 10000;
    border-radius: 4px;
    border: 1px solid #444748;
    background: #131313;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.call-header {
    background: #1b1b1b;
    border-bottom: 1px solid #444748;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.call-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    position: relative;
    background: #131313;
}
.call-video-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    position: relative;
}
.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #0e0e0e;
    border: 1px solid #444748;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-wrapper .video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #e2e2e2;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    border: 1px solid rgba(255,255,255,0.15);
    text-transform: uppercase;
}
.mini-pip {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 140px !important;
    height: 79px !important;
    object-fit: cover !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.mini-pip:hover {
    transform: scale(1.05);
    border-color: #10b981 !important;
}
.call-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}
.btn-call-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #444748;
    background: #1b1b1b;
    color: #e2e2e2;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-call-control:hover {
    background: #2a2a2a;
    border-color: #8e9192;
}
.btn-call-control.active-toggle {
    background: #ffffff;
    color: #131313;
    border-color: #ffffff;
}
.btn-call-control.hangup {
    background: #93000a;
    border-color: #ffb4ab;
    color: #ffdad6;
}
.btn-call-control.hangup:hover {
    background: #ffb4ab;
    color: #690005;
}
.call-console-log {
    width: 100%;
    height: 90px;
    background: #0e0e0e;
    border: 1px solid #444748;
    border-radius: 2px;
    padding: 6px 10px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.call-console-log span {
    line-height: 1.3;
}
.call-console-log .info { color: #8e9192; }
.call-console-log .success { color: #34d399; }
.call-console-log .warning { color: #f59e0b; }

/* Incoming Call Slider Modal */
#incoming-call-modal {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 10001;
    border: 1px solid #10b981;
    background: #131313;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
    border-radius: 2px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.incoming-call-header {
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 1px solid #10b981;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.incoming-call-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Pricing Grid Enhancements */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin-top: 16px;
}
@media (max-width: 1024px) and (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-height: 60vh;
        overflow-y: auto;
        padding-right: 4px;
    }
}
.pricing-card {
    background: #1b1b1b;
    border: 1px solid #444748;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: all 0.25s ease;
}
.pricing-card.selected {
    border-color: #8e9192;
    background: #2a2a2a;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}
.pricing-card.ultimate-card {
    border-color: rgba(16, 185, 129, 0.4);
}
.pricing-card.ultimate-card.selected {
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}
.pricing-card .price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}
.pricing-card .price span {
    font-size: 0.8rem;
    font-weight: 400;
    color: #8e9192;
}
.pricing-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-top: 8px;
    flex-grow: 1;
}
.pricing-card ul li {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Virtual Number Workspace Styles */
.phone-workspace {
    display: flex;
    flex-direction: column;
}
.phone-active-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.phone-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    align-items: start;
}
.phone-log-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.phone-log-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(96, 165, 250, 0.3);
}
.phone-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.phone-log-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}
.phone-log-type.sms {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}
.phone-log-type.voice {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}
.phone-log-from {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}
.phone-log-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.phone-log-body {
    font-size: 0.85rem;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 2px solid #10b981;
    word-break: break-all;
}
.phone-number-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.phone-number-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #60a5fa;
    transform: translateX(2px);
}
.phone-number-item span {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}
@media (max-width: 900px) {
    .phone-grid {
        grid-template-columns: 1fr;
    }
}

/* Phone Dialer Keys */
.dial-key {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.dial-key:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.dial-key:active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: scale(0.95);
}
.dial-key .dial-num {
    font-size: 1.4rem;
    font-weight: 300;
    color: #ffffff;
    line-height: 1;
}
.dial-key .dial-sub {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Phone Tab Active State */
.phone-tab.active {
    color: #10b981 !important;
    border-bottom-color: #10b981 !important;
}
.phone-tab:hover:not(.active) {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

/* SMS Message Bubbles */
.sms-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
    animation: bubbleIn 0.2s ease-out;
}
.sms-bubble.outbound {
    align-self: flex-end;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.sms-bubble.inbound {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-bottom-left-radius: 4px;
}
.sms-bubble .sms-time {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Recent activity items */
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
    cursor: pointer;
}
.activity-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* -----------------------------------------
   MOBILE RESPONSIVE OVERRIDES & iOS AUTO-ZOOM PREVENTION
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Prevent iOS auto-zooming on inputs, selects, and textareas */
    .input-field,
    .input-mercury,
    .composer-row .input-field,
    .composer-row select,
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"] {
        font-size: 16px !important;
    }
    
    /* Make Phone Dialer tab stack vertically instead of squishing */
    .phone-dialer-layout {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        gap: 24px !important;
    }
    
    /* Allow the T9 keypad column and Recent Activity column to expand on mobile */
    .phone-dialer-layout > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
    }

    #phone-logs-container {
        max-height: 280px;
        overflow-y: auto;
    }
}

