/* BtsSaudi Mail - Stylesheet */

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Modern Slim Scrollbars === */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.65);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Sidebar Dark Scrollbar */
.sidebar,
.folder-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar::-webkit-scrollbar,
.folder-list::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track,
.folder-list::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.folder-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.folder-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --bg: #f8fafc;
    --sidebar-bg: #0b132b;
    --sidebar-surface: #1c2541;
    --sidebar-text: #94a3b8;
    --sidebar-text-bright: #f8fafc;
    --sidebar-active: rgba(59, 130, 246, 0.16);
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text: #0f172a;
    --text-light: #64748b;
    --white: #ffffff;
    --unread-bg: #f0f7ff;
    --unread-hover: #e2f0fe;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 14px rgba(15,23,42,0.06);
    --shadow-lg: 0 12px 32px rgba(15,23,42,0.12);
    --radius: 10px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); text-decoration: none; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.btn-danger {
    background: #ef4444;
    color: var(--white);
    border-color: #ef4444;
}
.btn-danger:hover {
    background: #dc2626;
    color: var(--white);
    border-color: #dc2626;
}
.btn-small {
    padding: 5px 12px;
    font-size: 12.5px;
    border-radius: 8px;
}
.btn-full { width: 100%; }

/* Compose Button in Sidebar */
.btn-compose {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 16px;
    padding: 11px 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    border: none;
    border-radius: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1px;
    box-shadow: 0 4px 14px rgba(37,99,235,0.38);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}
.btn-compose:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.48);
    text-decoration: none;
}
.btn-compose:active { transform: translateY(0); }
.btn-compose .icon { font-size: 15px; }

/* === Login === */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sidebar-bg);
}
.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 28px; color: var(--primary); margin-bottom: 8px; }
.login-header p { color: var(--text-light); }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.login-footer { text-align: center; margin-top: 24px; color: var(--text-light); font-size: 13px; }

/* === App Layout === */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === Sidebar === */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}
.brand-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}
.brand-sub {
    color: #38bdf8;
    font-weight: 500;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.user-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-email {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--sidebar-text-bright);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-status {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 6px #10b981;
}

.folder-list {
    flex: 1;
    padding: 6px 12px;
    overflow-y: auto;
}
.folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}
.folder-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-bright);
    text-decoration: none;
}
.folder-item.active {
    background: var(--sidebar-active);
    color: #60a5fa;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #3b82f6;
}
.folder-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    opacity: 0.9;
}
.folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.badge {
    background: #ef4444;
    color: var(--white);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    line-height: 1.3;
}
.folder-item.active .badge {
    background: #3b82f6;
}

.sidebar-tools {
    padding: 6px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer {
    padding: 14px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 9px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    margin-bottom: 0;
    letter-spacing: 0.2px;
}
.settings-link {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}
.settings-link:hover {
    color: #ffffff;
    background: rgba(148, 163, 184, 0.22);
    border-color: rgba(148, 163, 184, 0.4);
}
.logout-link {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.28);
}
.logout-link:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.32);
    border-color: rgba(239, 68, 68, 0.55);
}
.admin-link {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.32);
}
.admin-link:hover {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.55);
}

.quota-display {
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.quota-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}
.quota-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 3px;
    transition: width 0.3s;
}
.quota-fill.quota-warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.quota-detail {
    font-size: 10.5px;
    color: #64748b;
    text-align: right;
}

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.content-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.folder-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.folder-title-wrap h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin: 0;
}
.folder-count-pill {
    background: #f1f5f9;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 12px;
}

/* === Sync Controls === */
.sync-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}
.btn-sync {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-sync:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: #94a3b8;
}
.sync-icon {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.3s;
}
.sync-icon.spinning {
    animation: sync-spin 0.75s linear infinite;
}
@keyframes sync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.sync-status {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}
.sync-interval-select {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    color: #475569;
    background: #ffffff;
    cursor: pointer;
    outline: none;
}
.sync-interval-select:focus {
    border-color: var(--primary);
}

