:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-main); }

.app-container { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 250px; background-color: var(--surface-color); border-right: 1px solid var(--border-color); padding: 20px; display: flex; flex-direction: column; }
.logo { font-size: 1.5rem; font-weight: 600; color: var(--primary-color); margin-bottom: 30px; }
.btn-compose { background-color: var(--primary-color); color: white; border: none; padding: 12px; border-radius: 6px; font-weight: 500; cursor: pointer; transition: background 0.2s; margin-bottom: 20px; }
.btn-compose:hover { background-color: var(--primary-hover); }
.folder-nav ul { list-style: none; }
.folder-nav li { padding: 10px 15px; margin-bottom: 5px; border-radius: 6px; cursor: pointer; color: var(--text-muted); font-weight: 500; }
.folder-nav li:hover { background-color: var(--bg-color); }
.folder-nav li.active { background-color: #e0e7ff; color: var(--primary-color); }

/* Mail List */
.mail-list { flex: 1; display: flex; flex-direction: column; background-color: var(--surface-color); }
.list-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); }
.search-bar { width: 100%; max-width: 400px; padding: 10px 15px; border: 1px solid var(--border-color); border-radius: 6px; outline: none; }
.message-items { flex: 1; overflow-y: auto; }
.message-item { display: flex; padding: 15px 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.2s; }
.message-item:hover { background-color: var(--bg-color); }
.message-item .sender { width: 200px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-item .subject { flex: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 15px; }
.message-item .date { width: 80px; text-align: right; font-size: 0.85rem; color: var(--text-muted); }

/* Composer / Reading Pane */
.reading-pane { width: 40%; background-color: var(--surface-color); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; }
.composer-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
#composeForm { display: flex; flex-direction: column; flex: 1; padding: 20px; }
#composeForm input { padding: 10px; margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 1rem; outline: none; }
#composeForm textarea { flex: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 1rem; resize: none; margin-bottom: 15px; outline: none; }
.btn-send { background-color: var(--primary-color); color: white; border: none; padding: 10px 25px; border-radius: 4px; font-weight: 500; cursor: pointer; }

/* Toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background-color: #374151; color: white; padding: 12px 20px; border-radius: 6px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); opacity: 0; pointer-events: none; transition: opacity 0.3s; flex-wrap: wrap; z-index: 100; }
.toast.show { opacity: 1; pointer-events: all; }
.btn-undo { background: none; border: none; color: #fbbf24; font-weight: 600; cursor: pointer; }
.btn-undo:hover { text-decoration: underline; }
.progress-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: #fbbf24; width: 100%; transform-origin: left; }
