/* ==============================================================================
   DRC Enterprise Mail Service - Modern Light Blue & White Design System
   Ultra-Clean, Slim & Lightweight Typography UI/UX
============================================================================== */

:root {
    /* Color Palette - Light Blue & White */
    --bg-body: #f1f5f9;
    --bg-app: #f8fafc;
    --bg-header: #ffffff;
    --bg-sidebar: #fbfcfe;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fbfe;
    --bg-active: #e0f2fe;
    --bg-hover: #f0f7ff;
    
    --border-main: #e2e8f0;
    --border-light: #edf2f7;
    --border-focus: #38bdf8;
    
    --primary-blue: #0284c7;
    --primary-light: #0ea5e9;
    --primary-soft: #e0f2fe;
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    
    --accent-emerald: #10b981;
    --accent-emerald-soft: #ecfdf5;
    --accent-amber: #d97706;
    --accent-amber-soft: #fffbeb;
    --accent-rose: #e11d48;
    --accent-rose-soft: #fff1f2;
    --accent-purple: #7c3aed;
    --accent-purple-soft: #f5f3ff;
    
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    --sidebar-width: 240px;
    --list-width: 380px;
    
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px -1px rgba(14, 165, 233, 0.06), 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 20px -2px rgba(14, 165, 233, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 16px 36px -4px rgba(14, 165, 233, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================================== */
/* 🔐 1. AUTHENTICATION SCREEN */
/* ============================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background: radial-gradient(circle at 10% 10%, rgba(14, 165, 233, 0.1) 0%, transparent 45%),
                radial-gradient(circle at 90% 90%, rgba(2, 132, 199, 0.08) 0%, transparent 45%),
                #f1f5f9;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    padding: 2.8rem 2.2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drc-official-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(14, 165, 233, 0.15));
}

.auth-brand h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-subtitle {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 400;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .icon {
    position: absolute;
    left: 0.9rem;
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0.6;
}

.input-with-icon input {
    padding-left: 2.6rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 400;
    outline: none;
    transition: all 0.18s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1.3rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
}

.auth-role-hint {
    font-size: 0.75rem;
    color: var(--primary-blue);
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 0.65rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-secondary:hover {
    background: var(--bg-card-subtle);
    border-color: var(--primary-light);
    color: var(--primary-blue);
}

.btn-block {
    width: 100%;
}

.auth-footer-badge {
    margin-top: 1.8rem;
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.alert-box {
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 400;
    margin-top: 1rem;
}
.alert-success { background: var(--accent-emerald-soft); border: 1px solid rgba(16, 185, 129, 0.3); color: #065f46; }
.alert-danger { background: var(--accent-rose-soft); border: 1px solid rgba(225, 29, 72, 0.3); color: #9f1239; }

/* ============================================================== */
/* 🚀 2. APP WORKSPACE (TOP BAR & LAYOUT) */
/* ============================================================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-body);
}

.app-header {
    height: 60px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
    z-index: 50;
}

.header-left .app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mini {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drc-nav-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
    display: block;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--primary-blue);
    font-weight: 500;
}

/* Header Search */
.header-center {
    flex: 1;
    max-width: 480px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    font-size: 0.85rem;
    opacity: 0.5;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border-main);
    border-radius: 20px;
    padding: 0.45rem 1rem 0.45rem 2.4rem;
    font-size: 0.84rem;
    font-weight: 400;
    color: var(--text-main);
    outline: none;
    transition: all 0.18s;
}

.search-box input:focus {
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-compose-top {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
    transition: all 0.18s;
}

.btn-compose-top:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
}

.avatar-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

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

.user-display-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.2;
}

.badge-role-admin {
    font-size: 0.68rem;
    color: #15803d;
    background: #ecfdf5;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.badge-role-user {
    font-size: 0.68rem;
    color: #0369a1;
    background: #f0f9ff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

/* SLEEK LOGOUT BUTTON */
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-light);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--accent-rose);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

.logout-icon-svg {
    width: 15px;
    height: 15px;
}