/* === New Mail Alert Banner === */
.new-mail-alert {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    margin: 12px 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(37,99,235,0.22);
    cursor: pointer;
    animation: slideDownAlert 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.15s ease;
}
.new-mail-alert:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.3);
}
@keyframes slideDownAlert {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.new-mail-alert-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}
.new-mail-btn {
    background: #ffffff;
    color: #2563eb;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.mail-row.highlight-new {
    animation: highlightRow 3s ease-out;
}
@keyframes highlightRow {
    0% { background-color: #dbeafe; }
    50% { background-color: #eff6ff; }
    100% { background-color: transparent; }
}

/* === Upgraded Search Form === */
.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Topbar Quick Actions (Contacts / Calendar) === */
.topbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.topbar-quick-btn:hover {
    color: #2563eb;
    background: var(--primary-light);
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.topbar-quick-btn svg {
    color: #64748b;
    transition: color 0.18s ease;
}
.topbar-quick-btn:hover svg {
    color: #2563eb;
}
.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon-svg {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}
.search-input-box input {
    padding: 7px 14px 7px 34px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    width: 250px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}
.search-input-box input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    width: 290px;
}
.btn-search {
    padding: 7px 15px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-search:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* === Message List & Mail Table === */
.message-list {
    flex: 1;
    overflow-y: auto;
    background: var(--white);
    margin: 16px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}
.mail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.mail-row {
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.12s ease;
    user-select: none;
}
.mail-row:hover {
    background: #f8fafc;
}
.mail-row.unread {
    background: #f0f7ff;
}
.mail-row.unread:hover {
    background: #e2f0fe;
}
.mail-row td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Table columns */
.col-status {
    width: 14px;
    padding-right: 0 !important;
    text-align: center;
}
.unread-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: transparent;
}
.mail-row.unread .unread-dot {
    background: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

.col-star {
    width: 24px;
    text-align: center;
    padding-left: 6px !important;
    padding-right: 6px !important;
}
.star-icon {
    color: #cbd5e1;
    font-size: 15px;
    transition: color 0.15s;
    line-height: 1;
}
.star-icon.starred, .mail-row:hover .star-icon:hover {
    color: #f59e0b;
}

.col-avatar {
    width: 38px;
    padding-left: 4px !important;
    padding-right: 8px !important;
}
.sender-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.avatar-c0 { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.avatar-c1 { background: linear-gradient(135deg, #10b981, #0d9488); }
.avatar-c2 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.avatar-c3 { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.avatar-c4 { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.avatar-c5 { background: linear-gradient(135deg, #06b6d4, #0284c7); }

.col-from {
    width: 190px;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.from-name {
    color: #1e293b;
    font-size: 13.5px;
}
.mail-row.unread .from-name {
    font-weight: 700;
    color: #0f172a;
}

.col-subject {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.subject-text {
    font-size: 13.5px;
    color: #475569;
}
.mail-row.unread .subject-text {
    font-weight: 700;
    color: #0f172a;
}
.attach-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    background: #f1f5f9;
    color: #64748b;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
}

.col-date {
    width: 160px;
    text-align: right;
    white-space: nowrap;
}
.date-text {
    font-size: 12px;
    color: #64748b;
}
.mail-row.unread .date-text {
    font-weight: 600;
    color: #2563eb;
}

/* Date badges */
.date-badge {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.date-badge-today {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.date-badge-yesterday {
    color: #9333ea;
    background: rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.22);
}
.date-badge-week {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.22);
}

/* Row date highlighting */
.mail-row-today {
    border-left: 3px solid #2563eb;
}
.mail-row-today td:first-child {
    border-left: 3px solid #2563eb;
}
.mail-row-today:not(.unread) {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.04) 0%, transparent 60%);
}
.mail-row-yesterday {
    border-left: 3px solid #9333ea;
}
.mail-row-yesterday td:first-child {
    border-left: 3px solid #9333ea;
}
.mail-row-yesterday:not(.unread) {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.04) 0%, transparent 60%);
}
.mail-row-thisweek {
    border-left: 3px solid #10b981;
}
.mail-row-thisweek td:first-child {
    border-left: 3px solid #10b981;
}
.mail-row-thisweek:not(.unread) {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
}

/* Date range filter */
.date-filter-box {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    transition: border-color 0.15s ease;
}
.date-filter-box:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.date-filter-input {
    border: none;
    background: transparent;
    font-size: 12px;
    color: #475569;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    width: 130px;
}
.date-filter-input:focus {
    outline: none;
}
.date-filter-sep {
    color: #cbd5e1;
    font-size: 13px;
}
.btn-clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    font-size: 18px;
    line-height: 1;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.15s ease;
    padding: 0;
}
.btn-clear-filter:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}
.page-info { color: #64748b; font-size: 12.5px; font-weight: 500; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: #64748b;
    margin: auto;
}
.empty-state-badge {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}
.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}
.empty-state p {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 20px;
}
.btn-empty-compose {
    padding: 9px 20px;
    border-radius: 20px;
    font-weight: 600;
}

/* === Message View === */
.message-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.msg-toolbar-left, .msg-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.toolbar-sep {
    width: 1px;
    height: 20px;
    background: #cbd5e1;
    margin: 0 4px;
}
.btn-back {
    background: #f1f5f9;
    border-color: #cbd5e1;
    font-weight: 600;
}
.btn-ai {
    background: #fdf4ff;
    color: #9333ea;
    border-color: #f0abfc;
    font-weight: 600;
}
.btn-ai:hover {
    background: #fae8ff;
    color: #7e22ce;
    border-color: #d8b4fe;
}
.inline-form { display: inline; }

.message-view {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}
.message-view-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(15,23,42,0.04);
    max-width: 960px;
    margin: 0 auto;
}
.message-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.message-subject {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin: 0;
    flex: 1;
}
.message-date-chip {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 500;
}

/* Sender Profile Card in Message View */
.message-sender-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-bottom: 24px;
}
.sender-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.sender-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sender-card-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.sender-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.sender-card-email {
    font-size: 12.5px;
    color: #64748b;
}
.sender-card-details {
    font-size: 12px;
    color: #64748b;
}

/* Attachment cards */
.attachments-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}
.attachments-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 10px;
}
.attachment-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.attachment-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.attachment-card:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37,99,235,0.1);
    text-decoration: none;
}
.attachment-card-icon { font-size: 18px; }
.attachment-card-meta { display: flex; flex-direction: column; }
.attachment-card-name { font-size: 13px; font-weight: 600; color: #1e293b; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-card-size { font-size: 11px; color: #64748b; }
.attachment-card-dl { font-size: 13px; color: #3b82f6; margin-left: 4px; }

.message-body {
    padding: 8px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #1e293b;
    word-wrap: break-word;
}
.message-body img { max-width: 100%; height: auto; border-radius: 6px; }
.text-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.7;
    color: #1e293b;
}

/* === Standalone Compose Page === */
.compose-page-wrapper {
    padding: 24px 32px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}
.compose-page-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    overflow: hidden;
}
.compose-page-form {
    display: flex;
    flex-direction: column;
}
.compose-textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14.5px;
    line-height: 1.65;
    color: #1e293b;
    font-family: inherit;
    resize: vertical;
    min-height: 250px;
    background: transparent;
}
.compose-page-attach-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}
.attach-names-text {
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Legacy Compose Form === */
.compose-form { padding: 24px; max-width: 800px; }
.compose-form .form-group { margin-bottom: 16px; }
.compose-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.compose-form input[type="text"],
.compose-form input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.compose-form input:focus { outline: none; border-color: var(--primary); }
.compose-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
}
.compose-form textarea:focus { outline: none; border-color: var(--primary); }
.compose-actions { display: flex; gap: 12px; margin-top: 20px; }

