/* ============================================
   Unix Mail - Complete Stylesheet
   ============================================ */

:root {
    --primary: #1e3a6b;
    --primary-dark: #152c52;
    --primary-light: #2a4f8a;
    --accent: #e89830;
    --accent-dark: #c87e20;
    --accent-light: #f0ad4e;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1f2937;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
    --theme-bg: var(--gray-100);
    --theme-text: var(--gray-800);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--theme-text);
    background: var(--theme-bg);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.fw-bold { font-weight: 600; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-auto { margin-left: auto; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.d-flex { display: flex; }
.d-none { display: none !important; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.overflow-auto { overflow: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cursor-pointer { cursor: pointer; }
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px; font-size: 11px; font-weight: 600;
    background: var(--primary); color: var(--white);
}
.badge-danger { background: var(--danger); }
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); color: var(--dark); }

/* ===== Login Page ===== */
.login-wrapper {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: #ffffff;
}
.login-card {
    background: var(--primary); border-radius: var(--radius);
    padding: 40px; width: 420px; max-width: 95%;
    box-shadow: var(--shadow-lg); color: #ffffff;
}
.login-card .logo {
    text-align: center; margin-bottom: 30px;
}
.login-card .logo h1 {
    font-size: 24px; color: #ffffff; margin-top: 10px;
}
.login-card .logo i {
    font-size: 48px; color: rgba(255,255,255,0.9);
}
.login-card .logo .text-muted {
    color: rgba(255,255,255,0.7);
}
.login-card .form-group label {
    color: rgba(255,255,255,0.9);
}
.login-card .form-control {
    background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3);
    color: #ffffff;
}
.login-card .form-control::placeholder { color: rgba(255,255,255,0.5); }
.login-card .form-control:focus {
    background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
.login-card .form-check { color: rgba(255,255,255,0.8); }
.login-card a { color: rgba(255,255,255,0.8); }
.login-card a:hover { color: #ffffff; }
.login-card .btn-primary {
    background: #ffffff; color: var(--primary); font-weight: 600;
}
.login-card .btn-primary:hover {
    background: rgba(255,255,255,0.9); transform: translateY(-1px);
}
.login-card .alert-danger {
    background: rgba(239,68,68,0.2); color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
}
.login-card .text-center.text-muted { color: rgba(255,255,255,0.5); }

/* ===== Form Elements ===== */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; margin-bottom: 4px; font-weight: 500;
    color: var(--gray-700); font-size: 0.9rem;
}
.form-control {
    width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm); font-size: 14px;
    transition: var(--transition); background: var(--white);
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 107, 0.15);
}
.form-control-sm { padding: 5px 10px; font-size: 13px; }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--dark); }
.btn-outline {
    background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center;
}
.btn-icon i { font-size: 16px; }
.btn-compose {
    background: var(--accent); color: #fff;
    padding: 12px 24px; border-radius: 24px; font-size: 15px;
    width: 100%; box-shadow: var(--shadow-md);
}
.btn-compose:hover { background: var(--accent-dark); box-shadow: var(--shadow-lg); }

/* ===== App Layout ===== */
.app-layout {
    display: flex; height: 100vh; overflow: hidden;
}

/* ===== Top Bar ===== */
.topbar {
    height: var(--topbar-height); background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; padding: 0 20px;
    gap: 16px; z-index: 100;
}
.topbar .search-box {
    flex: 1; max-width: 600px; position: relative;
}
.topbar .search-box input {
    width: 100%; padding: 8px 12px 8px 36px;
    border: 1px solid var(--gray-200); border-radius: 24px;
    background: var(--gray-50); font-size: 14px;
}
.topbar .search-box input:focus {
    background: var(--white); border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,58,107,0.1);
    outline: none;
}
.topbar .search-box i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400);
}
.topbar .profile-menu {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    padding: 4px 8px; border-radius: var(--radius-sm);
}
.topbar .profile-menu:hover { background: var(--gray-100); }
.topbar .profile-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width); height: 100vh;
    background: var(--white); border-right: 1px solid var(--gray-200);
    display: flex; flex-direction: column; flex-shrink: 0;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 16px 20px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--gray-200); font-weight: 700;
    font-size: 18px; color: var(--primary);
}
.sidebar-logo i { font-size: 24px; }
.sidebar-compose { padding: 16px 16px 8px; }
.sidebar-nav { padding: 8px 0; flex: 1; }
.sidebar-nav .nav-section {
    padding: 8px 16px 4px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-400);
}
.sidebar-nav .nav-item {
    display: flex; align-items: center; padding: 8px 16px;
    gap: 10px; cursor: pointer; transition: var(--transition);
    color: var(--gray-700); font-size: 13px; border-radius: 0;
    position: relative;
}
.sidebar-nav .nav-item:hover { background: var(--gray-100); }
.sidebar-nav .nav-item.active {
    background: rgba(30, 58, 107, 0.08); color: var(--primary);
    font-weight: 600;
}
.sidebar-nav .nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
    width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.sidebar-nav .nav-item i { width: 18px; text-align: center; font-size: 14px; }
.sidebar-nav .nav-item .badge { margin-left: auto; font-size: 10px; }
.sidebar-nav .nav-item .folder-counter {
    margin-left: auto; font-size: 11px; color: var(--gray-400);
    white-space: nowrap;
}
.sidebar-nav .nav-item .folder-counter strong {
    color: var(--accent); font-weight: 700;
}
.sidebar-nav .nav-item.active .folder-counter { color: var(--gray-500); }
.sidebar-nav .nav-item .folder-name { flex: 1; }

/* ===== Mail Layout ===== */
.mail-layout {
    display: flex; flex: 1; overflow: hidden;
}
.mail-content {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
    min-width: 0;
}

