/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #f4f6f9; color: #222; }
a { color: inherit; text-decoration: none; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.content { flex: 1; padding: 2rem; overflow-y: auto; }
h2 { margin-bottom: 1.5rem; font-size: 1.5rem; }
h3 { margin-bottom: 1rem; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar { width: 220px; background: #1a1f2e; color: #cdd3de; display: flex; flex-direction: column; padding: 1.5rem 0; }
.sidebar-logo { padding: 0 1.5rem 1.5rem; font-size: 1.1rem; font-weight: 700; color: #fff; border-bottom: 1px solid #2d3450; }
.sidebar-menu { list-style: none; flex: 1; padding: 1rem 0; }
.sidebar-menu li a { display: block; padding: .65rem 1.5rem; transition: background .15s; border-radius: 0 8px 8px 0; margin-right: .5rem; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background: #2d3450; color: #fff; }
.sidebar-footer { padding: 1rem 1.5rem; font-size: .85rem; border-top: 1px solid #2d3450; display: flex; flex-direction: column; gap: .4rem; }
.sidebar-footer a { color: #f87171; font-size: .8rem; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; padding: 2.5rem; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.1); width: 100%; max-width: 380px; }
.login-box h1 { font-size: 1.4rem; margin-bottom: .3rem; }
.login-sub { color: #666; font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; margin-bottom: .3rem; color: #555; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: .55rem .75rem; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: .95rem; background: #fff; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #6366f1; }
textarea { resize: vertical; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-block; padding: .5rem 1.1rem; border-radius: 6px; font-size: .9rem; cursor: pointer; border: none; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-primary   { background: #6366f1; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #333; }
.btn-green     { background: #22c55e; color: #fff; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-block     { display: block; width: 100%; text-align: center; margin-top: .5rem; }
.btn-sm        { padding: .3rem .7rem; font-size: .8rem; }

/* ── Cards (Dashboard) ────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: #fff; border-radius: 10px; padding: 1.2rem 1rem; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.card-num { display: block; font-size: 2rem; font-weight: 700; }
.card-label { font-size: .8rem; color: #777; text-transform: uppercase; letter-spacing: .05em; }
.card-blue   .card-num { color: #3b82f6; }
.card-green  .card-num { color: #22c55e; }
.card-yellow .card-num { color: #f59e0b; }
.card-red    .card-num { color: #ef4444; }
.card-gray   .card-num { color: #9ca3af; }
.card-purple .card-num { color: #8b5cf6; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: .9rem; }
.table th { background: #f8fafc; font-weight: 600; font-size: .8rem; text-transform: uppercase; color: #666; }
.table tr:last-child td { border-bottom: none; }
.text-truncate { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #e5e7eb; color: #333; }
.badge-category { background: #ede9fe; color: #6d28d9; }
.status-new              { background: #dbeafe; color: #1d4ed8; }
.status-auto_replied     { background: #dcfce7; color: #15803d; }
.status-pending_review   { background: #fef9c3; color: #92400e; }
.status-moderated        { background: #fee2e2; color: #b91c1c; }
.status-ignored          { background: #f3f4f6; color: #6b7280; }
.status-error            { background: #fce7f3; color: #9d174d; }

/* ── Review Cards ─────────────────────────────────────────────────────────── */
.review-card { background: #fff; border-radius: 10px; padding: 1.5rem; margin-bottom: 1.2rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.review-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.review-author { font-weight: 600; }
.review-text { border-left: 4px solid #6366f1; padding: .75rem 1rem; background: #f8f8ff; border-radius: 4px; margin-bottom: .75rem; font-style: italic; color: #333; }
.review-reason { color: #888; font-size: .85rem; margin-bottom: .75rem; }
.review-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.approve-form textarea { margin-bottom: .5rem; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; font-size: .9rem; }
.alert-error   { background: #fee2e2; color: #b91c1c; }
.alert-warning { background: #fef9c3; color: #92400e; }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2rem; color: #aaa; }
.pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; font-size: .9rem; }
.filter-bar { margin-bottom: 1rem; }
.filter-bar select { width: auto; }
.quick-actions { display: flex; gap: .75rem; margin-top: 1rem; }
.card-form { background: #fff; padding: 1.2rem; border-radius: 10px; margin-bottom: 1.5rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1; }
.inline-edit { display: flex; gap: .5rem; align-items: center; }
.inline-edit input { flex: 1; }
code { background: #f3f4f6; padding: .1rem .4rem; border-radius: 4px; font-size: .85rem; }
