/* App-specific styles — extends theme.css */

.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.page { padding: 60px 40px; min-height: calc(100vh - 80px); }
.page-title { font-size: 36px; margin-bottom: 8px; }
.page-sub { font-size: 16px; color: var(--fg-muted); margin-bottom: 40px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.card-title { font-size: 18px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }

/* Stats row */
.stats-row { display: flex; gap: 24px; margin-bottom: 40px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px 32px; flex: 1; text-align: center; }
.stat-num { font-family: 'Playfair Display', serif; font-size: 40px; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 13px; color: var(--fg-muted); margin-top: 4px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); padding: 8px 16px; border-bottom: 2px solid var(--border); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--fg); }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; font-family: inherit; background: var(--surface); color: var(--fg); transition: border-color 0.15s; }
.form-input:focus { outline: none; border-color: var(--accent); }
.form-select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; font-family: inherit; background: var(--surface); color: var(--fg); }
.form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; font-family: inherit; background: var(--surface); color: var(--fg); resize: vertical; min-height: 120px; }
.form-textarea:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.1s; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #A34415; }
.btn-secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: #C0392B; color: #fff; }
.btn-danger:hover { background: #A93226; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green { background: #E8F5E9; color: #2E7D32; }
.badge-red { background: #FFEBEE; color: #C62828; }
.badge-gray { background: var(--bg); color: var(--fg-muted); border: 1px solid var(--border); }

/* Chat */
.chat-container { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: calc(100vh - 220px); max-height: 600px; display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { max-width: 75%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.chat-msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg.assistant { background: var(--bg); color: var(--fg); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.chat-input-area { padding: 16px; border-top: 1px solid var(--border); display: flex; gap: 12px; }
.chat-input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.chat-input:focus { outline: none; border-color: var(--accent); }

/* Quiz */
.quiz-container { max-width: 720px; margin: 0 auto; }
.quiz-question { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 20px; }
.quiz-q-num { font-size: 12px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.quiz-q-text { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.quiz-option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.quiz-option:hover { border-color: var(--accent); background: #FFF5F0; }
.quiz-option.selected { border-color: var(--accent); background: #FFF5F0; }
.quiz-option input { display: none; }
.quiz-option-label { font-size: 14px; flex: 1; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 20px; }
.alert-error { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(30,51,40,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--surface); border-radius: 12px; padding: 32px; max-width: 480px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.modal-title { font-size: 20px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .page { padding: 40px 24px; }
  .stats-row { flex-direction: column; gap: 12px; }
  .data-table { font-size: 13px; }
  .data-table td, .data-table th { padding: 10px 8px; }
}