/* === Flash Messages === */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}
.flash {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Error Page === */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}
.error-page h1 { font-size: 72px; color: var(--primary); }
.error-page p { font-size: 18px; color: var(--text-light); margin: 10px 0 20px; }

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-header h1, .user-email, .folder-name, .badge { display: none; }
    .btn-compose { font-size: 0; }
    .btn-compose .icon { font-size: 20px; }
    .col-from { width: 120px; }
    .col-date { width: 80px; }
    .search-form input { width: 120px; }
    .sync-status { display: none; }
    .content-header { padding: 12px 16px; }
    .content-header-left { gap: 8px; }
}

/* === Admin Panel === */
.admin-nav-divider {
    padding: 16px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.admin-card h3 { font-size: 16px; margin-bottom: 12px; }
.admin-hint { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-icon { font-size: 32px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    min-width: 140px;
    transition: all 0.15s;
}
.action-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
    text-decoration: none;
}
.action-icon { font-size: 28px; }

/* Admin tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.admin-table tr:hover { background: #f8fafc; }
.empty-row { text-align: center; color: var(--text-light); padding: 24px; }
.action-cell { white-space: nowrap; }
.action-cell form { margin-right: 4px; }
.badge-admin {
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Admin forms */
.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.inline-form input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.admin-form .form-group { margin-bottom: 12px; }
.admin-form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
}
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 13px;
    margin-top: 8px;
}
.email-preview {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-light);
}
.email-preview span { color: var(--primary); font-weight: 600; }

/* Alias form */
.alias-form-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.alias-form .form-group { flex: 1; min-width: 200px; }
.alias-arrow { font-size: 24px; color: var(--text-light); padding-bottom: 8px; }

