/* ── Woonmodule Brand Font ────────────────────────── */
@font-face {
  font-family: 'Circular';
  src: url('/static/public/fonts/CircularXXWeb-Light.woff2') format('woff2'),
       url('/static/public/fonts/CircularXXWeb-Light.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Circular';
  src: url('/static/public/fonts/CircularXXWeb-Black.woff2') format('woff2'),
       url('/static/public/fonts/CircularXXWeb-Black.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* ── Design Tokens ───────────────────────────────── */
:root {
  --pdash-bg: #f5f8ff;
  --pdash-card: #ffffff;
  --pdash-border: #d0dfef;
  --pdash-text: #000055;
  --pdash-muted: #6b7280;
  --pdash-accent: #000055;
  --pdash-accent-light: #DDEEFF;
  --pdash-accent-hover: #000044;
  --pdash-success: #16a34a;
  --pdash-warm: #b45309;
  --pdash-pink: #FF3266;
  --pdash-pale-pink: #FFEEEE;
  --pdash-blue: #99CCFF;
  --pdash-shadow: 0px 0px 10px rgba(0, 0, 85, 0.12);
  --pdash-shadow-hover: 0px 0px 15px rgba(0, 0, 85, 0.2);
  --pdash-font: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: var(--pdash-font);
  color: var(--pdash-text);
}

html {
  height: -webkit-fill-available;
}

/* let the document be taller than the viewport */
main {
  height: auto;
  max-height: none;
  flex: 1;
  min-width: 0;
  overflow: auto;
}

a,
a:hover {
  color: #000055;
  text-decoration: none;
}

.b-example-divider {
  flex-shrink: 0;
  width: 1.5rem;
  height: 100vh;
  background-color: rgba(0, 0, 85, .1);
  border: solid rgba(0, 0, 85, .15);
  border-width: 1px 0;
  box-shadow: inset 0 .5em 1.5em rgba(0, 0, 85, .1), inset 0 .125em .5em rgba(0, 0, 85, .15);
}

.bi {
  vertical-align: -.125em;
  pointer-events: none;
  fill: currentColor;
}

.dropdown-toggle { outline: 0; }

.scrollarea {
  overflow-y: auto;
}

.fw-semibold { font-weight: 600; }
.lh-tight { line-height: 1.25; }


html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

#cms-iframe {
  border: 0;
  width: 100%;
  display: block;
  min-height: 95vh;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--pdash-border);
  overflow-y: auto;
  position: sticky;
  top: 0;
  min-height: 100vh;
  background: var(--pdash-bg);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--pdash-border);
}
.sidebar-brand a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.sidebar-brand-logo {
  height: 16px;
  width: auto;
}

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

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pdash-muted);
  cursor: pointer;
  transition: background .1s ease, color .1s ease;
}
.sidebar-section-toggle:hover {
  background: #e2ecff;
  color: var(--pdash-text);
}
.sidebar-section-toggle svg {
  flex-shrink: 0;
  opacity: 0.5;
}
.sidebar-section-toggle::after {
  content: "";
  margin-left: auto;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba(0,0,85,.4)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5 6l3 3 3-3'/%3e%3c/svg%3e") center no-repeat;
  transition: transform .2s ease;
}
.sidebar-section-toggle.collapsed::after {
  transform: rotate(-90deg);
}

.sidebar-links {
  list-style: none;
  margin: 2px 0 6px;
  padding: 0;
}
.sidebar-links li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  margin: 1px 0;
  border-radius: 6px;
  font-size: 13px;
  color: #4b5570;
  text-decoration: none;
  transition: background .1s ease, color .1s ease;
}
.sidebar-links li a:hover {
  background: #e2ecff;
  color: var(--pdash-text);
}
.sidebar-links li a.active {
  background: var(--pdash-accent-light);
  color: var(--pdash-accent);
  font-weight: 600;
}

.sidebar-link-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pdash-blue);
  flex-shrink: 0;
}
.sidebar-link-dot--active {
  background: var(--pdash-accent);
}

/* Sidebar user footer */
.sidebar-user {
  border-top: 1px solid var(--pdash-border);
  margin-top: auto;
}
.sidebar-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pdash-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Compact Tabulator overrides */
.tabulator {
  font-size: 0.8125rem;
  border: 1px solid var(--pdash-border);
}

.tabulator .tabulator-header .tabulator-col {
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pdash-muted);
  background-color: var(--pdash-bg);
  border-bottom: 2px solid var(--pdash-border);
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
  padding: 5px 8px;
  line-height: 1.4;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
  min-height: 0;
  border-bottom: 1px solid #eef2fb;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover {
  background-color: var(--pdash-bg);
  cursor: pointer;
}