/* ============================================================== */
/* 🛠️ 3. ADMIN WORKSPACE & TABS */
/* ============================================================== */
.admin-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.admin-nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-nav-tabs .tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.admin-nav-tabs .tab-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-blue);
}

.admin-nav-tabs .tab-btn.active {
    background: var(--primary-soft);
    color: var(--primary-blue);
    border-color: rgba(14, 165, 233, 0.3);
    font-weight: 600;
}

.admin-nav-tabs .tab-btn-webmail {
    margin-left: auto;
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--primary-blue);
}

.admin-nav-tabs .tab-btn-webmail:hover {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.15s ease-in-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.pane-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.pane-header p {
    font-size: 0.84rem;
    color: var(--text-light);
    font-weight: 400;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 1.5rem;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.panel-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.6rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.select-styled {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 400;
    outline: none;
}

.select-styled:focus {
    border-color: var(--primary-light);
}

/* DNS Score & Diagnostics */
.dns-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dns-score-bar {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.score-display {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
}

.score-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.score-grade {
    font-size: 0.95rem;
    font-weight: 600;
    color: #15803d;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pill-green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.pill-amber { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.pill-blue { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* DATA TABLES */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.data-table th {
    background: #f8fafc;
    padding: 0.75rem 0.9rem;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-main);
}

.data-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 400;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

.data-table strong {
    color: var(--text-main);
    font-weight: 500;
}

.data-table code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: #f1f5f9;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    color: var(--primary-blue);
}

.btn-action-sm {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-action-sm:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
}

/* ============================================================== */
/* 💻 4. DEVELOPER API HUB */
/* ============================================================== */
.api-hub-container {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 14px;
    padding: 1.8rem;
    box-shadow: var(--shadow-sm);
}

.api-meta-card {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}

.api-endpoint-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.api-endpoint-badge .method {
    background: #10b981;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.api-endpoint-badge .url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.api-desc {
    font-size: 0.82rem;
    color: var(--text-light);
}

.code-tabs-nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.code-tab {
    background: #ffffff;
    border: 1px solid var(--border-main);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.code-tab:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
}

.code-tab.active {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

.code-editor-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    position: relative;
    padding: 1.2rem 1.5rem;
}

.btn-copy-code {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-copy-code:hover {
    background: var(--primary-light);
    color: #ffffff;
    border-color: transparent;
}

#api-code-snippet code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #38bdf8;
    line-height: 1.6;
    display: block;
    overflow-x: auto;
    font-weight: 400;
}

/* ============================================================== */
/* ✉️ 5. GMAIL-STYLE WEBMAIL CLIENT */
/* ============================================================== */
.webmail-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--bg-card);
}

/* COLUMN 1: FOLDER SIDEBAR */
.webmail-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0.8rem;
    flex-shrink: 0;
}

.btn-compose-fab {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    padding: 0.7rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.18s;
    margin-bottom: 1.2rem;
}

.btn-compose-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.folder-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.folder-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}

.folder-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-blue);
}

.folder-btn.active {
    background: var(--primary-soft);
    color: var(--primary-blue);
    font-weight: 600;
}

.folder-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.folder-title {
    flex: 1;
}

.folder-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-blue);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
}

.sidebar-settings-section {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* Quota Box */
.storage-quota-box {
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 0.8rem;
    margin-top: 0.8rem;
}

.quota-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}

