/* Helder App — portal/public/style.css
   Brand: #faf7f2 bg, #244a29 green, #3d2b1f dark, Georgia serif, Helvetica sans */

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

html { font-size: 16px; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: #f5f1ec;
  color: #2b2420;
  min-height: 100vh;
  display: flex;
}

a { color: #244a29; }

/* === Shell: header + sidebar + main === */

.shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* --- Sidebar --- */

.sidebar {
  width: 240px;
  background: #faf7f2;
  border-right: 1px solid #e8e0d6;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  color: #244a29;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  padding: 1.5rem 1.25rem 1rem;
  text-decoration: none;
  display: block;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  list-style: none;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #5a4a3e;
  text-decoration: none;
  padding: 0.55rem 1.25rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.sidebar-nav a:hover {
  background: #f0ebe4;
}

.sidebar-nav a.active {
  color: #3d2b1f;
  font-weight: 600;
  background: #f0ebe4;
  border-left-color: #244a29;
}

.sidebar-nav .nav-section {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  color: #a09284;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 1.2rem 1.25rem 0.3rem;
}

.sidebar-nav .nav-sub a {
  padding-left: 2.2rem;
  font-size: 0.85rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e8e0d6;
}

.sidebar-footer a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: #a09284;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #244a29;
}

/* --- Main content --- */

.main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: none; /* only shows on mobile */
}

.content {
  flex: 1;
  padding: 2rem;
  max-width: 960px;
  width: 100%;
}

.content-footer {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: #a09284;
  text-align: center;
  padding: 1rem 2rem 1.5rem;
}

/* === Typography === */

h1 {
  font-size: 1.5rem;
  color: #3d2b1f;
  margin: 0 0 1.2rem;
}

h2 {
  font-size: 1.15rem;
  color: #3d2b1f;
  margin: 1.5rem 0 0.5rem;
}

p {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}

/* === KPI cards === */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #faf7f2;
  border: 1px solid #e8e0d6;
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
}

.kpi-label {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: #a09284;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #3d2b1f;
}

