:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --danger: #d93025;
    --success: #188038;
    --bg: #f6f8fc;
    --bg-white: #ffffff;
    --border: #dadce0;
    --text: #202124;
    --text-secondary: #5f6368;
    --sidebar-bg: #f6f8fc;
    --sidebar-w: 240px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ─── SIDEBAR ─── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon { font-size: 24px; }

.btn-compose {
    margin: 0 16px 12px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border-radius: 24px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.btn-compose:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); }

.nav-links { padding: 0 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.nav-item:hover { background: #e8eaed; }
.nav-item.active { background: #d3e3fd; color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-domains {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    flex: 1;
    overflow-y: auto;
}

.nav-section-title {
    padding: 4px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.domain-item {
    display: block;
    padding: 5px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-item:hover { background: #e8eaed; }
.domain-item.active { background: #d3e3fd; color: var(--primary); font-weight: 600; }

.nav-bottom {
    padding: 8px;
    border-top: 1px solid var(--border);
}

/* ─── MAIN CONTENT ─── */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 20px 24px;
    max-width: 1200px;
}

.content-full {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
}

.btn:hover { background: #f1f3f4; box-shadow: var(--shadow); color: var(--text); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: white; box-shadow: 0 2px 8px rgba(21,87,176,0.3); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #c5221f; color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 10px 28px; font-size: 15px; }
.btn-block { display: block; width: 100%; }
.btn-ai { background: #e8f0fe; color: var(--primary); border-color: #c6dafc; }
.btn-ai:hover { background: #d3e3fd; color: var(--primary); }

/* ─── LOGIN ─── */
.login-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 380px;
    max-width: 90%;
}

.login-logo { text-align: center; margin-bottom: 28px; }
.logo-icon-lg { font-size: 48px; display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 24px; font-weight: 700; }
.login-logo p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

.form-group { margin-bottom: 14px; }
.form-group input, .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-group input:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* ─── FLASH MESSAGES ─── */
.flash-messages { margin-bottom: 16px; }
.flash {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    transition: opacity 0.3s;
}

.flash-success { background: #e6f4ea; color: #137333; }
.flash-error { background: #fce8e6; color: #c5221f; }

/* ─── INBOX ─── */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.inbox-header h2 { font-size: 20px; font-weight: 600; }

.search-form { display: flex; gap: 8px; }
.search-input {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 280px;
    font-size: 13px;
    font-family: inherit;
}

.search-input:focus { outline: none; border-color: var(--primary); }

.email-list {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ─── BULK TOOLBAR ─── */
.bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: -1px;
}

.bulk-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bulk-checkbox-wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.bulk-checkbox-wrap input[type=checkbox],
.email-checkbox-wrap input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.bulk-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bulk-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-move-wrap {
    position: relative;
    display: inline-block;
}

.bulk-move-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 50;
    overflow: hidden;
}

.bulk-move-item {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}

.bulk-move-item:hover {
    background: #e8f0fe;
    color: var(--primary);
}

.bulk-loading {
    font-size: 13px;
    color: var(--primary);
    font-style: italic;
}

.email-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    align-self: stretch;
}

.email-row {
    display: flex;
    align-items: stretch;
    padding: 0;
    border-bottom: 1px solid #f1f3f4;
    color: var(--text);
    transition: background 0.1s;
}

.email-row-link {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 10px 16px 10px 0;
    text-decoration: none;
    color: inherit;
    gap: 12px;
    min-width: 0;
}

.email-row:last-child { border-bottom: none; }
.email-row:hover { background: #f6f8fc; }
.email-row.unread { background: #eaf1fb; font-weight: 600; }
.email-row.unread:hover { background: #dce8f8; }
.email-row.spam-row { opacity: 0.7; }
.email-row.row-selected { background: #e8f0fe; }
.email-row.row-selected:hover { background: #d3e3fd; }

.email-sender {
    width: 180px;
    flex-shrink: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.thread-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #5f6368;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1;
}

.email-row.unread .thread-count {
    background: var(--primary);
}

.email-domain-badge {
    background: #e8f0fe;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.email-subject {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-date {
    width: 120px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
}

.badge-spam { background: #fce8e6; color: #c5221f; }
.badge-domain { background: #e8f0fe; color: var(--primary); }
.badge-keyword { background: #e8f0fe; color: var(--primary); }
.badge-sender { background: #fef7e0; color: #b06000; }
.badge-subject { background: #f3e8fd; color: #7627bb; }
.badge-allow { background: #e6f4ea; color: #137333; }
.badge-trash { background: #fce8e6; color: #c5221f; }

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.page-info { font-size: 13px; color: var(--text-secondary); }

/* ─── EMAIL DETAIL ─── */
.email-detail { max-width: 900px; }

.email-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.email-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.email-actions form { display: inline-flex; }

.move-folder-wrap {
    position: relative;
    display: inline-block;
}

.move-folder-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 50;
    overflow: hidden;
}

.move-folder-item {
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}

.move-folder-item:hover {
    background: #e8f0fe;
    color: var(--primary);
}

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

.email-meta {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.email-subject-title { font-size: 20px; font-weight: 600; margin-bottom: 12px; }

.meta-row { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; }
.meta-label { color: var(--text-secondary); min-width: 50px; font-weight: 500; }
.meta-value { flex: 1; }

.spam-warning {
    background: #fce8e6;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
}

.spam-warning ul { margin-top: 6px; margin-left: 20px; font-size: 12px; color: #c5221f; }

.attachments {
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.attachments-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; }

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}

.attachment-dangerous { color: var(--danger); }
.att-icon { font-size: 16px; }
.att-size { color: var(--text-secondary); font-size: 11px; }

.email-body-container {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.email-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.email-body img { max-width: 100%; height: auto; }
.email-body table { max-width: 100%; }
.email-body a { color: var(--primary); }

.email-detail-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ─── AI SECTION ─── */
.ai-section {
    background: #f0f4ff;
    border: 1px solid #c6dafc;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ai-result {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    background: white;
    border-radius: var(--radius);
    font-size: 13px;
}

.ai-loading { color: var(--primary); font-style: italic; }
.ai-error { color: var(--danger); }
.ai-summary { line-height: 1.6; }

.ai-reply-form {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ai-prompt-input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
}

.ai-reply-text {
    white-space: pre-wrap;
    font-family: inherit;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin: 8px 0;
}

/* ─── COMPOSE ─── */
.compose-container { max-width: 800px; }

.compose-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.compose-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.compose-field label {
    min-width: 60px;
    padding-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
}

.compose-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.compose-input:focus { outline: none; border-color: var(--primary); }

.editor-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    flex: 1;
}

.editor-toolbar button {
    padding: 4px 8px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
}

.editor-toolbar button:hover { background: #e8eaed; }
.toolbar-sep { color: var(--border); padding: 0 4px; }

.compose-editor {
    flex: 1;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 14px;
    line-height: 1.6;
    background: white;
    outline: none;
}

.compose-editor:focus { border-color: var(--primary); }

.compose-quote {
    margin: 12px 0 12px 68px;
    border-left: 3px solid var(--border);
    padding-left: 12px;
}

.quote-toggle {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
}

.quote-content { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

.compose-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-left: 68px;
}

.template-selector { flex: 1; }
.template-selector select { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }

/* ─── TEMPLATES PAGE ─── */
.templates-container { max-width: 900px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-header h2 { font-size: 20px; }

.template-form {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.template-form .form-group { margin-bottom: 12px; }
.template-form label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.template-card {
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.template-card-header { display: flex; justify-content: space-between; align-items: center; }
.template-card-header h3 { font-size: 15px; }
.template-card-actions { display: flex; gap: 4px; }
.template-subject { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.template-preview { font-size: 12px; color: var(--text-secondary); margin-top: 8px; white-space: pre-wrap; }

/* ─── SPAM RULES TABLE ─── */
.rules-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-collapse: collapse;
    font-size: 13px;
}

.rules-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
}

.rules-table td { padding: 8px 12px; border-bottom: 1px solid #f1f3f4; }
.rules-table code { background: #f1f3f4; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.actions-cell { white-space: nowrap; }

.info-box {
    background: #e8f0fe;
    border: 1px solid #c6dafc;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--primary-dark);
}

/* ─── CONVERSATION THREAD ─── */
.thread-section {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.thread-header:hover { background: #e8f0fe; }

.thread-icon { font-size: 18px; }

.thread-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.thread-toggle {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.thread-list { padding: 0; }

.thread-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.1s;
}

.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: #f8f9fa; }

.thread-item.thread-current {
    background: #e8f0fe;
    border-left: 3px solid var(--primary);
}

.thread-item.thread-unread { font-weight: 600; }

.thread-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.thread-item-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.thread-sender-icon { font-size: 16px; color: var(--text-secondary); }

.thread-badge-current {
    display: inline-block;
    padding: 1px 8px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thread-item-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.thread-item-subject {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding-left: 24px;
}

.thread-item-actions {
    display: flex;
    gap: 6px;
    padding-left: 24px;
}

/* ─── LABELS ─── */
/* ─── FOLDERS ─── */
.nav-folders {
    padding: 0 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.nav-folders .domain-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-labels {
    padding: 0 12px;
    margin-bottom: 8px;
}

.label-item { display: flex; align-items: center; gap: 8px; }

.label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a73e8;
    flex-shrink: 0;
}

.label-badge {
    display: inline-block;
    padding: 1px 8px;
    background: #e8f0fe;
    color: var(--primary);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

/* ─── FILTERS PAGE ─── */
.filters-container { max-width: 900px; }

.filter-form-wrap {
    margin-bottom: 20px;
}

.filter-form {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.filter-form h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.filter-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8f0fe;
}

.filter-form .form-group { margin-bottom: 12px; }
.filter-form label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text-secondary); }
.filter-form .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.filter-form .form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,115,232,0.1); }
.filter-form .form-row { display: flex; gap: 12px; }
.filter-form .form-row .form-group { flex: 1; }
.filter-form .form-actions { display: flex; gap: 8px; margin-top: 16px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.checkbox-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.filter-list { display: flex; flex-direction: column; gap: 8px; }

.filter-card {
    background: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.filter-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.filter-card.filter-disabled { opacity: 0.55; }

.filter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.filter-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.filter-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dadce0;
}

.filter-status-dot.active { background: #188038; }

.filter-card-actions { display: flex; gap: 4px; }

.filter-card-criteria,
.filter-card-action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.filter-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 55px;
}

.filter-chip {
    display: inline-block;
    padding: 3px 10px;
    background: #f1f3f4;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text);
}

.filter-action-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.action-delete { background: #fce8e6; color: #d93025; }
.action-label { background: #e8f0fe; color: var(--primary); }
.action-read { background: #e6f4ea; color: #188038; }
.action-star { background: #fef7e0; color: #f9ab00; }
.action-forward { background: #f3e8fd; color: #7b1fa2; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .logo-text, .sidebar .nav-item span:not(.nav-icon),
    .sidebar .nav-section-title, .sidebar .domain-item,
    .sidebar .nav-bottom .nav-item span:not(.nav-icon) { display: none; }
    .btn-compose { font-size: 18px; padding: 10px; }
    .btn-compose::after { content: ''; }
    .content { margin-left: 60px; padding: 12px; }
    .email-row { flex-wrap: wrap; }
    .email-sender { width: 100%; }
    .email-date { width: auto; }
    .compose-field { flex-direction: column; }
    .compose-field label { text-align: left; min-width: auto; }
    .compose-actions { padding-left: 0; }
}