/* ===== Message List ===== */
.message-list-header {
    display: flex; align-items: center; padding: 8px 16px;
    border-bottom: 1px solid var(--gray-200); gap: 12px;
    background: var(--white); min-height: 48px;
}
.message-list-header .select-all {
    display: flex; align-items: center; gap: 8px;
}
.message-list-toolbar {
    display: flex; align-items: center; gap: 4px;
}
.filter-buttons {
    display: flex; align-items: center; gap: 2px; margin-right: 4px;
}
.btn-filter {
    border: none; background: none; padding: 4px 8px; font-size: 12px;
    color: var(--gray-500); cursor: pointer; border-radius: var(--radius);
    transition: all 0.15s; white-space: nowrap;
}
.btn-filter:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-filter.active {
    background: var(--primary); color: var(--white);
}
.btn-filter i { font-size: 11px; }
.message-list-toolbar .btn-icon {
    width: 32px; height: 32px; background: none;
    color: var(--gray-500); border: none;
}
.message-list-toolbar .btn-icon:hover {
    background: var(--gray-100); color: var(--gray-700);
}
.message-list-info {
    margin-left: auto; color: var(--gray-400); font-size: 12px;
    display: flex; align-items: center; gap: 2px; white-space: nowrap;
}
.btn-page-nav {
    width: 26px; height: 26px; border: 1px solid var(--gray-200);
    border-radius: 4px; background: var(--white); color: var(--gray-500);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; padding: 0; margin: 0 1px; transition: all 0.15s;
}
.btn-page-nav:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-700); }
.btn-page-nav:disabled { opacity: 0.4; cursor: default; }

.message-list {
    flex: 1; overflow-y: auto; background: var(--white);
}
.message-item {
    display: flex; align-items: center; padding: 10px 16px;
    gap: 12px; border-bottom: 1px solid var(--gray-100);
    cursor: pointer; transition: background 0.15s;
}
.message-item:hover { background: var(--gray-50); }
.message-item.unread { background: rgba(30, 58, 107, 0.03); }
.message-item.unread .msg-sender { font-weight: 700; color: var(--gray-900); }
.message-item.unread .msg-subject { font-weight: 600; color: var(--gray-900); }
.message-item.selected { background: rgba(30, 58, 107, 0.08); }
.message-item .msg-checkbox { flex-shrink: 0; }
.message-item .msg-star {
    flex-shrink: 0; cursor: pointer; color: var(--gray-300);
    font-size: 16px; transition: color 0.15s;
}
.message-item .msg-star:hover { color: var(--warning); }
.message-item .msg-star.starred { color: var(--warning); }
.message-item .msg-content { flex: 1; min-width: 0; }
.message-item .msg-sender {
    font-size: 13px; color: var(--gray-700); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.message-item .msg-subject {
    font-size: 13px; color: var(--gray-700);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.message-item .msg-snippet {
    font-size: 12px; color: var(--gray-400);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.message-item .msg-snippet-empty {
    font-style: italic; color: var(--gray-300);
}
.message-item .msg-meta {
    flex-shrink: 0; text-align: right; display: flex;
    flex-direction: column; align-items: flex-end; gap: 2px;
}
.message-item .msg-date { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.message-item .msg-icons {
    display: flex; gap: 4px; color: var(--gray-400); font-size: 12px;
}

/* ===== Reading Pane ===== */
.reading-pane {
    width: 0; border-left: 1px solid var(--gray-200);
    display: flex; flex-direction: column; background: var(--white);
    transition: width 0.3s ease; overflow: hidden;
}
.reading-pane.open { width: 60%; min-width: 400px; }
.reading-pane-placeholder {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); font-size: 16px; flex-direction: column; gap: 12px;
}
.reading-pane-placeholder i { font-size: 48px; }

.reading-header {
    padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
    display: flex; flex-direction: column; gap: 8px;
}
.reading-header .subject {
    font-size: 18px; font-weight: 600; color: var(--gray-900);
}
.reading-header .meta {
    display: flex; align-items: center; gap: 12px;
}
.reading-header .sender-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-light); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 16px; flex-shrink: 0;
}
.reading-header .sender-info { flex: 1; }
.reading-header .sender-name { font-weight: 600; font-size: 14px; }
.reading-header .sender-email { font-size: 12px; color: var(--gray-500); }
.reading-header .msg-date-full { font-size: 12px; color: var(--gray-500); }

.reading-actions {
    display: flex; padding: 8px 20px; gap: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.reading-body {
    flex: 1; overflow-y: auto; padding: 20px;
}
.reading-body .email-frame {
    width: 100%; border: none; min-height: 200px;
}
.reading-body iframe {
    width: 100%; border: none; min-height: 300px;
}

.reading-attachments {
    padding: 12px 20px; border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.reading-attachments h4 {
    font-size: 12px; color: var(--gray-500); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    background: var(--white); cursor: pointer; font-size: 12px;
}
.attachment-item:hover { border-color: var(--primary); }
.attachment-item i { color: var(--gray-500); }
.attachment-item .att-size { color: var(--gray-400); }
.attachment-item .att-download { margin-left: auto; color: var(--gray-300); font-size: 11px; }
.attachment-item:hover .att-download { color: var(--primary); }

/* ===== Compose Modal ===== */
.compose-modal {
    position: fixed; bottom: 0; right: 20px;
    width: 580px; max-height: 80vh;
    background: var(--white); border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-lg); z-index: 1000;
    display: flex; flex-direction: column;
    border: 1px solid var(--gray-200); border-bottom: none;
}
.compose-modal.minimized { max-height: 48px; overflow: hidden; }
.compose-modal.fullscreen {
    width: 80vw; max-width: 900px; max-height: 90vh;
    top: 5vh; left: 50%; transform: translateX(-50%);
    bottom: auto; border-radius: var(--radius);
    border-bottom: 1px solid var(--gray-200);
}
.compose-header {
    display: flex; align-items: center; padding: 12px 16px;
    background: var(--gray-800); color: var(--white);
    border-radius: var(--radius) var(--radius) 0 0; cursor: pointer;
}
.compose-header h3 { flex: 1; font-size: 14px; font-weight: 500; }
.compose-header .btn-icon { color: var(--white); background: none; }
.compose-header .btn-icon:hover { background: rgba(255,255,255,0.1); }

.compose-fields { padding: 8px 16px; border-bottom: 1px solid var(--gray-100); }
.compose-field {
    display: flex; align-items: center; padding: 6px 0;
    border-bottom: 1px solid var(--gray-100); gap: 8px;
}
.compose-field:last-child { border-bottom: none; }
.compose-field label {
    font-size: 13px; color: var(--gray-500); width: 50px;
    flex-shrink: 0;
}
.compose-field input {
    flex: 1; border: none; outline: none; font-size: 14px; padding: 4px 0;
}
.compose-field .toggle-cc {
    font-size: 12px; color: var(--gray-400); cursor: pointer;
}
.compose-field .toggle-cc:hover { color: var(--primary); }

.compose-editor { flex: 1; min-height: 200px; overflow: hidden; display: flex; flex-direction: column; }
.compose-toolbar {
    display: flex; align-items: center; padding: 4px 8px;
    border-bottom: 1px solid var(--gray-100); gap: 2px; flex-wrap: wrap;
}
.compose-toolbar button {
    width: 32px; height: 32px; border: none; background: none;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--gray-600);
    display: flex; align-items: center; justify-content: center;
}
.compose-toolbar button:hover { background: var(--gray-100); }
.compose-toolbar button.active { background: var(--gray-200); color: var(--primary); }
.compose-toolbar .separator {
    width: 1px; height: 20px; background: var(--gray-200); margin: 0 4px;
}

.compose-body {
    flex: 1; padding: 12px 16px; outline: none; overflow-y: auto;
    min-height: 150px; line-height: 1.6; font-size: 14px;
}
.compose-body:empty::before {
    content: 'Write your message here...';
    color: var(--gray-400);
}

.compose-footer {
    display: flex; align-items: center; padding: 10px 16px;
    border-top: 1px solid var(--gray-200); gap: 8px;
}
.compose-footer .btn-send { padding: 8px 24px; font-size: 14px; }
.compose-footer .attachment-btn {
    background: none; border: none; color: var(--gray-500);
    cursor: pointer; font-size: 18px; padding: 4px 8px;
}
.compose-footer .attachment-btn:hover { color: var(--gray-700); }
.compose-footer .more-options { margin-left: auto; }

/* ===== Dashboard ===== */
.dashboard-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px; padding: 20px;
}
.dashboard-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.dashboard-card .card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
    font-weight: 600; font-size: 15px;
    display: flex; align-items: center; justify-content: space-between;
}
.dashboard-card .card-body { padding: 20px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--gray-500); }
.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.stat-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-info { flex: 1; }
.dashboard {
    padding: 24px;
}
.dashboard > * + * {
    margin-top: 24px;
}
.stat-item {
    padding: 12px; background: var(--gray-50); border-radius: var(--radius-sm);
    text-align: center;
}