.tabulator .tabulator-footer {
  padding: 4px 8px;
  font-size: 0.8125rem;
  background-color: var(--pdash-bg);
}

.tabulator .tabulator-footer .tabulator-page {
  padding: 2px 8px;
  font-size: 0.75rem;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter {
  right: 2px;
}

/* ── Project Dashboard Tiles ─────────────────────── */

.pdash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.pdash-tile {
  background: var(--pdash-card);
  border: 1px solid var(--pdash-border);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s ease, border-color .15s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.pdash-tile:hover {
  border-color: var(--pdash-blue);
  box-shadow: var(--pdash-shadow-hover);
  color: inherit;
  text-decoration: none;
}

.pdash-tile--disabled {
  opacity: 0.6;
  cursor: default;
}

.pdash-tile-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdash-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.pdash-tile-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--pdash-text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.pdash-tile-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--pdash-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.pdash-tile-desc {
  font-size: 13px;
  color: var(--pdash-muted);
  line-height: 1.45;
}

.pdash-tile-desc--prominent {
  font-size: 15px;
  font-weight: 500;
  color: var(--pdash-text);
}

.pdash-tile-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pdash-accent);
  margin-top: auto;
}
.pdash-tile:hover .pdash-tile-action {
  color: var(--pdash-pink);
}
.pdash-tile-action svg {
  width: 14px;
  height: 14px;
  transition: transform .15s ease;
}
.pdash-tile:hover .pdash-tile-action svg {
  transform: translateX(2px);
}

/* Icon background variants */
.pdash-icon-blue   { background: var(--pdash-accent-light); color: var(--pdash-accent); }
.pdash-icon-teal   { background: #e6f7f4; color: #0f766e; }
.pdash-icon-amber  { background: #fef3e2; color: #b45309; }
.pdash-icon-green  { background: #ecfdf5; color: #16a34a; }
.pdash-icon-purple { background: #f3f0ff; color: #6d28d9; }
.pdash-icon-rose   { background: var(--pdash-pale-pink); color: var(--pdash-pink); }
.pdash-icon-slate  { background: #f1f5f9; color: #475569; }
.pdash-icon-indigo { background: #eef2ff; color: #4338ca; }

/* Section separator */
.pdash-section {
  margin-top: 28px;
}
.pdash-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pdash-muted);
  margin-bottom: 12px;
  padding-left: 2px;
}

/* Funnel stage pills */
.pdash-funnel-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pdash-funnel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--pdash-bg);
  color: var(--pdash-text);
}
.pdash-funnel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Wide tile spanning two columns */
.pdash-tile-wide {
  grid-column: span 2;
}
@media (max-width: 640px) {
  .pdash-tile-wide { grid-column: span 1; }
}

/* Home intro */
.pdash-home-intro {
  font-size: 15px;
  color: var(--pdash-muted);
  margin-bottom: 20px;
}

/* External link icon */
.pdash-external {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  margin-left: 2px;
}

/* ── Auth Pages ──────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef3ff;
  padding: 24px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--pdash-border);
  border-radius: 12px;
  box-shadow: var(--pdash-shadow);
  max-width: 420px;
  width: 100%;
  padding: 36px 32px;
}

.auth-logo {
  display: block;
  height: 20px;
  width: auto;
  margin: 0 auto 28px;
}

.auth-input {
  border: 1px solid #c0d0e4;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-input:focus {
  outline: none;
  border-color: var(--pdash-accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 85, .12);
}

.auth-btn {
  display: block;
  width: 100%;
  background: var(--pdash-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
}
.auth-btn:hover {
  background: var(--pdash-accent-hover);
  box-shadow: var(--pdash-shadow-hover);
  color: #fff;
  text-decoration: none;
}

.auth-link {
  color: var(--pdash-accent);
  text-decoration: none;
  font-size: 14px;
}
.auth-link:hover {
  color: var(--pdash-pink);
  text-decoration: underline;
}

.auth-alert-success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

.auth-alert-danger {
  background: var(--pdash-pale-pink);
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Bootstrap Overrides ─────────────────────────── */

/* Buttons */
.btn {
  border-radius: 8px;
  font-size: 0.875rem;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background-color: var(--pdash-accent);
  border-color: var(--pdash-accent);
}
.btn-primary:hover,
.btn-primary:active {
  background-color: var(--pdash-accent-hover);
  border-color: var(--pdash-accent-hover);
  box-shadow: var(--pdash-shadow);
}
.btn-primary:focus-visible {
  background-color: var(--pdash-accent);
  border-color: var(--pdash-accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 85, .25);
}
.btn-outline-primary {
  color: var(--pdash-accent);
  border-color: var(--pdash-accent);
}
.btn-outline-primary:hover,
.btn-outline-primary:active {
  background-color: var(--pdash-accent);
  border-color: var(--pdash-accent);
  color: #fff;
}
.btn-outline-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 0, 85, .25);
}
.btn-secondary {
  background-color: #6b7280;
  border-color: #6b7280;
}
.btn-secondary:hover,
.btn-secondary:active {
  background-color: #4b5563;
  border-color: #4b5563;
}
.btn-outline-secondary {
  color: #6b7280;
  border-color: var(--pdash-border);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:active {
  background-color: var(--pdash-bg);
  border-color: var(--pdash-border);
  color: var(--pdash-text);
}
.btn-success {
  background-color: var(--pdash-success);
  border-color: var(--pdash-success);
}
.btn-success:hover,
.btn-success:active {
  background-color: #15803d;
  border-color: #15803d;
}
.btn-danger {
  background-color: var(--pdash-pink);
  border-color: var(--pdash-pink);
}
.btn-danger:hover,
.btn-danger:active {
  background-color: #e0255a;
  border-color: #e0255a;
}

/* Cards */
.card {
  border: 1px solid var(--pdash-border);
  border-radius: 10px;
  box-shadow: var(--pdash-shadow);
}
.card-header {
  background-color: var(--pdash-bg);
  font-weight: 600;
  border-bottom: 1px solid var(--pdash-border);
}
.card-body {
  padding: 20px;
}
.card-narrow {
  max-width: 500px;
}

/* Badges – soft / pastel style */
.badge {
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  font-size: 0.75rem;
}
.badge.bg-success {
  background-color: #ecfdf5 !important;
  color: #166534 !important;
}
.badge.bg-danger {
  background-color: var(--pdash-pale-pink) !important;
  color: var(--pdash-pink) !important;
}
.badge.bg-warning {
  background-color: #fef3e2 !important;
  color: #b45309 !important;
}
.badge.bg-info {
  background-color: var(--pdash-accent-light) !important;
  color: var(--pdash-accent) !important;
}
.badge.bg-secondary {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}
.badge.bg-primary {
  background-color: var(--pdash-accent-light) !important;
  color: var(--pdash-accent) !important;
}

/* Alerts */
.alert {
  border-radius: 8px;
  font-size: 0.875rem;
}
.alert-success {
  background-color: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}
.alert-danger {
  background-color: var(--pdash-pale-pink);
  border-color: #fecaca;
  color: #991b1b;
}
.alert-warning {
  background-color: #fef3e2;
  border-color: #fde68a;
  color: #92400e;
}
.alert-info {
  background-color: var(--pdash-accent-light);
  border-color: var(--pdash-blue);
  color: var(--pdash-accent);
}

/* Form controls */
.form-control,
.form-select {
  border-radius: 8px;
  border-color: #c0d0e4;
  font-size: 0.875rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--pdash-accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 85, .12);
}
.form-label {
  font-weight: 500;
  color: var(--pdash-text);
}