.quota-progress-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.quota-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quota-details {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* COLUMN 2: MAIL LIST */
.webmail-mail-list {
    width: var(--list-width);
    border-right: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    flex-shrink: 0;
}

.mail-list-toolbar {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-tool-icon {
    background: transparent;
    border: 1px solid var(--border-main);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.btn-tool-icon:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
}

.select-mini {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    outline: none;
}

.page-indicator {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.mail-items-container {
    flex: 1;
    overflow-y: auto;
}

.mail-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
    background: #ffffff;
}

.mail-card:hover {
    background: var(--bg-hover);
}

.mail-card.active {
    background: #f0f9ff;
    border-left: 3px solid var(--primary-blue);
}

.mail-card.unread {
    background: #f8fbff;
}

.mail-card.unread .mail-sender {
    font-weight: 600;
    color: var(--text-main);
}

.mail-card.unread .mail-subject-line {
    font-weight: 600;
    color: var(--text-main);
}

.mail-card-left-col {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.btn-star-mail {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #cbd5e1;
    padding: 2px;
    transition: transform 0.15s ease, color 0.15s ease;
}

.btn-star-mail:hover {
    transform: scale(1.15);
    color: #f59e0b;
}

.btn-star-mail.starred {
    color: #f59e0b;
}

.mail-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

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

.mail-top-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
}

.mail-sender {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mail-subject-line {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
    font-weight: 400;
}

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

.mail-badges {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.att-clip-icon {
    font-size: 0.7rem;
    color: var(--primary-blue);
}

/* COLUMN 3: READING PANE */
.webmail-reading-pane {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.empty-pane-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    opacity: 0.3;
}

.empty-pane-state h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.empty-pane-state p {
    font-size: 0.82rem;
}

.active-mail-view {
    padding: 1.8rem 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.mail-view-header {
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 1.2rem;
}

.mail-view-subject-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.mail-view-subject-row h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.badge-dkim {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.mail-view-sender-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sender-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.sender-meta-info {
    flex: 1;
}

.sender-name-line strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.sender-email-addr {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.recipient-line {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.mail-view-actions {
    display: flex;
    gap: 0.4rem;
}

.mail-view-body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-main);
    background: var(--bg-card-subtle);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-main);
    min-height: 200px;
}

.mail-view-attachments {
    border-top: 1px solid var(--border-main);
    padding-top: 1rem;
}

.mail-view-attachments h4 {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
}

.attachment-download-card {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.18s;
}

.attachment-download-card:hover {
    border-color: var(--primary-light);
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

.att-card-icon {
    font-size: 1.3rem;
}

.att-card-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-card-size {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================================== */
/* ✉️ 6. COMPOSE MODAL */
/* ============================================================== */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.compose-window {
    width: 650px;
    max-width: 95vw;
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compose-header {
    background: var(--bg-card-subtle);
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
}

.btn-icon-sm {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.btn-icon-sm:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.compose-body {
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.compose-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.35rem;
}

.compose-row label {
    width: 55px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.compose-row input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.35rem;
    font-size: 0.86rem;
}

.compose-row input:focus {
    box-shadow: none;
    border: none;
}

.compose-editor-wrap textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-main);
    resize: vertical;
    padding: 0.5rem 0;
}

.compose-editor-wrap textarea:focus {
    box-shadow: none;
}

.attachment-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.att-chip {
    background: var(--bg-hover);
    border: 1px solid var(--border-main);
    border-radius: 14px;
    padding: 0.2rem 0.6rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.att-chip-remove {
    cursor: pointer;
    color: var(--accent-rose);
    font-weight: 600;
}

.compose-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 0.8rem;
    margin-top: 0.4rem;
}

.compose-actions-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-tool-label {
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.15s;
}

.btn-tool-label:hover {
    background: var(--bg-hover);
}

/* Minimized Compose Dock */
.compose-window.minimized {
    position: fixed;
    bottom: 0;
    right: 2rem;
    width: 320px;
    max-width: 90vw;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.compose-window.minimized .compose-body {
    display: none;
}

/* ============================================================== */
/* ✍️ 7. SIGNATURE BUILDER MODAL */
/* ============================================================== */
.modal-dialog {
    background: #ffffff;
    border: 1px solid var(--border-main);
    border-radius: 14px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.max-w-700 { max-width: 680px; }

.modal-header {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-subtle);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.modal-body {
    padding: 1.4rem;
}

.signature-preview-card {
    background: #ffffff;
    color: #1e293b;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.6rem;
    border: 1px solid var(--border-main);
    border-left: 3px solid var(--primary-blue);
    font-size: 0.86rem;
}

.btn-group-row {
    display: flex;
    gap: 0.8rem;
}