/* DNS check */
.status-card {
    text-align: center;
    padding: 16px;
}
.status-card.all-ok { background: #d1fae5; border-color: #6ee7b7; }
.status-card.has-errors { background: #fef3c7; border-color: #fcd34d; }
.status-card h3 { margin: 0; font-size: 16px; }

.dns-table .row-ok { background: #f0fdf4; }
.dns-table .row-error { background: #fef2f2; }
.dns-value { font-family: monospace; font-size: 12px; word-break: break-all; max-width: 300px; }
.dns-expected { font-family: monospace; font-size: 12px; color: var(--text-light); }
.dns-error { color: var(--danger); font-style: italic; }

.dns-record-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}
.record-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.record-type {
    background: var(--primary);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.record-name { font-weight: 600; font-size: 13px; }
.record-value-inline { color: var(--text-light); font-size: 13px; }
.record-value {
    font-family: monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    padding-left: 12px;
}

/* === Quota Display === */
.quota-display {
    margin-bottom: 12px;
    padding: 8px 0;
}
.quota-label {
    font-size: 11px;
    color: var(--sidebar-text);
    margin-bottom: 4px;
}
.quota-bar {
    height: 6px;
    background: #334155;
    border-radius: 3px;
    overflow: hidden;
}
.quota-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s;
}
.quota-fill.quota-warning {
    background: #ef4444;
}
.quota-detail {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}

/* Mini quota bar (admin users table) */
.quota-mini {
    min-width: 120px;
}
.quota-bar-mini {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.quota-fill-mini {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}
.quota-fill-mini.quota-warning {
    background: var(--danger);
}
.quota-text {
    font-size: 11px;
    color: var(--text-light);
}

/* === Settings === */

.settings-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-width: 800px;
}

.settings-form .form-group { margin-bottom: 16px; }
.settings-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"],
.settings-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.settings-form input:focus, .settings-form select:focus {
    outline: none;
    border-color: var(--primary);
}
.settings-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* === AI Features === */
.btn-ai {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: #c4b5fd;
}
.btn-ai:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}

.ai-result {
    margin: 0 24px 16px;
    background: #faf5ff;
    border: 1px solid #c4b5fd;
    border-radius: var(--radius);
    overflow: hidden;
}
.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f3e8ff;
    font-weight: 600;
    color: #7c3aed;
    font-size: 14px;
}
.ai-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7c3aed;
    padding: 0 4px;
}
.ai-result-body {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}
.ai-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}
.ai-loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}
@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}
.ai-error {
    color: var(--danger);
    padding: 8px;
    background: #fef2f2;
    border-radius: 4px;
}

