* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }

/* Auth pages */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 1rem; }
.auth-card { background: #fff; border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,0.1); text-align: center; }
.auth-logo { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-card h1 { font-size: 1.4rem; color: #2c3e50; margin-bottom: 0.3rem; }
.auth-subtitle { color: #666; font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-footer { margin-top: 1.5rem; font-size: 0.85rem; color: #888; }
.auth-footer a { color: #3498db; }

/* Form */
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 0.3rem; }
.form-group input, textarea { width: 100%; padding: 0.7rem 0.9rem; border: 1.5px solid #ddd; border-radius: 8px; font-size: 0.95rem; transition: border-color 0.2s; }
.form-group input:focus, textarea:focus { outline: none; border-color: #3498db; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.6rem 1.2rem; border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: #2c3e50; color: #fff; }
.btn-primary:hover { background: #34495e; }
.btn-full { width: 100%; justify-content: center; padding: 0.8rem; font-size: 1rem; }
.btn-clear { background: #eee; color: #666; }
.btn-clear:hover { background: #ddd; }
.btn-logout { background: #e74c3c; color: #fff; font-size: 0.8rem; padding: 0.4rem 0.8rem; }
.btn-logout:hover { background: #c0392b; }
.btn-excel { background: #27ae60; color: #fff; }
.btn-excel:hover { background: #219a52; }
.btn-csv { background: #2980b9; color: #fff; }
.btn-csv:hover { background: #2471a3; }
.btn-sm { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
.nav-link { color: #2c3e50; text-decoration: none; font-size: 0.85rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: 6px; }
.nav-link:hover { background: #ecf0f1; }

/* Alerts */
.alert { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }

/* App layout */
.app-container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1.2rem; background: #fff; border-radius: 12px; margin-bottom: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); flex-wrap: wrap; gap: 0.5rem; }
.header-left { display: flex; align-items: center; gap: 0.5rem; }
.header-left .logo { font-size: 1.5rem; }
.header-left h1 { font-size: 1.1rem; color: #2c3e50; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.header-nav { display: flex; align-items: center; gap: 0.5rem; }
.user-info { text-align: right; font-size: 0.8rem; }
.user-info .company { display: block; font-weight: 700; color: #2c3e50; }
.user-info .email { color: #888; }

/* Checker */
.checker-main { background: #fff; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.domain-selector { display: flex; gap: 0.8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.domain-check { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.domain-check input { accent-color: #2c3e50; }
.domain-label { font-size: 0.85rem; font-weight: 600; padding: 0.3rem 0.8rem; border-radius: 20px; }
.domain-label.fda { background: #e8f4f8; color: #2980b9; }
.domain-label.california { background: #fef9e7; color: #d4a517; }
.domain-label.amazon { background: #fde8e8; color: #c0392b; }

.input-section { margin-bottom: 1rem; }
.input-section label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; color: #555; }
textarea { width: 100%; padding: 0.8rem; border: 1.5px solid #ddd; border-radius: 8px; font-size: 0.9rem; font-family: 'Consolas', monospace; resize: vertical; }
textarea:focus { outline: none; border-color: #3498db; }

.action-bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.export-buttons { display: flex; gap: 0.5rem; margin-left: auto; }

/* Loading */
.htmx-indicator { display: none; text-align: center; padding: 2rem; color: #888; }
.htmx-indicator.htmx-request { display: block; }
.spinner { width: 30px; height: 30px; border: 3px solid #ddd; border-top-color: #2c3e50; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-container { margin-top: 1.5rem; }
.summary-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stat-box { flex: 1; min-width: 80px; text-align: center; padding: 0.8rem 0.5rem; border-radius: 10px; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.75rem; font-weight: 600; }
.stat-total { background: #ecf0f1; color: #2c3e50; }
.stat-safe { background: #e8f8f0; color: #27ae60; }
.stat-restricted { background: #fef9e7; color: #f39c12; }
.stat-caution { background: #fdf2e9; color: #e67e22; }
.stat-banned { background: #fdecea; color: #e74c3c; }

.filter-tabs { display: flex; gap: 0.3rem; margin-bottom: 0.8rem; }
.tab { padding: 0.4rem 1rem; border: none; background: #ecf0f1; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: #666; }
.tab.active { background: #2c3e50; color: #fff; }
.tab:hover:not(.active) { background: #ddd; }

/* Table */
.results-table, .history-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.results-table th, .history-table th { background: #2c3e50; color: #fff; padding: 0.6rem 0.8rem; text-align: left; font-weight: 600; }
.results-table td, .history-table td { padding: 0.5rem 0.8rem; border-bottom: 1px solid #eee; vertical-align: top; }
.results-table tbody tr:hover, .history-table tbody tr:hover { background: #f8f9fa; }
.inci-name { font-weight: 600; }
.notes-cell { font-size: 0.82rem; color: #555; max-width: 350px; }
.category-cell { white-space: nowrap; }

/* Status badges */
.status-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.78rem; font-weight: 700; text-align: center; min-width: 40px; }
.badge-banned { background: #e74c3c; color: #fff; }
.badge-restricted { background: #f39c12; color: #fff; }
.badge-caution { background: #e67e22; color: #fff; }
.badge-safe { background: #27ae60; color: #fff; }
.badge-sm { font-size: 0.7rem; padding: 0.1rem 0.4rem; }

.multi-hit { display: inline-block; margin-left: 0.3rem; font-size: 0.72rem; background: #ddd; color: #555; padding: 0.1rem 0.4rem; border-radius: 10px; cursor: pointer; }

/* Detail rows */
.detail-row td { background: #f8f9fa; padding: 0.3rem 0.8rem; }
.hit-details { display: flex; flex-direction: column; gap: 0.3rem; }
.hit-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.hit-domain { font-weight: 600; color: #2c3e50; min-width: 140px; }
.hit-notes { color: #666; }

/* Color additive area badges */
.color-usage-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.area-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.area-yes { background: #e8f8f0; color: #27ae60; border: 1px solid #27ae60; }
.area-no { background: #fdecea; color: #e74c3c; border: 1px solid #e74c3c; }
.area-subject { background: #fef9e7; color: #d4a517; border: 1px solid #d4a517; }
.color-restriction-note { font-size: 0.75rem; color: #888; margin-top: 0.2rem; width: 100%; }

/* Admin */
.admin-main { background: #fff; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.admin-main h2 { margin: 1.5rem 0 0.8rem; color: #2c3e50; font-size: 1.1rem; }
.admin-stats { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 150px; background: #f8f9fa; border-radius: 10px; padding: 1.2rem; text-align: center; }
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: #2c3e50; }
.stat-card .stat-label { font-size: 0.85rem; color: #888; }

/* History */
.history-main { background: #fff; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* Responsive */
@media (max-width: 768px) {
    .app-header { flex-direction: column; align-items: flex-start; }
    .summary-bar { flex-wrap: wrap; }
    .stat-box { min-width: 60px; }
    .notes-cell { max-width: 200px; }
    .export-buttons { margin-left: 0; }
}