/* Tables */
.table > thead th {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--pdash-muted);
  background-color: var(--pdash-bg);
  border-bottom-width: 2px;
  border-bottom-color: var(--pdash-border);
}
.table > tbody > tr > td {
  padding: 10px 12px;
  vertical-align: middle;
  border-color: #eef2fb;
}
.table-hover > tbody > tr:hover {
  background-color: var(--pdash-bg);
}

/* Progress bars */
.progress {
  border-radius: 8px;
  background-color: var(--pdash-accent-light);
}
.progress-bar {
  background-color: var(--pdash-accent);
}

/* Nav tabs */
.nav-tabs .nav-link {
  border-radius: 6px 6px 0 0;
  font-size: 0.875rem;
  color: var(--pdash-muted);
}
.nav-tabs .nav-link.active {
  color: var(--pdash-accent);
  font-weight: 600;
  border-color: var(--pdash-border) var(--pdash-border) #fff;
}
.nav-tabs .nav-link:hover:not(.active) {
  color: var(--pdash-text);
  border-color: transparent;
}

/* List groups */
.list-group-item {
  border-color: var(--pdash-border);
}

/* Page header */
.page-header {
  padding: 0.75rem 0 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--pdash-border);
}
.page-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.page-header-section:empty { display: none; }
.page-header-section::before {
  content: " › ";
  color: var(--pdash-muted);
  font-weight: 400;
}
.page-header-section {
  font-weight: 500;
  color: var(--pdash-muted);
}
.page-description:empty { display: none; }
.page-description {
  font-size: 0.875rem;
  color: var(--pdash-muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* Text color utilities */
.text-primary {
  color: var(--pdash-accent) !important;
}
.text-success {
  color: var(--pdash-success) !important;
}