/* Triage badges */
.triage-result { display: flex; flex-direction: column; gap: 8px; }
.triage-row { display: flex; align-items: center; gap: 8px; }
.triage-label { font-weight: 600; min-width: 80px; }
.triage-badge {
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.triage-important { background: #fee2e2; color: #991b1b; }
.triage-work { background: #dbeafe; color: #1e40af; }
.triage-personal { background: #d1fae5; color: #065f46; }
.triage-newsletter { background: #fef3c7; color: #92400e; }
.triage-notification { background: #e0e7ff; color: #3730a3; }
.triage-social { background: #fce7f3; color: #9d174d; }
.triage-promotion { background: #ffedd5; color: #9a3412; }
.triage-spam { background: #f3f4f6; color: #6b7280; }
.triage-unknown { background: #f3f4f6; color: #6b7280; }

.priority-high { background: #fee2e2; color: #991b1b; }
.priority-medium { background: #fef3c7; color: #92400e; }
.priority-low { background: #d1fae5; color: #065f46; }

/* Smart replies */
.smart-replies { display: flex; flex-direction: column; gap: 12px; }
.smart-reply-option {
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.smart-reply-option p { margin-bottom: 8px; font-size: 14px; }

/* === Compose Modal === */
.compose-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.compose-modal {
    background: var(--white);
    border-radius: 16px;
    width: 760px;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
    animation: slideUpCompose 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    transition: all 0.25s ease;
}
@keyframes slideUpCompose {
    from { transform: translateY(40px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.compose-modal.maximized {
    width: 96vw;
    max-width: 1200px;
    height: 94vh;
    max-height: 94vh;
}
.compose-modal.maximized .compose-editor {
    min-height: 480px;
    max-height: calc(94vh - 280px);
}

.compose-modal.minimized {
    position: fixed;
    bottom: 0;
    right: 24px;
    width: 320px;
    max-height: 48px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.compose-modal.minimized .compose-modal-body,
.compose-modal.minimized .compose-modal-footer {
    display: none;
}

.compose-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.compose-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.compose-header-icon {
    display: inline-flex;
    align-items: center;
    color: #60a5fa;
}
.compose-header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}
.compose-win-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.compose-win-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}
.compose-win-btn.btn-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.compose-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Recipient and Subject Rows */
.compose-field-row {
    display: flex;
    align-items: center;
    padding: 8px 18px;
    border-bottom: 1px solid #f1f5f9;
    gap: 10px;
    transition: background 0.15s;
}
.compose-field-row:focus-within {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}
.compose-field-label {
    width: 44px;
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    flex-shrink: 0;
}
.compose-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}
.compose-input-wrapper input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #0f172a;
    background: transparent;
    font-family: inherit;
    padding: 4px 0;
}
.compose-input-wrapper input::placeholder {
    color: #94a3b8;
}
.compose-field-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.field-pill-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.field-pill-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}
.field-pill-btn.pill-contacts {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.field-pill-btn.pill-contacts:hover {
    background: #dbeafe;
    color: #1d4ed8;
}
.add-contact-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.add-contact-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Subject Row */
.compose-subject-row {
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.compose-subject-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    font-family: inherit;
    padding: 2px 0;
}
.compose-subject-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Quick Tools Bar */
.compose-quick-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    background: #fafafa;
    border-bottom: 1px solid #f1f5f9;
}
.quick-tools-left, .quick-tools-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tool-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 3px 11px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}
.tool-chip:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}
.tool-chip-file {
    cursor: pointer;
}
.tool-chip-fmt {
    background: #f1f5f9;
}

/* Rich text toolbar */
.compose-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    align-items: center;
}
.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.tb-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 3px 7px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    font-family: inherit;
}
.tb-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.tb-btn.tb-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}
.toolbar-divider {
    width: 1px;
    height: 18px;
    background: #cbd5e1;
    margin: 0 4px;
}

/* Rich text editor area */
.compose-editor-wrapper {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s;
}
.compose-editor-wrapper.drag-over {
    background: #eff6ff;
    outline: 2px dashed #3b82f6;
    outline-offset: -8px;
}
.compose-editor {
    min-height: 220px;
    max-height: 380px;
    overflow-y: auto;
    outline: none;
    font-size: 14.5px;
    line-height: 1.65;
    color: #1e293b;
    font-family: inherit;
}
.compose-editor:empty:before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
}
.compose-editor ul, .compose-editor ol {
    padding-left: 24px;
    margin: 8px 0;
}
.compose-editor blockquote {
    border-left: 3px solid #cbd5e1;
    margin: 8px 0;
    padding-left: 12px;
    color: #64748b;
    font-style: italic;
}
.compose-editor a {
    color: var(--primary);
    text-decoration: underline;
}

/* Attachments */
.compose-attachments {
    padding: 0 18px 8px;
}
.compose-attach-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.compose-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 3px 10px;
    font-size: 12px;
    color: #334155;
}
.attach-chip-icon { font-size: 13px; }
.attach-chip-name {
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attach-chip-size {
    color: #64748b;
    font-size: 11px;
}

/* Modern Footer */
.compose-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-send-modern {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    padding: 7px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.15s ease;
}
.btn-send-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}
.btn-send-modern:active {
    transform: translateY(0);
}
.send-arrow-icon {
    display: inline-block;
}
.send-kbd-hint {
    font-size: 10px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    padding: 1px 5px;
    opacity: 0.9;
}
.footer-attach-icon {
    color: #64748b;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.footer-attach-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.footer-draft-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.15s;
}
.footer-draft-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.btn-discard {
    background: transparent;
    border: none;
    color: #94a3b8;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.btn-discard:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Responsive modal */
@media (max-width: 768px) {
    .compose-modal {
        width: 100%;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .compose-field-label { width: 36px; }
    .compose-toolbar { gap: 2px; }
    .compose-editor { min-height: 180px; }
}

/* === Picker Modals === */
.picker-modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.picker-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}
.picker-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}
.picker-search:focus { outline: none; border-color: var(--primary); }
.picker-empty {
    text-align: center;
    color: var(--text-light);
    padding: 24px;
    font-size: 14px;
}
.contacts-list, .templates-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.contact-pick-item, .template-pick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: background 0.1s;
}
.contact-pick-item:hover, .template-pick-item:hover {
    background: #f8fafc;
}
.contact-pick-info, .template-pick-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.contact-pick-info span, .template-pick-info span {
    font-size: 12px;
    color: var(--text-light);
}
.picker-add-new {
    margin-top: 12px;
    text-align: center;
}
.picker-add-new p {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}
.picker-add-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.picker-add-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

/* === Email Signature === */
.email-signature {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: 10px;
    color: #64748b;
    font-size: 13px;
}

/* === Calendar (Redesigned) === */
.cal-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    padding: 0 24px 24px;
    flex: 1;
    overflow: hidden;
}

/* Month grid */
.cal-main {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0b132b 0%, #1c2541 100%);
    color: #f8fafc;
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    font-size: 20px;
    color: #e2e8f0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.18s ease;
}
.cal-nav-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
}
.cal-today-btn {
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.18s ease;
}
.cal-today-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.cal-month-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.cal-new-event-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.cal-new-event-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
.cal-new-event-btn span { font-size: 18px; line-height: 1; }

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.cal-weekdays > div {
    padding: 10px 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    text-align: center;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    flex: 1;
    overflow-y: auto;
    min-height: 400px;
}
.cal-day {
    min-height: 70px;
    padding: 6px 8px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.15s ease;
}
.cal-day:hover { background: #f8fafc; }
.cal-day-other { background: #fafbfc; }
.cal-day-other .cal-day-num { color: #cbd5e1; }
.cal-day-today {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0.02) 100%);
}
.cal-day-today .cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}
.cal-day-num {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    line-height: 1.4;
}
.cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.cal-event-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 10.5px;
    font-weight: 500;
    color: #1e40af;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 4px;
    overflow: hidden;
    white-space: nowrap;
    cursor: default;
}
.cal-event-all-day {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
}
.cal-event-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
}
.cal-event-all-day .cal-event-dot { background: #10b981; }
.cal-event-label { overflow: hidden; text-overflow: ellipsis; }
.cal-event-more {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    padding: 1px 6px;
}

/* Side panel */
.cal-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}
.cal-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.cal-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
}
.cal-card-icon { font-size: 16px; }
.cal-count-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 12px;
}
.cal-form { display: flex; flex-direction: column; gap: 10px; }
.cal-field { display: flex; flex-direction: column; gap: 4px; }
.cal-field label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cal-field input, .cal-field textarea {
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cal-field input:focus, .cal-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.cal-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}
.cal-submit-btn {
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    margin-top: 4px;
}
.cal-submit-btn:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