.account-list-item {
    display: flex; align-items: center; padding: 12px 0;
    border-bottom: 1px solid var(--gray-100); gap: 12px;
}
.account-list-item:last-child { border-bottom: none; }
.account-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.account-icon.gmail { background: #fce4e4; color: #ea4335; }
.account-icon.outlook { background: #e4f0fc; color: #0078d4; }
.account-icon.default { background: var(--gray-100); color: var(--gray-500); }

/* ===== Settings ===== */
.settings-layout {
    display: flex; flex-direction: column; height: calc(100vh - var(--topbar-height));
}
.settings-sidebar {
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    padding: 0 16px; display: flex; overflow-x: auto;
}
.settings-nav {
    display: flex; gap: 0;
}
.settings-sidebar .nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; cursor: pointer; color: var(--gray-600);
    font-size: 13px; transition: var(--transition);
    white-space: nowrap; border-bottom: 3px solid transparent;
}
.settings-sidebar .nav-item:hover { color: var(--gray-900); background: var(--gray-50); }
.settings-sidebar .nav-item.active {
    color: var(--primary); font-weight: 600;
    border-bottom: 3px solid var(--primary); background: transparent;
}
.settings-sidebar .nav-item i { width: 16px; text-align: center; font-size: 13px; }

.settings-content {
    flex: 1; overflow-y: auto; padding: 24px 32px;
}
.settings-content h2 {
    font-size: 20px; margin-bottom: 20px; color: var(--gray-900);
    padding-bottom: 12px; border-bottom: 1px solid var(--gray-200);
}
.settings-section {
    background: var(--white); border-radius: var(--radius);
    padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.settings-section h3 {
    font-size: 16px; margin-bottom: 16px; color: var(--gray-800);
}
.settings-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.color-input-group {
    display: flex; align-items: center; gap: 8px;
}
.color-input-group input[type="color"] {
    width: 40px; height: 36px; border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm); cursor: pointer; padding: 2px;
}
.color-input-group input[type="text"] { width: 100px; }
input[type="color"].form-control, input[type="color"].color-input {
    width: 100%; height: 42px; padding: 4px; cursor: pointer;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
}

/* ===== Theme Color Settings ===== */
.theme-colors-section { margin-top: 24px; }
.theme-colors-section h4 {
    margin: 0 0 12px; font-size: 15px; color: var(--gray-800);
    display: flex; align-items: center; gap: 8px;
}
.theme-colors-section h4 i { font-size: 14px; color: var(--gray-400); }
.theme-color-block {
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.theme-color-block h5 {
    font-size: 13px; font-weight: 600; color: var(--gray-700);
    margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.theme-color-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.theme-color-item label {
    display: block; font-size: 12px; color: var(--gray-500);
    margin-bottom: 4px; font-weight: 500;
}
.theme-color-item input[type="color"] {
    width: 100%; height: 36px; padding: 2px; cursor: pointer;
    border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
}
.theme-color-item .color-hex {
    font-size: 11px; color: var(--gray-400); margin-top: 2px;
    text-align: center; font-family: monospace;
}

/* ===== Table ===== */
.table-wrapper { overflow-x: auto; }
table.data-table {
    width: 100%; border-collapse: collapse;
}
table.data-table th {
    text-align: left; padding: 10px 12px; font-size: 12px;
    font-weight: 600; color: var(--gray-500); text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}
table.data-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}
table.data-table tr:hover td { background: var(--gray-50); }

/* ===== Modal / Dialog ===== */
.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;
}
.modal-overlay.hidden { display: none; }
.modal-dialog {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-width: 600px; width: 95%;
    max-height: 85vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal-dialog.lg { max-width: 800px; }
.modal-header {
    display: flex; align-items: center; padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { flex: 1; font-size: 16px; }
.modal-header .close-btn {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: var(--gray-400);
    width: 32px; height: 32px; display: flex;
    align-items: center; justify-content: center;
    border-radius: 50%;
}
.modal-header .close-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 12px 20px; border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 13px;
    display: flex; align-items: center; gap: 8px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: var(--radius-sm);
    color: var(--white); font-size: 13px; min-width: 280px;
    box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
    display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--dark); }
.toast.info { background: var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Loading / Spinner ===== */
.loading {
    display: flex; align-items: center; justify-content: center;
    padding: 40px; color: var(--gray-400);
}
.spinner {
    width: 32px; height: 32px; border: 3px solid var(--gray-200);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty State ===== */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 13px; max-width: 300px; text-align: center; }

/* ===== Dropdown ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    min-width: 180px; z-index: 500; display: none;
}
.dropdown-menu.active { display: block; }
.dropdown-menu .dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; cursor: pointer; font-size: 13px;
    color: var(--gray-700); transition: background 0.15s;
}
.dropdown-menu .dropdown-item:hover { background: var(--gray-50); }
.dropdown-menu .dropdown-item i { width: 16px; color: var(--gray-400); }
.dropdown-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ===== Tabs ===== */
.tabs {
    display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px;
}
.tab-item {
    padding: 10px 20px; cursor: pointer; font-size: 14px;
    color: var(--gray-500); font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: var(--transition);
}
.tab-item:hover { color: var(--gray-700); }
.tab-item.active {
    color: var(--primary); border-bottom-color: var(--primary);
}

/* ===== 404 ===== */
.error-page {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; flex-direction: column; gap: 16px;
}
.error-page h1 { font-size: 72px; color: var(--gray-300); }
.error-page p { font-size: 18px; color: var(--gray-500); }

/* ===== Hamburger Button (hidden on desktop) ===== */
.btn-hamburger {
    display: none; background: none; border: none;
    font-size: 20px; color: var(--gray-600); cursor: pointer;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-hamburger:hover { background: var(--gray-100); color: var(--gray-800); }

/* Mobile back button in reading pane (hidden on desktop) */
.mobile-back-btn { display: none !important; }

/* Sidebar overlay (mobile only) */
.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 199;
}

/* ===== Responsive: Tablet (<=1024px) ===== */
@media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .reading-pane.open { width: 55%; min-width: 320px; }
    .settings-content { padding: 20px 16px; }
    .topbar .profile-menu span { display: none; }
}

/* ===== Responsive: Mobile (<=768px) ===== */
@media (max-width: 768px) {
    /* Show hamburger */
    .btn-hamburger { display: flex; }

    /* Sidebar: off-canvas drawer */
    .sidebar {
        position: fixed; left: -280px; top: 0; bottom: 0;
        width: 280px; z-index: 200;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .app-layout.sidebar-open .sidebar {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .app-layout.sidebar-open .sidebar-overlay {
        display: block;
    }

    /* Sidebar content */
    .sidebar .sidebar-logo span { display: inline; }
    .sidebar .nav-item .folder-name { display: inline; }
    .sidebar .nav-item .badge { display: inline-flex; }
    .sidebar .btn-compose span { display: inline; }

    /* Mail layout: stack vertically */
    .mail-layout { flex-direction: column; }
    .mail-content { flex: 1; min-height: 0; }

    /* Reading pane: hidden when closed, full overlay when open */
    .reading-pane { display: none !important; }
    .reading-pane.open {
        display: flex !important;
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important; min-width: 0;
        z-index: 150;
    }
    .mobile-back-btn { display: flex !important; }

    /* Topbar */
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar .search-box { max-width: none; }
    .topbar .search-box input { font-size: 13px; padding: 6px 10px 6px 32px; }
    .topbar .profile-menu span { display: none; }
    .topbar .profile-menu i.fa-chevron-down { display: none; }
    .topbar h2 { font-size: 14px; white-space: nowrap; }

    /* Theme switcher compact */
    .theme-switcher { padding: 2px; gap: 2px; }
    .theme-btn { padding: 4px 6px; }
    .theme-label { display: none; }

    /* Message list items: touch-friendly */
    .message-item { padding: 12px 12px; gap: 10px; min-height: 60px; }
    .message-item .msg-sender { font-size: 13px; }
    .message-item .msg-subject { font-size: 13px; }
    .message-item .msg-snippet { font-size: 12px; }
    .message-item .msg-checkbox { width: 18px; height: 18px; }

    /* Message list header */
    .message-list-header { padding: 6px 12px; gap: 8px; flex-wrap: wrap; }
    .filter-buttons { gap: 1px; overflow-x: auto; flex-wrap: nowrap; }
    .btn-filter { padding: 4px 6px; font-size: 11px; }

    /* Compose modal: near full-screen */
    .compose-modal {
        width: calc(100% - 16px) !important; right: 8px !important;
        max-height: 85vh;
    }
    .compose-modal.fullscreen {
        width: 100vw !important; max-width: 100vw;
        top: 0; left: 0; right: 0; bottom: 0;
        transform: none; max-height: 100vh;
        border-radius: 0;
    }
    .compose-fields { padding: 6px 12px; }
    .compose-field label { width: 40px; font-size: 12px; }
    .compose-toolbar { flex-wrap: wrap; }
    .compose-body { min-height: 120px; padding: 10px 12px; }
    .compose-footer { padding: 8px 12px; }

    /* Settings: horizontal scrollable tabs */
    .settings-sidebar { padding: 0; }
    .settings-sidebar .nav-item { padding: 10px 12px; font-size: 12px; }
    .settings-sidebar .nav-item span { display: none; }
    .settings-sidebar .nav-item i { font-size: 16px; }
    .settings-content { padding: 16px 12px; }
    .settings-section { padding: 16px; }
    .settings-content h2 { font-size: 18px; margin-bottom: 16px; }

    /* Form grid: single column on mobile */
    .form-grid { display: block; }
    .form-grid .form-group { margin-bottom: 12px; }
    .settings-row { grid-template-columns: 1fr; }
    .theme-color-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Dashboard stats: single column */
    .stat-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
    .dashboard { padding: 12px; }

    /* Tables: horizontal scroll */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.data-table { min-width: 500px; }

    /* Modals */
    .modal-dialog { width: 98%; max-width: 98%; margin: 8px auto; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 12px 16px; }

    /* Buttons: min touch target 44px */
    .btn { min-height: 38px; }
    .btn-icon { width: 40px; height: 40px; }

    /* Reading pane adjustments */
    .reading-header { padding: 12px 16px; }
    .reading-header .subject { font-size: 16px; }
    .reading-actions {
        padding: 8px 12px; flex-wrap: nowrap;
        gap: 4px; overflow: visible;
    }
    .reading-actions .btn { flex-shrink: 0; padding: 6px 8px; font-size: 12px; min-height: 34px; }
    .reading-actions .btn span,
    .reading-actions .btn-text { display: none; }
    .reading-actions .dropdown { flex-shrink: 0; }
    .reading-actions .dropdown-menu {
        right: 0; top: 100%; bottom: auto; margin-top: 4px;
        z-index: 600;
    }
    .reading-body { padding: 12px; }
    .reading-attachments { padding: 10px 12px; }
    .attachment-list { gap: 6px; }
    .attachment-item { padding: 6px 10px; font-size: 11px; }

    /* Dropdown menus: wider on mobile */
    .dropdown-menu { min-width: 200px; }

    /* Bulk actions */
    .bulk-actions { flex-wrap: wrap; gap: 4px; }
    .bulk-actions .btn-sm { min-height: 32px; }

    /* Login page */
    .login-card { padding: 24px 20px; width: 100%; max-width: 95%; }
}

/* ===== Responsive: Small Phone (<=480px) ===== */
@media (max-width: 480px) {
    html { font-size: 13px; }

    .topbar { gap: 6px; padding: 0 8px; }
    .topbar .search-box input { padding: 5px 8px 5px 28px; font-size: 12px; }
    .topbar .search-box i { left: 8px; font-size: 12px; }

    /* Hide sync button, account dropdown on very small screens */
    .topbar .dropdown:not(:last-child) { display: none; }
    .topbar .btn-outline { display: none; }

    .sidebar { width: 260px; left: -260px; }
    .message-item { padding: 10px 8px; gap: 8px; }
    .compose-modal { width: 100% !important; right: 0 !important; }

    .settings-content { padding: 12px 8px; }
    .settings-section { padding: 12px; }

    .reading-header .meta { flex-direction: column; align-items: flex-start; gap: 8px; }
    .reading-actions { gap: 3px; }
    .reading-actions .btn { font-size: 11px; padding: 5px 6px; min-height: 32px; }

    /* Stack filter buttons if needed */
    .filter-buttons { overflow-x: auto; max-width: 100%; }
}

/* ===== Theme Switcher ===== */
.theme-switcher {
    display: flex; align-items: center; gap: 4px;
    background: var(--gray-100); border-radius: 20px; padding: 3px;
}
.theme-btn {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    border: none; background: none; padding: 5px 10px; border-radius: 16px;
    cursor: pointer; font-size: 13px; color: var(--gray-500);
    transition: all 0.25s ease; white-space: nowrap;
}
.theme-btn i { font-size: 12px; }
.theme-btn:hover { color: var(--gray-700); }
.theme-btn.active {
    background: var(--white); color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.theme-label { font-size: 11px; }

/* =========================================
   DARK THEME
   ========================================= */
[data-theme="dark"] {
    --white: #1a1a2e;
    --gray-50: #1e1e36;
    --gray-100: #252542;
    --gray-200: #2d2d50;
    --gray-300: #3d3d66;
    --gray-400: #7a7a9e;
    --gray-500: #9e9eb8;
    --gray-600: #b8b8d0;
    --gray-700: #d1d1e2;
    --gray-800: #e8e8f0;
    --gray-900: #f0f0f8;
    --dark: #f0f0f8;
    --light: #1a1a2e;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.3);
}
[data-theme="dark"] {
    --theme-bg: #0f0f23;
    --theme-text: var(--gray-800);
}
[data-theme="dark"] body {
    background: var(--theme-bg);
    color: var(--theme-text);
}
[data-theme="dark"] .topbar .search-box input:focus {
    background: var(--gray-100);
    box-shadow: 0 0 0 3px rgba(30,58,107,0.2);
}
[data-theme="dark"] .compose-header {
    background: #12122a;
}
[data-theme="dark"] .compose-field input {
    background: transparent; color: var(--gray-800);
}
[data-theme="dark"] .compose-body {
    color: var(--gray-800);
}
[data-theme="dark"] .modal-overlay {
    background: rgba(0,0,0,0.7);
}
[data-theme="dark"] .alert-success { background: #0a2e1a; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .alert-danger { background: #2e0a0a; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .alert-warning { background: #2e1f0a; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .alert-info { background: #0a1e2e; color: #93c5fd; border-color: #1e40af; }
[data-theme="dark"] .theme-switcher {
    background: var(--gray-200);
}
[data-theme="dark"] .theme-btn.active {
    background: var(--gray-100);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--gray-50); color: var(--gray-800);
    border-color: var(--gray-300);
}
[data-theme="dark"] .form-control {
    background: var(--gray-50); color: var(--gray-800);
    border-color: var(--gray-300);
}
[data-theme="dark"] .form-control:focus {
    background: var(--gray-100);
}
[data-theme="dark"] table.data-table th {
    background: var(--gray-100);
}
[data-theme="dark"] .stat-item {
    background: var(--gray-100);
}

/* =========================================
   FOREST THEME (Forest/Nature Animated)
   ========================================= */
[data-theme="forest"] {
    --white: rgba(10, 30, 50, 0.85);
    --gray-50: rgba(15, 40, 65, 0.8);
    --gray-100: rgba(20, 50, 75, 0.75);
    --gray-200: rgba(30, 65, 95, 0.6);
    --gray-300: rgba(80, 130, 170, 0.7);
    --gray-400: #7eb8d8;
    --gray-500: #a0d0e8;
    --gray-600: #c0e0f0;
    --gray-700: #d8eef8;
    --gray-800: #e8f4fa;
    --gray-900: #f0f8ff;
    --dark: #f0f8ff;
    --light: rgba(10, 30, 50, 0.85);
    --shadow: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.45), 0 4px 6px rgba(0,0,0,0.35);
    --theme-bg: #0a1e32;
    --theme-text: var(--gray-800);
}

/* Animated forest background */
[data-theme="forest"] body {
    background: var(--theme-bg);
    color: var(--theme-text);
}
[data-theme="forest"] body::before {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(30, 58, 107, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #0a2e3d 0%, #0c3547 30%, #0d4a3e 60%, #062e30 100%);
    animation: forestShift 12s ease-in-out infinite alternate;
}
[data-theme="forest"] body::after {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(232, 152, 48, 0.03) 40px,
            rgba(232, 152, 48, 0.03) 80px
        );
    animation: waveMove 8s linear infinite;
}
@keyframes forestShift {
    0% { 
        background:
            radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.25) 0%, transparent 60%),
            radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
            radial-gradient(ellipse at 60% 80%, rgba(30, 58, 107, 0.2) 0%, transparent 50%),
            linear-gradient(180deg, #0a2e3d 0%, #0c3547 30%, #0d4a3e 60%, #062e30 100%);
    }
    100% {
        background:
            radial-gradient(ellipse at 70% 40%, rgba(6, 182, 212, 0.3) 0%, transparent 60%),
            radial-gradient(ellipse at 30% 70%, rgba(232, 152, 48, 0.2) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 20%, rgba(30, 58, 107, 0.15) 0%, transparent 50%),
            linear-gradient(180deg, #062e30 0%, #0d4a3e 30%, #0c3547 60%, #0a2e3d 100%);
    }
}
@keyframes waveMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(80px); }
}

/* Glassmorphism for forest theme panels */
[data-theme="forest"] .sidebar {
    background: rgba(10, 30, 50, 0.88);
    border-right-color: rgba(80, 160, 200, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="forest"] .topbar {
    background: rgba(10, 30, 50, 0.82);
    border-bottom-color: rgba(80, 160, 200, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
[data-theme="forest"] .mail-content {
    background: transparent;
}
[data-theme="forest"] .message-list {
    background: rgba(10, 30, 50, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
[data-theme="forest"] .message-list-header {
    background: rgba(10, 30, 50, 0.75);
    border-bottom-color: rgba(80, 160, 200, 0.15);
}
[data-theme="forest"] .reading-pane {
    background: rgba(10, 30, 50, 0.82);
    border-left-color: rgba(80, 160, 200, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
[data-theme="forest"] .message-item {
    border-bottom-color: rgba(80, 160, 200, 0.1);
}
[data-theme="forest"] .message-item:hover {
    background: rgba(6, 182, 212, 0.08);
}
[data-theme="forest"] .message-item.unread {
    background: rgba(16, 185, 129, 0.06);
}
[data-theme="forest"] .reading-header {
    border-bottom-color: rgba(80, 160, 200, 0.15);
}
[data-theme="forest"] .compose-modal {
    background: rgba(10, 30, 50, 0.92);
    border-color: rgba(80, 160, 200, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="forest"] .compose-header {
    background: rgba(6, 30, 50, 0.95);
}
[data-theme="forest"] .compose-field input {
    background: transparent; color: var(--gray-800);
}
[data-theme="forest"] .compose-body { color: var(--gray-800); }
[data-theme="forest"] .dropdown-menu {
    background: rgba(10, 30, 50, 0.92);
    border-color: rgba(80, 160, 200, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="forest"] .dropdown-menu .dropdown-item:hover {
    background: rgba(6, 182, 212, 0.1);
}
[data-theme="forest"] .settings-section,
[data-theme="forest"] .dashboard-card,
[data-theme="forest"] .stat-card {
    background: rgba(10, 30, 50, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
[data-theme="forest"] .modal-overlay {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
[data-theme="forest"] .modal-dialog {
    background: rgba(10, 30, 50, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="forest"] .theme-switcher {
    background: rgba(20, 50, 75, 0.6);
}
[data-theme="forest"] .theme-btn.active {
    background: rgba(6, 182, 212, 0.2);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}
[data-theme="forest"] .topbar .search-box input {
    background: rgba(15, 40, 65, 0.7);
    border-color: rgba(80, 160, 200, 0.2);
}
[data-theme="forest"] .topbar .search-box input:focus {
    background: rgba(15, 40, 65, 0.9);
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}
[data-theme="forest"] .attachment-item {
    background: rgba(10, 30, 50, 0.6);
    border-color: rgba(80, 160, 200, 0.2);
}
[data-theme="forest"] .btn-compose {
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}
[data-theme="forest"] input[type="text"],
[data-theme="forest"] input[type="email"],
[data-theme="forest"] input[type="password"],
[data-theme="forest"] input[type="number"],
[data-theme="forest"] input[type="url"],
[data-theme="forest"] select,
[data-theme="forest"] textarea,
[data-theme="forest"] .form-control {
    background: rgba(15, 40, 65, 0.7);
    color: var(--gray-800);
    border-color: rgba(80, 160, 200, 0.2);
}
[data-theme="forest"] .form-control:focus {
    background: rgba(15, 40, 65, 0.9);
}
[data-theme="forest"] .alert-success { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
[data-theme="forest"] .alert-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
[data-theme="forest"] .alert-warning { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
[data-theme="forest"] .alert-info { background: rgba(6,182,212,0.15); color: #93c5fd; border-color: rgba(6,182,212,0.3); }
[data-theme="forest"] table.data-table th {
    background: rgba(15, 40, 65, 0.6);
}
[data-theme="forest"] .stat-item {
    background: rgba(15, 40, 65, 0.5);
}
[data-theme="forest"] .settings-sidebar {
    background: rgba(10, 30, 50, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
[data-theme="forest"] .settings-content {
    background: transparent;
}
[data-theme="forest"] .btn-filter.active {
    background: rgba(6, 182, 212, 0.3);
    color: #a0d0e8;
}
[data-theme="forest"] .sidebar-nav .nav-item.active {
    background: rgba(6, 182, 212, 0.1);
}
/* Forest ripple overlay animation */
[data-theme="forest"] .app-layout::before {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; pointer-events: none;
    background: 
        radial-gradient(circle at 25% 25%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
    animation: ripple 6s ease-in-out infinite alternate;
}
@keyframes ripple {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* =========================================
   OCEAN THEME (Beach/Tropical Animated)
   ========================================= */
[data-theme="ocean"] {
    --white: rgba(20, 50, 70, 0.82);
    --gray-50: rgba(25, 55, 78, 0.78);
    --gray-100: rgba(30, 65, 90, 0.72);
    --gray-200: rgba(50, 90, 120, 0.55);
    --gray-300: rgba(120, 170, 195, 0.65);
    --gray-400: #8ec5d6;
    --gray-500: #b0d8e6;
    --gray-600: #cce8f0;
    --gray-700: #dff0f6;
    --gray-800: #eaf6fa;
    --gray-900: #f5fbff;
    --dark: #f5fbff;
    --light: rgba(20, 50, 70, 0.82);
    --primary: #1a6b8a;
    --primary-dark: #145a74;
    --primary-light: #2393b8;
    --accent: #d4a44c;
    --accent-dark: #b8893a;
    --accent-light: #e8be6e;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.3);
    --theme-bg: #87ceeb;
    --theme-text: var(--gray-800);
}

/* Animated beach background */
[data-theme="ocean"] body {
    background: var(--theme-bg);
    color: var(--theme-text);
}
[data-theme="ocean"] body::before {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background:
        /* Sky */
        radial-gradient(ellipse at 50% 0%, rgba(173, 216, 250, 0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 10%, rgba(255, 255, 255, 0.3) 0%, transparent 30%),
        radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.25) 0%, transparent 25%),
        /* Water shimmer */
        radial-gradient(ellipse at 30% 50%, rgba(64, 196, 220, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 45%, rgba(90, 210, 230, 0.3) 0%, transparent 45%),
        /* Sand at bottom */
        radial-gradient(ellipse at 50% 100%, rgba(210, 180, 140, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 95%, rgba(222, 196, 155, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 95%, rgba(194, 167, 125, 0.5) 0%, transparent 40%),
        /* Base gradient: sky to water to sand */
        linear-gradient(180deg, #87ceeb 0%, #a8e0f0 15%, #5bc5d8 35%, #3fb8cc 50%, #d2c6a0 75%, #c8b88a 90%, #bfa87a 100%);
    animation: oceanWaves 10s ease-in-out infinite alternate;
}
[data-theme="ocean"] body::after {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background:
        /* Wave lines */
        repeating-linear-gradient(
            175deg,
            transparent,
            transparent 60px,
            rgba(255, 255, 255, 0.04) 60px,
            rgba(255, 255, 255, 0.04) 62px
        ),
        repeating-linear-gradient(
            185deg,
            transparent,
            transparent 80px,
            rgba(100, 200, 230, 0.05) 80px,
            rgba(100, 200, 230, 0.05) 82px
        );
    animation: tideMove 6s linear infinite;
}
@keyframes oceanWaves {
    0% {
        background:
            radial-gradient(ellipse at 50% 0%, rgba(173, 216, 250, 0.9) 0%, transparent 60%),
            radial-gradient(ellipse at 80% 10%, rgba(255, 255, 255, 0.3) 0%, transparent 30%),
            radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, 0.25) 0%, transparent 25%),
            radial-gradient(ellipse at 30% 50%, rgba(64, 196, 220, 0.4) 0%, transparent 50%),
            radial-gradient(ellipse at 70% 45%, rgba(90, 210, 230, 0.3) 0%, transparent 45%),
            radial-gradient(ellipse at 50% 100%, rgba(210, 180, 140, 0.6) 0%, transparent 50%),
            radial-gradient(ellipse at 30% 95%, rgba(222, 196, 155, 0.5) 0%, transparent 40%),
            radial-gradient(ellipse at 70% 95%, rgba(194, 167, 125, 0.5) 0%, transparent 40%),
            linear-gradient(180deg, #87ceeb 0%, #a8e0f0 15%, #5bc5d8 35%, #3fb8cc 50%, #d2c6a0 75%, #c8b88a 90%, #bfa87a 100%);
    }
    100% {
        background:
            radial-gradient(ellipse at 50% 0%, rgba(173, 216, 250, 0.85) 0%, transparent 60%),
            radial-gradient(ellipse at 60% 12%, rgba(255, 255, 255, 0.35) 0%, transparent 30%),
            radial-gradient(ellipse at 40% 8%, rgba(255, 255, 255, 0.2) 0%, transparent 25%),
            radial-gradient(ellipse at 60% 48%, rgba(64, 196, 220, 0.35) 0%, transparent 50%),
            radial-gradient(ellipse at 40% 52%, rgba(90, 210, 230, 0.35) 0%, transparent 45%),
            radial-gradient(ellipse at 50% 100%, rgba(210, 180, 140, 0.65) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 92%, rgba(222, 196, 155, 0.45) 0%, transparent 40%),
            radial-gradient(ellipse at 60% 98%, rgba(194, 167, 125, 0.45) 0%, transparent 40%),
            linear-gradient(180deg, #82c8e6 0%, #a0dce8 15%, #4dbdd2 35%, #38b0c5 50%, #d5c8a5 75%, #cbbb90 90%, #c2ab80 100%);
    }
}
@keyframes tideMove {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(3px) translateX(5px); }
}

/* Glassmorphism for ocean theme panels */
[data-theme="ocean"] .sidebar {
    background: rgba(20, 60, 85, 0.85);
    border-right-color: rgba(140, 210, 235, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="ocean"] .topbar {
    background: rgba(20, 60, 85, 0.80);
    border-bottom-color: rgba(140, 210, 235, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
[data-theme="ocean"] .mail-content {
    background: transparent;
}
[data-theme="ocean"] .message-list {
    background: rgba(20, 55, 80, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
[data-theme="ocean"] .message-list-header {
    background: rgba(20, 55, 80, 0.72);
    border-bottom-color: rgba(140, 210, 235, 0.15);
}
[data-theme="ocean"] .reading-pane {
    background: rgba(20, 55, 80, 0.80);
    border-left-color: rgba(140, 210, 235, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
[data-theme="ocean"] .message-item {
    border-bottom-color: rgba(140, 210, 235, 0.1);
}
[data-theme="ocean"] .message-item:hover {
    background: rgba(90, 200, 225, 0.1);
}
[data-theme="ocean"] .message-item.unread {
    background: rgba(64, 196, 220, 0.08);
}
[data-theme="ocean"] .reading-header {
    border-bottom-color: rgba(140, 210, 235, 0.15);
}
[data-theme="ocean"] .compose-modal {
    background: rgba(20, 55, 80, 0.90);
    border-color: rgba(140, 210, 235, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="ocean"] .compose-header {
    background: rgba(15, 50, 75, 0.95);
}
[data-theme="ocean"] .compose-field input {
    background: transparent; color: var(--gray-800);
}
[data-theme="ocean"] .compose-body { color: var(--gray-800); }
[data-theme="ocean"] .dropdown-menu {
    background: rgba(20, 55, 80, 0.90);
    border-color: rgba(140, 210, 235, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="ocean"] .dropdown-menu .dropdown-item:hover {
    background: rgba(90, 200, 225, 0.12);
}
[data-theme="ocean"] .settings-section,
[data-theme="ocean"] .dashboard-card,
[data-theme="ocean"] .stat-card {
    background: rgba(20, 55, 80, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
[data-theme="ocean"] .modal-overlay {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
[data-theme="ocean"] .modal-dialog {
    background: rgba(20, 55, 80, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
[data-theme="ocean"] .theme-switcher {
    background: rgba(30, 70, 100, 0.55);
}
[data-theme="ocean"] .theme-btn.active {
    background: rgba(90, 200, 225, 0.2);
    box-shadow: 0 0 8px rgba(90, 200, 225, 0.2);
}
[data-theme="ocean"] .topbar .search-box input {
    background: rgba(20, 55, 80, 0.65);
    border-color: rgba(140, 210, 235, 0.2);
}
[data-theme="ocean"] .topbar .search-box input:focus {
    background: rgba(20, 55, 80, 0.85);
    border-color: rgba(90, 200, 225, 0.5);
    box-shadow: 0 0 0 3px rgba(90, 200, 225, 0.15);
}
[data-theme="ocean"] .attachment-item {
    background: rgba(20, 55, 80, 0.55);
    border-color: rgba(140, 210, 235, 0.2);
}
[data-theme="ocean"] .btn-compose {
    box-shadow: 0 2px 8px rgba(212, 164, 76, 0.3);
}
[data-theme="ocean"] input[type="text"],
[data-theme="ocean"] input[type="email"],
[data-theme="ocean"] input[type="password"],
[data-theme="ocean"] input[type="number"],
[data-theme="ocean"] input[type="url"],
[data-theme="ocean"] select,
[data-theme="ocean"] textarea,
[data-theme="ocean"] .form-control {
    background: rgba(20, 55, 80, 0.65);
    color: var(--gray-800);
    border-color: rgba(140, 210, 235, 0.2);
}
[data-theme="ocean"] .form-control:focus {
    background: rgba(20, 55, 80, 0.85);
}
[data-theme="ocean"] .alert-success { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
[data-theme="ocean"] .alert-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
[data-theme="ocean"] .alert-warning { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
[data-theme="ocean"] .alert-info { background: rgba(90,200,225,0.15); color: #a0e8f5; border-color: rgba(90,200,225,0.3); }
[data-theme="ocean"] table.data-table th {
    background: rgba(20, 55, 80, 0.55);
}
[data-theme="ocean"] .stat-item {
    background: rgba(20, 55, 80, 0.45);
}
[data-theme="ocean"] .settings-sidebar {
    background: rgba(20, 55, 80, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
[data-theme="ocean"] .settings-content {
    background: transparent;
}
[data-theme="ocean"] .btn-filter.active {
    background: rgba(90, 200, 225, 0.25);
    color: #b0d8e6;
}
[data-theme="ocean"] .sidebar-nav .nav-item.active {
    background: rgba(90, 200, 225, 0.1);
}
/* Shimmer overlay for ocean */
[data-theme="ocean"] .app-layout::before {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; pointer-events: none;
    background:
        radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 65% 55%, rgba(90, 200, 225, 0.05) 0%, transparent 35%),
        radial-gradient(circle at 50% 85%, rgba(210, 180, 140, 0.05) 0%, transparent 30%);
    animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.03); }
}
