/* ============================================
   ReviewPortal v2 – Premium Dark UI + Mobile
   Colors: #0d1117 bg, #1a365d primary, #217A4B accent
   ============================================ */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-card-hover: #222d3f;
  --bg-input: #0d1117;
  --border: #30363d;
  --border-focus: #217A4B;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --primary: #1a365d;
  --primary-light: #2a4a7f;
  --accent: #217A4B;
  --accent-light: #2ea85f;
  --accent-glow: rgba(33, 122, 75, 0.15);
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.1);
  --warning: #d29922;
  --warning-bg: rgba(210, 153, 34, 0.1);
  --success: #3fb950;
  --success-bg: rgba(63, 185, 80, 0.1);
  --info: #58a6ff;
  --info-bg: rgba(88, 166, 255, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ LOGIN ============ */
.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0a1628 50%, var(--bg-primary) 100%);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 420px; max-width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

.login-logo {
  font-size: 32px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: var(--text-secondary); font-size: 14px; margin-bottom: 32px;
}

.login-box input {
  width: 100%; padding: 14px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 15px; font-family: inherit;
  transition: var(--transition);
  margin-bottom: 16px;
}

.login-box input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-box .btn-login {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: var(--transition); font-family: inherit;
}

.login-box .btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(33, 122, 75, 0.4);
}

.login-error {
  color: var(--danger); font-size: 13px; margin-top: 12px;
  display: none;
}

.login-mode-toggle {
  margin-top: 16px; font-size: 13px; color: var(--text-muted);
}

.login-mode-toggle a {
  color: var(--accent-light); cursor: pointer; text-decoration: underline;
}

/* ============ LAYOUT ============ */
.app-layout {
  display: flex; min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width); background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px; border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.sidebar-tagline {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-user-info {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
}

.sidebar-user-info .user-role {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 4px;
}

.sidebar-user-info .role-admin { background: var(--success-bg); color: var(--success); }
.sidebar-user-info .role-sub { background: var(--info-bg); color: var(--info); }

.sidebar-nav {
  flex: 1; padding: 16px 12px; overflow-y: auto;
}

.nav-section-title {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 16px 6px; margin-top: 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer;
  transition: var(--transition); font-size: 14px; font-weight: 500;
  margin-bottom: 4px; text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-card); color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow); color: var(--accent-light);
  border: 1px solid rgba(33, 122, 75, 0.2);
}

.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
  padding: 16px 12px; border-top: 1px solid var(--border);
}

/* Mobile hamburger */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 99; padding: 0 16px;
  align-items: center; justify-content: space-between;
}

.mobile-header .sidebar-logo { font-size: 18px; }

.hamburger-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-primary);
  font-size: 22px; cursor: pointer; border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}

.hamburger-btn:active { background: var(--bg-card); }

.sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
}

.main-content {
  flex: 1; margin-left: var(--sidebar-width); padding: 32px;
  min-height: 100vh;
}

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}

.page-title {
  font-size: 26px; font-weight: 700; letter-spacing: -0.3px;
}

.page-subtitle {
  color: var(--text-secondary); font-size: 14px; margin-top: 4px;
}

.page-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition); border: 1px solid transparent;
  font-family: inherit; text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(33, 122, 75, 0.4);
}

.btn-secondary {
  background: var(--bg-card); color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover); border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger-bg); color: var(--danger);
  border-color: rgba(248, 81, 73, 0.2);
}

.btn-danger:hover { background: rgba(248, 81, 73, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-icon {
  width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover { color: var(--text-primary); background: var(--bg-card-hover); }

/* ============ CARDS ============ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: var(--transition);
}

.card:hover { border-color: rgba(48, 54, 61, 0.8); }

.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.card-title { font-size: 16px; font-weight: 600; }

/* ============ STAT CARDS ============ */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: var(--transition); position: relative; overflow: hidden;
}

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0; transition: var(--transition);
}

.stat-card:hover::before { opacity: 1; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}

.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }

.stat-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px; color: var(--text-secondary);
}

/* ============ TABLE ============ */
.table-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.table-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}

.table-title { font-size: 15px; font-weight: 600; }

table {
  width: 100%; border-collapse: collapse;
}

thead th {
  padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ============ MOBILE CARDS (replaces tables on small screens) ============ */
.mobile-cards { display: none; }

.mobile-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  transition: var(--transition);
}

.mobile-card:active { background: var(--bg-card-hover); }

.mobile-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}

.mobile-card-name {
  font-size: 16px; font-weight: 600;
}

.mobile-card-actions {
  display: flex; gap: 6px;
}

.mobile-card-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

.mobile-card-field {
  padding: 8px; background: var(--bg-secondary); border-radius: 6px;
}

.mobile-card-field .mcf-label {
  font-size: 10px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 2px;
}

.mobile-card-field .mcf-value {
  font-size: 13px; font-weight: 500;
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}