.kpi-change {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.kpi-change.positive { color: #27ae60; }
.kpi-change.negative { color: #c0392b; }
.kpi-change.neutral  { color: #a09284; }

/* === Charts === */

.chart-container {
  background: #faf7f2;
  border: 1px solid #e8e0d6;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.chart-container canvas {
  max-height: 320px;
}

/* === Tables === */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
  text-align: left;
}

th {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: #a09284;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #d4c8bc;
  padding: 0.5rem 0.5rem;
}

td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #ebe5dd;
}

/* === Badges === */

.badge {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  display: inline-block;
}

.badge-positive  { background: #e8f5e9; color: #2e7d32; }
.badge-negative  { background: #fce4ec; color: #c62828; }
.badge-neutral   { background: #f5f5f5; color: #757575; }
.badge-mixed     { background: #fff8e1; color: #f57f17; }
.badge-bezorgd   { background: #e8f5e9; color: #2e7d32; }
.badge-verstuurd { background: #e3f2fd; color: #1565c0; }

/* === Stars === */

.stars {
  color: #f4a623;
  font-size: 1rem;
  letter-spacing: 1px;
}

.stars-empty { color: #d4c8bc; }

/* === Buttons === */

.knop {
  display: inline-block;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background: #244a29;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.knop:hover {
  background: #1a3620;
}

.knop-secondary {
  background: transparent;
  color: #244a29;
  border: 1px solid #d4c8bc;
}

.knop-secondary:hover {
  background: #f0ebe4;
}

/* === Forms === */

input[type="email"],
input[type="text"],
textarea {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid #d4c8bc;
  border-radius: 6px;
  width: 100%;
  max-width: 24rem;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #244a29;
}

/* === Chat (Vraag het Helder) === */

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  min-height: 200px;
}

.chat-msg {
  max-width: 80%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.chat-msg.user {
  align-self: flex-end;
  background: #244a29;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: #faf7f2;
  border: 1px solid #e8e0d6;
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
}

.chat-input-row input[type="text"] {
  flex: 1;
  max-width: none;
}

.chat-input-row button {
  flex-shrink: 0;
}

.chat-usage {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #a09284;
  margin-top: 0.5rem;
}

/* === Interpretation text === */

.interpretation {
  font-style: italic;
  margin: 0.5rem 0 1rem;
  line-height: 1.6;
  color: #5a4a3e;
}

/* === Quick links === */

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.quick-link {
  display: block;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #5a4a3e;
  text-decoration: none;
  background: #faf7f2;
  border: 1px solid #e8e0d6;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  transition: border-color 0.15s;
}

.quick-link:hover {
  border-color: #244a29;
}

/* === Filter tabs === */

.filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.filter-tab {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  color: #5a4a3e;
  background: transparent;
  border: 1px solid #d4c8bc;
  cursor: pointer;
}

.filter-tab:hover { background: #f0ebe4; }

.filter-tab.active {
  background: #244a29;
  color: #fff;
  border-color: #244a29;
}

/* === Review card === */

.review-card {
  background: #faf7f2;
  border: 1px solid #e8e0d6;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.review-author {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3d2b1f;
}

.review-date {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #a09284;
}

.review-text {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.3rem;
  color: #5a4a3e;
}

.review-sentiment {
  margin-top: 0.4rem;
}

/* === Empty state === */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #a09284;
}

/* === Demo banner === */

.demo-banner {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  text-align: center;
  background: #fff8e1;
  color: #8d6e00;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #ffe082;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 2rem;
}

.demo-banner-link {
  color: #244a29;
  font-weight: 600;
  margin-left: 0.75rem;
  text-decoration: underline;
}

/* Shift everything down when demo banner is present */
.demo-banner ~ .sidebar { top: 2rem; }
.demo-banner ~ .main { padding-top: 2rem; }
.demo-banner ~ .main .topbar { top: 2rem; }

/* === Login page (no sidebar) === */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: #faf7f2;
}

.login-box {
  max-width: 24rem;
  width: 100%;
  padding: 2rem;
  text-align: center;
}

.login-brand {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #244a29;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* === Hamburger (mobile) === */

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #3d2b1f;
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* === Mobile overlay === */

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

/* === Responsive === */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

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

  .main {
    margin-left: 0;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #faf7f2;
    border-bottom: 1px solid #e8e0d6;
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .topbar-brand {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #244a29;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-decoration: none;
    font-weight: 600;
  }

  .hamburger {
    display: block;
  }

  .content {
    padding: 1.25rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chat-msg {
    max-width: 90%;
  }

  .review-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* === Admin portal === */

.admin-sidebar .sidebar-brand {
  color: #2c3e50;
}

.admin-sidebar .sidebar-nav a.active {
  border-left-color: #2c3e50;
}

.admin-login-page {
  background: #f0f2f5;
}

.admin-login-page .login-brand {
  color: #2c3e50;
}

/* --- Admin forms --- */

.admin-form {
  margin-top: 0.5rem;
}

.admin-form-group {
  margin-bottom: 1rem;
}

.admin-form-group label {
  display: block;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #5a4a3e;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.admin-form-group input[type="text"],
.admin-form-group input[type="email"],
.admin-form-group input[type="password"],
.admin-form-group textarea,
.admin-form-group select {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #d4c8bc;
  border-radius: 6px;
  width: 100%;
  max-width: 100%;
  background: #fff;
}

.admin-form-group select {
  font-family: Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
  outline: none;
  border-color: #2c3e50;
}

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* --- Admin table --- */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  color: #a09284;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #d4c8bc;
  padding: 0.5rem;
  text-align: left;
}

.admin-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #ebe5dd;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #faf7f2;
}

.admin-table a {
  font-weight: 600;
}

/* --- Admin flash messages --- */

.admin-flash {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #c8e6c9;
}

.admin-error {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #c0392b;
  text-align: center;
  margin-bottom: 1rem;
}

.admin-success {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: #27ae60;
  text-align: center;
  margin-bottom: 1rem;
}

/* --- Admin KPI accent --- */

.admin-kpi {
  border-left: 3px solid #2c3e50;
}