/* Event list */
.cal-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cal-event-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #fafbfc;
    transition: all 0.18s ease;
}
.cal-event-row:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.cal-event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: 10px;
    flex-shrink: 0;
}
.cal-event-day { font-size: 18px; font-weight: 700; line-height: 1; }
.cal-event-month { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-event-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cal-event-name { font-size: 13px; color: #0f172a; }
.cal-event-time { font-size: 12px; color: #64748b; }
.cal-event-loc { font-size: 11px; color: #94a3b8; }
.cal-event-desc { font-size: 11px; color: #94a3b8; }
.cal-delete-form { display: inline-flex; }
.cal-delete-btn {
    padding: 6px 8px;
    font-size: 14px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.cal-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Empty state */
.cal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 30px 16px;
    text-align: center;
}
.cal-empty-icon { font-size: 36px; opacity: 0.4; }
.cal-empty p { font-size: 14px; font-weight: 600; color: #475569; }
.cal-empty span { font-size: 12px; color: #94a3b8; }

@media (max-width: 900px) {
    .cal-layout { grid-template-columns: 1fr; padding: 0 16px 16px; }
    .cal-grid { min-height: 300px; }
    .cal-day { min-height: 50px; }
}
@media (max-width: 600px) {
    .cal-toolbar { flex-wrap: wrap; gap: 8px; }
    .cal-month-title { order: -1; width: 100%; text-align: center; }
    .cal-event-pill { font-size: 9px; padding: 1px 4px; }
    .cal-day-num { font-size: 10px; }
}

/* === Import Page === */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}
.import-help {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}
.import-help h4 {
    font-size: 13px;
    margin-top: 10px;
    margin-bottom: 4px;
    color: var(--text);
}
.import-help h4:first-child { margin-top: 0; }
.import-help ul, .import-help ol {
    padding-left: 20px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.import-help li { margin-bottom: 2px; }
.csv-format {
    font-family: monospace;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* === Domain Setup Wizard === */
.setup-wizard-card { max-width: 900px; }
.wizard-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.wizard-step h3 { margin: 0; }
.wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.wizard-progress {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}
.wizard-progress .wizard-step {
    flex: 1;
    padding: 12px 16px;
    background: #f1f5f9;
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 13px;
}
.wizard-progress .wizard-step.active {
    background: var(--primary);
    color: var(--white);
}
.wizard-progress .wizard-step.active .wizard-step-num {
    background: var(--white);
    color: var(--primary);
}
.wizard-progress .wizard-step.done {
    background: #dcfce7;
    color: #166534;
}
.wizard-progress .wizard-step.done .wizard-step-num {
    background: #166534;
    color: var(--white);
}
.wizard-progress .wizard-step:last-child { border-right: none; }

.btn-large {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
}

.setup-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.setup-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.setup-feature-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.setup-feature strong { display: block; font-size: 14px; }
.setup-feature span { font-size: 12px; color: var(--text-light); }

.domain-highlight {
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.cpanel-instructions {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.cpanel-instructions h4 { margin-top: 0; color: #92400e; }
.cpanel-instructions ol { padding-left: 20px; color: #78350f; }
.cpanel-instructions li { margin-bottom: 4px; }

/* DNS CNAME conflict warning */
.dns-warning-box {
    background: #fef2f2;
    border: 2px solid #f87171;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.dns-warning-box h4 {
    margin-top: 0;
    color: #991b1b;
    font-size: 15px;
}
.dns-warning-box h4:not(:first-child) { margin-top: 12px; }
.dns-warning-box p { font-size: 13px; color: #7f1d1d; line-height: 1.5; }
.dns-warning-box ol { padding-left: 20px; color: #7f1d1d; }
.dns-warning-box li { margin-bottom: 4px; font-size: 13px; }
.dns-warning-box code {
    background: #fee2e2;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    color: #991b1b;
}
.warning-highlight {
    background: #fecaca;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}
.warning-note {
    margin-top: 10px;
    padding: 10px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
}

/* === Microsoft 365-style Domain Wizard === */
.setup-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.setup-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}
.setup-feature-icon { font-size: 28px; }
.setup-feature strong { display: block; font-size: 13px; }
.setup-feature span { font-size: 12px; color: var(--text-light); }

.verify-txt-box {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.verify-txt-box h4 { margin-top: 0; color: #1e40af; font-size: 15px; }
.verify-txt-table { margin-top: 8px; }
.verify-txt-table code {
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    background: #dbeafe;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}
.dns-hint { font-size: 11px; color: var(--text-light); }

.ownership-verified-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.verify-dns-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}
.verify-results {
    margin-top: 16px;
}
.verify-loading {
    padding: 12px;
    text-align: center;
    color: var(--text-light);
    background: #f8fafc;
    border-radius: 6px;
}
.verify-summary {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}
.verify-ok { background: #dcfce7; color: #166534; }
.verify-fail { background: #fee2e2; color: #991b1b; }
.verify-table { margin-top: 8px; }
.verify-table td { padding: 8px 12px; font-size: 13px; }
.status-ok { color: #166534; font-weight: 600; }
.status-fail { color: #991b1b; font-weight: 600; }

.activate-section {
    margin-top: 24px;
    padding: 20px;
    background: #f0fdf4;
    border: 2px solid #166534;
    border-radius: 8px;
}
.activate-section h3 { margin-top: 0; color: #166534; }
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.email-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.email-input-group input {
    border: none;
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
}
.email-input-group .email-suffix {
    padding: 0 12px;
    background: #f1f5f9;
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
}
.dkim-generated-box {
    background: #dcfce7;
    border: 1px solid #166534;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
}
.dkim-generated-box h4 { margin-top: 0; color: #166534; }
.btn-large {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .form-row-2col { grid-template-columns: 1fr; }
    .setup-features { grid-template-columns: 1fr; }
}

.dns-records-table { margin: 16px 0; }
.dns-records-table .admin-table { font-size: 13px; }
.dns-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.dns-type-a { background: #dbeafe; color: #1e40af; }
.dns-type-mx { background: #dcfce7; color: #166534; }
.dns-type-txt { background: #fef3c7; color: #92400e; }
.dns-name { font-family: monospace; font-size: 12px; }
.dns-value code {
    font-family: monospace;
    font-size: 11px;
    word-break: break-all;
    display: block;
    max-width: 400px;
}
.dns-purpose-row { background: #f8fafc; }
.dns-purpose {
    font-size: 12px;
    color: var(--text-light);
    padding: 6px 12px !important;
}
.dns-record-pending { background: #fffbeb; }

.copy-btn { white-space: nowrap; }

.dkim-generate-box {
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.dkim-generate-box h4 { margin-top: 0; color: #5b21b6; }
.dkim-generated-box {
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.dkim-generated-box h4 { margin-top: 0; color: #166534; }

.verify-dns-section {
    margin: 24px 0;
    text-align: center;
}
.verify-results {
    margin-top: 16px;
    text-align: left;
}
.verify-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}
.verify-summary {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 600;
}
.verify-ok { background: #dcfce7; color: #166534; }
.verify-fail { background: #fee2e2; color: #991b1b; }
.verify-table { font-size: 13px; }
.status-ok { color: #166534; font-weight: 600; }
.status-fail { color: #991b1b; font-weight: 600; }

.activate-section {
    background: #dcfce7;
    border: 2px solid #166534;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}
.activate-section h3 { color: #166534; margin-top: 0; }

.email-input-group {
    display: flex;
    align-items: center;
}
.email-input-group input {
    flex: 1;
    border-right: none;
    border-radius: 6px 0 0 6px;
}
.email-suffix {
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
}

/* Sidebar tools section */
.sidebar-tools {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.sidebar-tools .folder-item {
    padding: 6px 12px;
    font-size: 13px;
    opacity: 0.85;
}
.sidebar-tools .folder-item:hover { opacity: 1; }

/* === Security Dashboard === */
.security-summary-card { padding: 20px; }
.security-summary {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
}
.security-stat {
    display: flex;
    align-items: center;
    gap: 12px;
}
.security-stat .stat-icon { font-size: 32px; }
.security-stat strong { display: block; font-size: 20px; }
.security-stat span { font-size: 13px; color: var(--text-light); }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }
.status-offline { background: #fee2e2; color: #991b1b; }
.status-running { background: #dcfce7; color: #166534; }

.security-layers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.security-layer-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: var(--white);
    transition: box-shadow 0.15s;
}
.security-layer-card.active { border-left: 3px solid #166534; }
.security-layer-card.inactive { border-left: 3px solid #991b1b; }
.security-layer-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.layer-icon { font-size: 24px; }
.layer-body strong { font-size: 14px; display: block; margin-bottom: 4px; }
.layer-body p { font-size: 12px; color: var(--text-light); margin: 0; line-height: 1.4; }

.score-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 700;
    font-size: 12px;
}
.score-low { background: #dcfce7; color: #166534; }
.score-mid { background: #fef3c7; color: #92400e; }
.score-warn { background: #fed7aa; color: #9a3412; }
.score-high { background: #fee2e2; color: #991b1b; }

.dnsbl-list, .fail2ban-rules {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.dnsbl-item, .f2b-rule {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
}
.dnsbl-item strong, .f2b-rule strong { min-width: 160px; }
.dnsbl-item span:nth-child(2) { font-family: monospace; font-size: 12px; color: var(--text-light); flex: 1; }
.f2b-rule span { flex: 1; font-size: 13px; color: var(--text-light); }

.ratelimit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
}
.rl-item {
    text-align: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}
.rl-item strong { display: block; font-size: 28px; color: var(--primary); }
.rl-item span { font-size: 12px; color: var(--text-light); }

/* Monitoring & Maintenance */
.monitoring-card { border-left: 4px solid var(--primary); }
.monitoring-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.monitoring-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}
.monitoring-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light, #e3f2fd);
    border-radius: 10px;
}
.monitoring-body { flex: 1; }
.monitoring-body strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.monitoring-body p { font-size: 13px; color: var(--text-light); margin: 0; line-height: 1.5; }
.monitoring-item .status-badge { flex-shrink: 0; margin-top: 2px; }

@media (max-width: 768px) {
    .ratelimit-grid { grid-template-columns: 1fr; }
    .security-layers-grid { grid-template-columns: 1fr; }
    .monitoring-item { flex-direction: column; gap: 10px; }
}

/* Domain status badges */
.domain-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.domain-status.status-active { background: #dcfce7; color: #166534; }
.domain-status.status-dns-ok { background: #d1fae5; color: #065f46; }
.domain-status.status-verified { background: #dbeafe; color: #1e40af; }
.domain-status.status-pending { background: #fef3c7; color: #92400e; }

/* DNS check fix instructions */
.dns-fix-row { background: #fffbeb !important; }
.dns-fix-row td { padding: 8px 12px !important; font-size: 12px; border-top: 1px dashed #fcd34d; }
.dns-fix-row code { background: #fef3c7; padding: 2px 6px; border-radius: 3px; font-size: 11px; word-break: break-all; }
.dns-fix-text { color: #92400e; display: block; margin-top: 4px; line-height: 1.4; }
.status-optional { color: #92400e; font-weight: 600; }

/* Auto-configure DNS box */
.auto-config-box {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.auto-config-box h4 { margin-top: 0; color: #1e40af; font-size: 15px; }
.auto-config-box .form-group { margin-bottom: 10px; }
.auto-config-box label { font-size: 13px; font-weight: 600; color: #1e40af; }
.auto-config-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 14px;
}
.auto-config-box input:focus { border-color: #3b82f6; outline: none; }

.manual-config-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--text-light);
    font-size: 13px;
}
.manual-config-divider::before,
.manual-config-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}
.manual-config-divider::before { left: 0; }
.manual-config-divider::after { right: 0; }
.manual-config-divider span {
    background: var(--white);
    padding: 0 12px;
    position: relative;
    z-index: 1;
}

/* CNAME conflict warning */
.cname-warning-box {
    background: #fff7ed;
    border: 2px solid #f97316;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}
.cname-warning-box h4 { margin-top: 0; color: #9a3412; font-size: 15px; }
.cname-warning-box ol { margin: 8px 0 8px 20px; padding: 0; }
.cname-warning-box li { margin-bottom: 4px; font-size: 13px; line-height: 1.5; }
.cname-warning-box code { background: #fed7aa; padding: 1px 6px; border-radius: 3px; font-size: 12px; }

/* Warning button (clear cache) */
.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}
.btn-warning:hover { background: #d97706; }
.btn-warning:disabled { opacity: 0.6; cursor: not-allowed; }
