/* ============================================================
   Lofly Design System — v1
   Colors: Navy #1a2335 | Orange #F97316 | White #ffffff
   ============================================================ */

.hidden { display: none !important; }

:root {
  --navy: #1a2335;
  --navy-light: #243045;
  --navy-dark: #111827;
  --orange: #F97316;
  --orange-light: #FB923C;
  --orange-dark: #EA6C0A;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --sidebar-width: 220px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Custom Lofly cursor — oranje bolletje */
*, *::before, *::after {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9' fill='%23F97316'/%3E%3C/svg%3E") 11 11, auto !important;
}
a, button, [role="button"], select, input[type="checkbox"], input[type="radio"], label {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Ccircle cx='13' cy='13' r='11' fill='%23F97316'/%3E%3C/svg%3E") 13 13, pointer !important;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--gray-50);
  line-height: 1.5;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   App Layout
   ============================================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: var(--gray-50);
}

/* ============================================================
   Sidebar / Navigation
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 12px rgba(249,115,22,.6);
  flex-shrink: 0;
}

.logo-text {
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.nav-items {
  flex: 1;
  padding: 12px 0;
}

.nav-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 8px 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.6);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: color .15s, background .15s;
  border-radius: 0;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,.06);
  text-decoration: none;
}

.nav-item.active {
  color: var(--white);
  background: rgba(249,115,22,.15);
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--orange);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-signout { color: rgba(255,255,255,.4); }
.nav-signout:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.04); }

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

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

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

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

.stat-card.accent { border-left: 3px solid var(--orange); }

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover { color: var(--navy); }

.tab-btn.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.tab-count {
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

.tab-btn.active .tab-count {
  background: rgba(249,115,22,.15);
  color: var(--orange);
}

/* ============================================================
   Table
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}

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

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}

tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 12px 16px;
  font-size: 13.5px;
  vertical-align: middle;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2px;
}

.badge-google { background: #e8f0fe; color: #1967d2; }
.badge-kv { background: #e6f4ea; color: #1e7e34; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d1ecf1; color: #0c5460; }
.badge-posted { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover { background: var(--orange-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}
.btn-danger:hover { background: #fecaca; }

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--gray-100); color: var(--navy); }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }

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

.form-control {
  display: block;
  width: 100%;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}

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

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

/* ============================================================
   Stars
   ============================================================ */
.star { font-size: 16px; }
.star-filled { color: #f59e0b; }
.star-empty { color: var(--gray-300); }

.star-lg { font-size: 22px; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--navy); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  min-width: 260px;
  max-width: 380px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #064e3b; color: #fff; }
.toast-error { background: #7f1d1d; color: #fff; }
.toast-info { background: var(--navy); color: #fff; }
.toast-icon { font-size: 16px; }

/* ============================================================
   Auth / Login page
   ============================================================ */
.auth-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 16px rgba(249,115,22,.5);
}

.auth-logo-text {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.5px;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.auth-submit {
  width: 100%;
  padding: 11px;
  font-size: 14.5px;
  font-weight: 600;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.auth-submit:hover { background: var(--orange-dark); }

.auth-error {
  background: #fee2e2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-state-sub { font-size: 13.5px; }

/* ============================================================
   Loading Spinner
   ============================================================ */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

.spinner-dark {
  border-color: var(--gray-200);
  border-top-color: var(--orange);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  padding: 80px;
  text-align: center;
  color: var(--text-muted);
}

/* ============================================================
   Review Card (expanded editor)
   ============================================================ */
.review-row-expand {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.review-expand-inner {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.review-section-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.review-text-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 90px;
  max-height: 180px;
  overflow-y: auto;
}

/* ============================================================
   QR Card
   ============================================================ */
.qr-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

/* ============================================================
   Misc utilities
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-sec