:root {
  --accent: #44BAC6;
  --accent-strong: #2e8c97;
  --btn-gradient: linear-gradient(135deg, #2e8c97, #44BAC6);
  --border: #e5e5e8;
  --bg: #f7f7f8;
  --bg-sidebar: #f7f7f8;
  --hover-bg: #ececee;
  --active-bg: #e7f6f7;
  --icon: #52525b;
  --text: #18181b;
  --text-muted: #71717a;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text); background: #ffffff;
}

/* Sidebar + mobile drawer, ported from dreamdeco-visual's BASE_TEMPLATE --
   basic version (no language switcher, no i18n, only the nav items this
   app actually has: Room Styler, History, and a staff-only Budget link
   instead of the internal app's much longer admin section). */
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  width: 244px; flex: 0 0 auto; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width 0.15s ease; overflow: hidden;
}
.sidebar.collapsed { width: 68px; }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 16px;
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.sidebar.collapsed .sidebar-header {
  flex-direction: column; justify-content: center; gap: 10px; padding: 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.logo-icon { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; overflow: hidden; }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { font-weight: 700; font-size: 14.5px; line-height: 1.3; white-space: nowrap; }
/* white-space: normal (overriding the nowrap above) so the longer
   "Powered by HomeDeco.nl" subtitle wraps onto a second line instead of
   being silently clipped by .brand's overflow: hidden. */
.brand-text .l2 { display: block; font-weight: 500; color: var(--text-muted); font-size: 11.5px; white-space: normal; line-height: 1.25; }
.sidebar.collapsed .brand-text { display: none; }
.collapse-btn {
  border: none; background: none; color: var(--icon); cursor: pointer; padding: 5px;
  display: flex; align-items: center; justify-content: center; border-radius: 6px; flex: 0 0 auto;
}
.collapse-btn:hover { background: var(--hover-bg); }
.collapse-btn svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }

.sidebar-nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer {
  margin-top: auto; padding: 10px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav-item:hover { background: var(--hover-bg); }
.nav-item.active { background: var(--active-bg); color: var(--accent-strong); }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--icon); stroke: currentColor; }
.nav-item.active svg { color: var(--accent-strong); }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }

/* EN/NL language switcher -- a plain form POST + full page reload (see
   auth.set_language), ported from dreamdeco-visual's own sidebar
   switcher, same shape/behavior. */
.lang-switch { display: flex; gap: 4px; padding: 4px 10px 6px; }
.lang-switch button {
  flex: 1; padding: 5px 0; border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.03em; cursor: pointer; font-family: inherit;
}
.lang-switch button:hover { background: var(--hover-bg); }
.lang-switch button.active { background: var(--active-bg); color: var(--accent-strong); border-color: var(--accent-strong); }
.sidebar.collapsed .lang-switch { display: none; }

.sidebar-legal-links { padding: 2px 10px 4px; margin: 0; }
.sidebar.collapsed .sidebar-legal-links { display: none; }

.content { flex: 1; overflow-y: auto; background: #fff; padding: 24px 28px; }

.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(85vw, 320px); z-index: 101;
    transform: translateX(-100%); transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: min(85vw, 320px); }
  .sidebar.collapsed .sidebar-header { flex-direction: row; justify-content: space-between; padding: 18px 16px; }
  .sidebar.collapsed .brand-text { display: block; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; }
  .sidebar.collapsed .nav-item span { display: inline; }
  .sidebar.collapsed .collapse-btn svg { transform: none; }
  .sidebar.collapsed .lang-switch { display: flex; }
  .sidebar.collapsed .sidebar-legal-links { display: block; }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

  .mobile-topbar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); background: var(--bg-sidebar); flex: 0 0 auto;
  }
  .mobile-menu-btn {
    border: none; background: none; color: var(--icon); cursor: pointer; padding: 6px;
    display: flex; align-items: center; justify-content: center; border-radius: 6px; flex: 0 0 auto;
  }
  .mobile-menu-btn:hover { background: var(--hover-bg); }
  .mobile-menu-btn svg { width: 22px; height: 22px; }

  .content { padding: 20px; }
}

.logout-link { font-size: 13px; color: var(--text-muted); text-decoration: none; }

.page { max-width: 480px; margin: 60px auto; padding: 0 20px 60px; }
/* Room Styler's own layout needs the full viewport, not the default
   480px-centered column -- its own extensive CSS lives inline in
   room_styler.html (ported from dreamdeco-visual, scoped to that page
   only), same convention the source uses. This just clears the base
   page's constraints so that CSS has a clean flex container to work
   with. Applied to .content (inside .app-shell, once logged in), not
   .page (the logged-out layout, which Room Styler never renders in). */
.content.rs-page { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

.flash { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }

.auth-card { text-align: center; padding-top: 40px; }
.auth-logo { max-width: 200px; width: 100%; height: auto; display: block; margin: 0 auto 20px; }
.auth-illustration { max-width: 220px; width: 100%; height: auto; display: block; margin: 0 auto 20px; }
.auth-card h1 { font-size: 24px; margin: 0 0 8px; }
.auth-card .sub { color: var(--text-muted); font-size: 14px; margin: 0 0 28px; }

.btn-google {
  display: block; width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-weight: 600; text-decoration: none; font-size: 14px;
}

/* Disclosure toggle for the email-login form, styled to match
   .btn-google (same outlined-button look) rather than a plain text
   link, so it reads as a real alternative sign-in action. Stays
   collapsed by default so the email form and its fine print don't
   take up space until asked for. */
.email-toggle { margin: 12px 0 0; }
.email-toggle summary {
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
  color: var(--text); font-weight: 600; font-size: 14px;
}
.email-toggle summary:hover { background: var(--hover-bg); }
.email-toggle summary::-webkit-details-marker { display: none; }
.email-toggle summary span::after {
  content: "\25be"; display: inline-block; margin-left: 4px; font-size: 11px;
  color: var(--text-muted); transition: transform 0.15s ease;
}
.email-toggle[open] summary span::after { transform: rotate(180deg); }
.email-toggle .email-form { margin-top: 16px; }
.email-toggle .fine-print { margin-top: 10px; }

.email-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.email-form label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.email-form input {
  padding: 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 15px; font-family: inherit;
}
.fine-print { font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.legal-links { font-size: 12px; color: var(--text-muted); margin-top: 20px; text-align: center; }
.legal-links a { color: var(--text-muted); text-decoration: underline; }
.legal-links a:hover { color: var(--accent-strong); }
.legal-links span { margin: 0 6px; }

.btn-primary {
  background: var(--btn-gradient); color: #fff; border: none; border-radius: 999px;
  padding: 13px 20px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { filter: brightness(0.95); }
.btn-primary:disabled { opacity: 0.5; cursor: default; filter: none; }

.admin-page { max-width: 400px; }
.admin-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.admin-form input { padding: 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; }
