/* ============================================
   MailHub Pro - Main Stylesheet
   ============================================ */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #253249;
    --bg-input: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-light: #475569;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #ec4899);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-width: 280px;
    --header-height: 64px;
    --transition: all 0.2s ease;
}

/* Light mode support */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--accent-blue); transition: var(--transition); }
a:hover { color: var(--accent-purple); }

/* ============= LAYOUT ============= */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-brand span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--accent-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.nav-item .badge.danger { background: var(--accent-red); }
.nav-item .badge.success { background: var(--accent-green); }

/* Sidebar Account List */
.sidebar-accounts {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
}

.account-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.account-mini:hover {
    background: var(--bg-hover);
}

.account-mini.selected {
    background: rgba(59, 130, 246, 0.1);
}

.account-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.account-mini-info {
    flex: 1;
    min-width: 0;
}

.account-mini-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-mini-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-mini-unread {
    background: var(--accent-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

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

.user-plan {
    font-size: 11px;
    color: var(--accent-blue);
    font-weight: 500;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
    backdrop-filter: blur(20px);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover { background: var(--bg-hover); }

.search-box {
    flex: 1;
    max-width: 520px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-btn .dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

/* Page Content */
.page-content {
    padding: 28px;
    flex: 1;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

/* ============= CARDS ============= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.blue::after { background: var(--accent-blue); }
.stat-card.green::after { background: var(--accent-green); }
.stat-card.purple::after { background: var(--accent-purple); }
.stat-card.yellow::after { background: var(--accent-yellow); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--accent-blue); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: var(--accent-purple); }
.stat-icon.yellow { background: rgba(245,158,11,0.1); color: var(--accent-yellow); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 6px;
}

.stat-change.up { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.stat-change.down { background: rgba(239,68,68,0.1); color: var(--accent-red); }

/* ============= EMAIL LIST ============= */

.email-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.email-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.email-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn {
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-weight: 500;
}

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

.toolbar-btn.active {
    background: rgba(59,130,246,0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.email-filter-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.filter-tab {
    padding: 6px 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.filter-tab:hover:not(.active) {
    color: var(--text-secondary);
}

.account-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.account-filter select {
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

/* Email Items */
.email-list {
    flex: 1;
    overflow-y: auto;
}

.email-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.email-item:hover {
    background: var(--bg-hover);
}

.email-item.unread {
    background: rgba(59,130,246,0.03);
}

.email-item.unread .email-subject {
    font-weight: 600;
    color: var(--text-primary);
}

.email-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-blue);
}

.email-item.selected {
    background: rgba(59,130,246,0.08);
}

.email-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    transition: var(--transition);
}

.email-checkbox:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.email-star {
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.email-star.starred { color: var(--accent-yellow); }
.email-star:hover { color: var(--accent-yellow); }

.email-account-tag {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.email-sender {
    width: 180px;
    flex-shrink: 0;
}

.email-sender-name {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-content {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 8px;
}

.email-subject {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

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

.email-snippet::before {
    content: '— ';
}

.email-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.email-attachment {
    color: var(--text-muted);
    font-size: 14px;
}

.email-labels {
    display: flex;
    gap: 4px;
}

.email-label {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.email-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

/* Email Detail View */
.email-detail {
    padding: 32px;
    max-width: 900px;
}

.email-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.email-detail-subject {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.email-detail-sender {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sender-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.sender-name { font-weight: 600; font-size: 15px; }
.sender-email { color: var(--text-muted); font-size: 13px; }
.sender-time { color: var(--text-muted); font-size: 12px; }

.email-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.email-body img { max-width: 100%; border-radius: var(--radius-sm); }

/* ============= BUTTONS ============= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.4); color: #fff; }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); color: var(--text-primary); }

.btn-success {
    background: var(--gradient-success);
    color: #fff;
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
}

.btn-ghost {
    background: none;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

/* ============= FORMS ============= */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============= PRICING ============= */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue), var(--shadow-lg);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pricing-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.pricing-price {
    margin-bottom: 24px;
}

.pricing-amount {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1.5px;
}

.pricing-period {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    margin-bottom: 28px;
}

.pricing-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-features li .check {
    color: var(--accent-green);
    font-size: 16px;
    flex-shrink: 0;
}

.pricing-features li .cross {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.5;
}

.pricing-features li.disabled {
    opacity: 0.4;
    text-decoration: line-through;
}

/* ============= ACCOUNT CARDS ============= */

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-card-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.account-card-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.account-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.account-stat {
    text-align: center;
}

.account-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.account-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Add Account Card */
.add-account-card {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.add-account-card:hover {
    border-color: var(--accent-blue);
    background: rgba(59,130,246,0.03);
}

.add-account-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(59,130,246,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--accent-blue);
}

/* ============= MODALS ============= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 28px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(239,68,68,0.1);
    color: var(--accent-red);
}

.modal-body { padding: 24px 28px; }
.modal-footer {
    padding: 16px 28px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============= NOTIFICATIONS DROPDOWN ============= */

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    display: none;
}

.notif-dropdown.show { display: block; }

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

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    padding: 14px 20px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(59,130,246,0.03); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notif-content { flex: 1; }
.notif-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============= COMPOSE ============= */

.compose-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.compose-field {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.compose-field label {
    width: 80px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.compose-field input,
.compose-field select {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.compose-editor {
    min-height: 350px;
    padding: 20px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    line-height: 1.7;
}

.compose-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-input);
}

.compose-toolbar button {
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.compose-toolbar button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ============= TABLES ============= */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-input);
}

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

/* Status badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.active { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.status.pending { background: rgba(245,158,11,0.1); color: var(--accent-yellow); }
.status.expired { background: rgba(239,68,68,0.1); color: var(--accent-red); }
.status.trial { background: rgba(139,92,246,0.1); color: var(--accent-purple); }

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============= TOAST ============= */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    animation: slideInRight 0.3s ease;
    font-size: 14px;
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.info { border-left: 4px solid var(--accent-blue); }
.toast.warning { border-left: 4px solid var(--accent-yellow); }

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

/* ============= EMPTY STATE ============= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 24px;
}

/* ============= LOADING ============= */

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-tertiary) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============= RESPONSIVE ============= */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .email-sender {
        width: 120px;
    }

    .email-snippet { display: none; }
}

@media (max-width: 768px) {
    .page-content { padding: 20px 16px; }
    .top-header { padding: 0 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .accounts-grid { grid-template-columns: 1fr; }

    .email-item {
        padding: 12px 16px;
    }

    .email-sender { width: 100px; }
    .email-content { flex-direction: column; gap: 2px; }
    .email-meta { gap: 6px; }
    .email-labels { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 22px; }
    .search-box { max-width: none; }
}

/* ============= SCROLLBAR ============= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============= BILLING TOGGLE ============= */
.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 32px;
}

.billing-toggle span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.billing-toggle span.active {
    color: var(--text-primary);
}

.toggle-switch {
    width: 52px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    padding: 3px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.toggle-switch.active {
    background: var(--accent-blue);
}

.toggle-switch::after {
    content: '';
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.save-badge {
    background: rgba(16,185,129,0.1);
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

/* ============= TABS ============= */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
    color: var(--accent-blue);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 1px 1px 0 0;
}

/* ============= PROGRESS BAR ============= */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.blue { background: var(--accent-blue); }
.progress-fill.green { background: var(--accent-green); }
.progress-fill.yellow { background: var(--accent-yellow); }
.progress-fill.red { background: var(--accent-red); }

/* ============= DROPDOWN ============= */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    padding: 6px;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}