.badge-green { background: var(--success-bg); color: var(--success); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-yellow { background: var(--warning-bg); color: var(--warning); }
.badge-gray { background: rgba(139,148,158,0.1); color: var(--text-secondary); }
.badge-purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 14px; font-family: inherit;
  transition: var(--transition);
  -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea { min-height: 80px; resize: vertical; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option { background: var(--bg-card); color: var(--text-primary); }

.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.form-check {
  display: flex; align-items: center; gap: 8px;
}

.form-check input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--accent);
  cursor: pointer;
}

.form-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.2s ease;
  padding: 16px;
}

.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 560px; max-width: 100%;
  max-height: calc(100vh - 32px); overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}

.modal-title { font-size: 18px; font-weight: 600; }

.modal-close {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  transition: var(--transition); background: none; border: none;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--bg-card);
}

/* ============ FILTERS ============ */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
  align-items: center;
}

.filter-input {
  padding: 8px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  transition: var(--transition); min-width: 140px;
}

.filter-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-select {
  padding: 8px 32px 8px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: var(--transition);
}

.filter-select:focus { outline: none; border-color: var(--accent); }
.filter-select option { background: var(--bg-card); }

/* ============ STARS ============ */
.stars { color: var(--warning); font-size: 14px; letter-spacing: 1px; }

/* ============ QUALITY SCORE ============ */
.score-bar {
  width: 80px; height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden; display: inline-block;
  vertical-align: middle; margin-left: 8px;
}

.score-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.5s ease;
}

.score-high { background: var(--success); }
.score-mid { background: var(--warning); }
.score-low { background: var(--danger); }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; margin-bottom: 20px; }

/* ============ TOAST ============ */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}

.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); animation: slideInRight 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 90vw;
}

.toast-success { background: #1a3a2a; border: 1px solid rgba(63,185,80,0.3); color: var(--success); }
.toast-error { background: #3a1a1a; border: 1px solid rgba(248,81,73,0.3); color: var(--danger); }
.toast-info { background: #1a2a3a; border: 1px solid rgba(88,166,255,0.3); color: var(--info); }

/* ============ CAMPAIGN SECTION ============ */
.campaign-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}

.campaign-header h3 { font-size: 18px; margin-bottom: 4px; }
.campaign-header p { color: rgba(255,255,255,0.7); font-size: 14px; }

/* ============ SCAN BOX ============ */
.scan-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}

.scan-box .scan-input-row {
  display: flex; gap: 12px; align-items: flex-end;
}

.scan-box .scan-input-row .form-group { flex: 1; margin-bottom: 0; }

.scan-result {
  margin-top: 16px; padding: 16px; background: var(--bg-secondary);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

.scan-result .scan-field {
  display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}

.scan-result .scan-field:last-child { border-bottom: none; }
.scan-result .scan-field .sf-label { color: var(--text-muted); }
.scan-result .scan-field .sf-value { font-weight: 500; }

/* ============ DETAIL VIEW ============ */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 20px;
}

.detail-item {
  padding: 12px 16px; background: var(--bg-secondary);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

.detail-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}

.detail-value { font-size: 15px; font-weight: 500; }

/* ============ TAB NAV ============ */
.tab-nav {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-item {
  padding: 12px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition); white-space: nowrap;
}

.tab-item:hover { color: var(--text-secondary); }
.tab-item.active { color: var(--accent-light); border-bottom-color: var(--accent); }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ MISC ============ */
.text-truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 200px;
}

.clickable { cursor: pointer; }
.clickable:hover { color: var(--accent-light); }

.flex-center { display: flex; align-items: center; gap: 8px; }

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}

.wide-modal { width: 720px; }

.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}

/* ============ RESPONSIVE – TABLET ============ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ============ RESPONSIVE – MOBILE ============ */
@media (max-width: 768px) {
  :root { --sidebar-width: 280px; }

  .mobile-header { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.show { display: block; }

  .main-content {
    margin-left: 0; padding: 72px 16px 24px;
  }

  .page-header {
    flex-direction: column; align-items: flex-start;
  }

  .page-title { font-size: 22px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; margin-bottom: 10px; }

  .filters-bar {
    gap: 8px;
  }

  .filter-input, .filter-select {
    min-width: 0; width: 100%; font-size: 14px;
    padding: 10px 14px;
  }

  /* Hide desktop tables, show mobile cards */
  .desktop-table { display: none !important; }
  .mobile-cards { display: block !important; }

  .form-row { grid-template-columns: 1fr; }

  .modal {
    width: 100%; max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
    align-self: flex-end;
  }

  .modal-overlay { align-items: flex-end; padding: 0; }

  .modal-body { padding: 16px; }
  .modal-header { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  .detail-grid { grid-template-columns: 1fr; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .scan-box .scan-input-row {
    flex-direction: column;
  }

  .toast-container { top: 64px; right: 8px; left: 8px; }
  .toast { min-width: auto; width: 100%; }

  .campaign-header { padding: 16px; }
  .campaign-header h3 { font-size: 16px; }
  .campaign-header p { font-size: 13px; }

  .btn { padding: 10px 16px; font-size: 14px; }
  .btn-icon { width: 44px; height: 44px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-box { padding: 32px 24px; }
}
