* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; }

.auth-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.auth-card { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 100%; max-width: 400px; }
.auth-card h1 { text-align: center; color: #e94560; margin-bottom: 0.5rem; }
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; color: #666; }
.auth-card input { width: 100%; padding: 0.75rem; margin-bottom: 1rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.auth-card button { width: 100%; padding: 0.75rem; background: #e94560; color: white; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }
.auth-card button:hover { background: #d63851; }
.auth-card p { text-align: center; margin-top: 1rem; color: #666; }
.auth-card a { color: #e94560; text-decoration: none; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1a1a2e; color: white; padding: 1.5rem; flex-shrink: 0; }
.sidebar h2 { margin-bottom: 0.25rem; color: #e94560; }
.sidebar .user-info { font-size: 0.8rem; color: #888; margin-bottom: 2rem; word-break: break-all; }
.nav-list { list-style: none; }
.nav-list li { margin-bottom: 0.15rem; }
.nav-list a { display: block; padding: 0.5rem 0.8rem; color: #b0b0c0; text-decoration: none; border-radius: 4px; font-size: 0.95rem; }
.nav-list a:hover, .nav-list a.active { background: rgba(255,255,255,0.08); color: white; }

.main { flex: 1; padding: 1.5rem 2rem; overflow-y: auto; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.main h1 { font-size: 1.4rem; color: #333; }
.flash { background: #e8f5e9; color: #2e7d32; padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }

.card { background: white; padding: 1.2rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 1.2rem; }
.card h3 { margin-bottom: 0.8rem; color: #555; font-size: 1rem; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { padding: 0.5rem 0.7rem; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; }
.inline-form input[type="text"] { min-width: 200px; flex: 1; }
.inline-form input[type="email"] { min-width: 200px; flex: 1; }
.inline-form button, .btn { padding: 0.5rem 1rem; background: #e94560; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; text-decoration: none; display: inline-block; }
.inline-form button:hover, .btn:hover { background: #d63851; }

.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.data-table th, .data-table td { padding: 0.65rem 0.9rem; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.data-table th { background: #fafafa; font-weight: 600; color: #666; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr.unread td { font-weight: 600; }
.data-table tr:hover { background: #fafbff; }
.data-table a { color: #1a73e8; text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

.btn-delete { background: none; border: none; color: #e53935; cursor: pointer; font-size: 0.8rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.btn-delete:hover { background: #ffebee; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.2rem; color: #666; font-size: 0.9rem; }
.pagination a { color: #1a73e8; text-decoration: none; }

.empty { text-align: center; padding: 2.5rem; color: #999; background: white; border-radius: 8px; font-size: 0.9rem; }

.meta-info { background: #fff8e1; padding: 0.5rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.85rem; color: #856404; }

.email-view-header { background: white; padding: 1.2rem 1.5rem; border-radius: 8px 8px 0 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.email-view-header h1 { font-size: 1.2rem; margin-bottom: 0.8rem; }
.email-view-header .meta p { margin-bottom: 0.2rem; color: #555; font-size: 0.9rem; }
.email-body { background: white; padding: 1.5rem; border-top: 1px solid #eee; border-radius: 0 0 8px 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-height: 150px; }
.email-body pre { white-space: pre-wrap; font-family: inherit; line-height: 1.6; font-size: 0.9rem; }
.toolbar-actions { display: flex; gap: 0.5rem; }
.actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

.btn-copy { background: none; border: 1px solid #1a73e8; color: #1a73e8; cursor: pointer; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 3px; margin-left: 0.4rem; }
.btn-copy:hover { background: #e8f0fe; }

.email-iframe { width: 100%; min-height: 400px; border: none; }
.public-html-body img { max-width: 100%; height: auto; }
.public-html-body a { color: #1a73e8; }
.public-html-body table { max-width: 100%; }

.public-layout { max-width: 800px; margin: 0 auto; padding: 1rem; min-height: 100vh; }
.public-header { text-align: center; padding: 1.5rem 0; }
.public-header h1 { color: #e94560; font-size: 1.8rem; margin-bottom: 0.3rem; }
.public-addr { font-size: 1.2rem; font-weight: 600; color: #333; margin-bottom: 0.3rem; }
.public-meta { font-size: 0.85rem; color: #888; margin-bottom: 1rem; }
.public-main { }
.small { font-size: 0.8rem; color: #999; margin-top: 0.5rem; }

@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; padding: 1rem; }
    .sidebar .nav-list { display: flex; gap: 0.3rem; flex-wrap: wrap; }
    .main { padding: 1rem; }
    .inline-form { flex-direction: column; }
    .inline-form input, .inline-form select { width: 100%; }
}
