:root {
  --pine: #0a3d48;
  --pine-deep: #062a32;
  --lake: #0d6b7c;
  --kbt-blue: #0d6b7c;
  --mist: #e8eef0;
  --snow: #f7faf9;
  --saffron: #c9a227;
  --saffron-soft: #e8c97a;
  --ink: #15201c;
  --muted: #5c6f68;
  --line: rgba(10, 61, 72, 0.12);
  --danger: #b42318;
  --ok: #1f7a4d;
  --card: rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 50px rgba(6, 42, 50, 0.12);
  --radius: 18px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --sidebar: 272px;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 111, 122, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(200, 151, 58, 0.16), transparent 50%),
    linear-gradient(165deg, #f4f8f7 0%, #e7eef0 45%, #f8f6f0 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a { color: var(--lake); text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, video, canvas, svg { max-width: 100%; height: auto; }
img { display: inline-block; vertical-align: middle; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--pine-deep), var(--pine));
  color: #eef6f3;
  padding: 1.4rem 1rem 1rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  position: sticky; top: 0; height: 100vh;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}
.brand { display: flex; gap: .75rem; align-items: center; padding: .4rem .6rem 1rem; }
.brand-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 0 0 2px #0033cc, 0 0 0 3.5px #e11d2e; flex-shrink: 0; }
.brand-text { min-width: 0; }
.veloz-footer {
  text-align: center; padding: .85rem 1rem 1.25rem; font-size: .78rem; color: var(--muted);
  border-top: 1px solid var(--line); margin-top: auto;
}
.veloz-footer a { color: var(--lake); font-weight: 500; }
.content { display: flex; flex-direction: column; min-height: calc(100vh - 72px); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  background:
    linear-gradient(145deg, var(--saffron-soft), var(--saffron)),
    var(--saffron);
  box-shadow: 0 8px 20px rgba(200,151,58,.35);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 10px 8px 8px;
  border: 2px solid rgba(20,53,44,.35); border-radius: 50% 50% 40% 40%;
}
.brand-name { font-family: var(--display); font-size: 1.45rem; line-height: 1; font-weight: 600; }
.brand-sub { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-top: .2rem; }

.nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.nav-link {
  color: rgba(238,246,243,.78); padding: .7rem .9rem; border-radius: 12px;
  transition: .2s ease; font-weight: 500; font-size: .95rem;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(232,201,122,.18); color: #fff; box-shadow: inset 3px 0 0 var(--saffron-soft); }

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; display: grid; gap: .75rem; }
.user-chip { padding: 0 .4rem; }
.user-chip strong { display: block; font-size: .92rem; }
.user-chip span { font-size: .75rem; opacity: .65; text-transform: uppercase; letter-spacing: .08em; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main > .content { flex: 1; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.35rem 1.75rem .5rem; gap: 1rem;
}
.page-title {
  margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  font-weight: 600; letter-spacing: -.01em; color: var(--pine-deep);
}
.content { padding: .75rem 1.75rem 2.5rem; }

.panel, .stat-card, .card {
  background: var(--card); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { padding: 1.1rem 1.2rem; position: relative; overflow: hidden; }
.stat-card::before {
  content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  border-radius: 50%; background: radial-gradient(circle, rgba(47,111,122,.18), transparent 70%);
}
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.stat-value { font-family: var(--display); font-size: 2rem; margin-top: .2rem; color: var(--pine); }
.stat-hint { color: var(--muted); font-size: .82rem; margin-top: .15rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }

.btn {
  appearance: none; border: none; cursor: pointer;
  border-radius: 999px; padding: .65rem 1.15rem; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--pine), var(--lake));
  color: #fff; box-shadow: 0 10px 24px rgba(20,53,44,.25);
}
.btn-accent {
  background: linear-gradient(135deg, var(--saffron), #a87420);
  color: #1a1408; box-shadow: 0 10px 24px rgba(200,151,58,.28);
}
.btn-ghost {
  background: transparent; color: inherit; border: 1px solid currentColor; opacity: .9;
}
.sidebar .btn-ghost { color: #eef6f3; border-color: rgba(255,255,255,.25); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid rgba(180,35,24,.3); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: .7rem .85rem; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
  font-size: 1rem; /* prevent iOS zoom on focus */
  max-width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(47,111,122,.55); box-shadow: 0 0 0 4px rgba(47,111,122,.12);
}
.textarea { min-height: 90px; resize: vertical; }
.label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .35rem; font-weight: 500; }
.field { margin-bottom: .9rem; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }

.pkg-section { margin-bottom: .85rem; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .85rem; background: var(--card); }
.pkg-summary { cursor: pointer; font-weight: 600; color: var(--pine); font-family: var(--display); list-style: none; }
.pkg-summary::-webkit-details-marker { display: none; }
.pkg-form .field { margin-top: .65rem; }

.table-wrap {
  overflow: auto; border-radius: 14px; -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table.data {
  width: 100%; border-collapse: collapse; font-size: .92rem;
  min-width: 520px;
}
table.data th, table.data td {
  text-align: left; padding: .85rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.data th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600;
  background: rgba(232,238,240,.65);
}
table.data tr:hover td { background: rgba(47,111,122,.04); }
.badge {
  display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(47,111,122,.12); color: var(--lake);
}
.badge-ok { background: rgba(31,122,77,.12); color: var(--ok); }
.badge-warn { background: rgba(200,151,58,.18); color: #8a6418; }
.badge-danger { background: rgba(180,35,24,.12); color: var(--danger); }
.badge-muted { background: rgba(92,111,104,.12); color: var(--muted); }

.empty {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
}
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.tabs {
  display: flex; gap: .4rem; flex-wrap: nowrap; margin-bottom: 1rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: .35rem; scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 4px; }
.tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: .55rem 1rem; cursor: pointer; font-weight: 500; color: var(--muted);
  white-space: nowrap; flex-shrink: 0; min-height: 40px;
}
.tab.active { background: var(--pine); color: #fff; border-color: var(--pine); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12,34,28,.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50;
  animation: fadeIn .18s ease;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}
.modal {
  width: min(640px, 100%); max-height: min(90vh, 100%); overflow: auto;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 1.35rem 1.4rem 1.2rem;
  animation: rise .22s ease;
  -webkit-overflow-scrolling: touch;
}
.modal.wide { width: min(920px, 100%); }
.modal h2 { margin: 0 0 1rem; font-family: var(--display); font-size: clamp(1.35rem, 4vw, 1.7rem); color: var(--pine-deep); }
.modal-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1rem;
  position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 30%);
  padding-top: .75rem;
}

.toast-host { position: fixed; right: 1.2rem; top: 1.2rem; z-index: 80; display: grid; gap: .5rem; }
.toast {
  background: var(--pine-deep); color: #fff; padding: .75rem 1rem; border-radius: 12px;
  box-shadow: var(--shadow); min-width: 220px; animation: rise .2s ease;
}
.toast.error { background: var(--danger); }

.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    linear-gradient(120deg, rgba(12,34,28,.72), rgba(47,111,122,.45)),
    radial-gradient(ellipse at 30% 20%, rgba(232,201,122,.35), transparent 50%),
    linear-gradient(160deg, #0c221c, #2f6f7a);
}
.login-card {
  width: min(420px, 100%); background: rgba(255,255,255,.94); border-radius: 28px;
  padding: 2rem 1.75rem; box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 0; font-family: var(--display); font-size: 2.3rem; color: var(--pine-deep); text-align: center;
}
.login-card .tagline { text-align: center; color: var(--muted); margin: .35rem 0 1.5rem; }

.day-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin-bottom: .75rem; background: #fff;
  transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.day-cover-thumbs {
  display: flex; gap: .45rem; margin: .55rem 0 .15rem; flex-wrap: wrap;
}
.day-cover-thumbs img {
  width: 72px; height: 52px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: #e8efed;
}
.day-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.day-card--draggable { cursor: grab; }
.day-card--draggable.is-dragging { opacity: .55; cursor: grabbing; box-shadow: var(--shadow); }
.day-card.drag-over { border-color: var(--lake); box-shadow: 0 0 0 2px rgba(13,107,124,.2); }
.day-drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; min-height: 2.5rem; color: var(--muted); font-size: 1.25rem;
  cursor: grab; user-select: none; touch-action: none; flex-shrink: 0;
}
.pricing-staff { background: linear-gradient(135deg, rgba(13,107,124,.05), rgba(201,162,39,.06)); }
.day-cost-chip {
  display: inline-block; padding: .25rem .55rem; border-radius: 8px;
  background: rgba(13,107,124,.08); color: var(--pine);
  max-width: 100%; word-break: break-word;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #3dd68c; display: inline-block;
  box-shadow: 0 0 0 0 rgba(61,214,140,.7); animation: pulse 1.8s infinite; margin-right: .4rem;
}

.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: .35rem .75rem; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61,214,140,.55); }
  70% { box-shadow: 0 0 0 10px rgba(61,214,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,214,140,0); }
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split, .grid-3 { grid-template-columns: 1fr; }
}

.btn-icon {
  appearance: none; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer;
  display: none; align-items: center; justify-content: center; flex-shrink: 0;
}
.mobile-only { display: none; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(12,34,28,.45);
  z-index: 40; backdrop-filter: blur(3px);
}
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-chip {
  display: inline-flex; padding: .25rem .55rem; border-radius: 999px; font-size: .75rem;
  background: rgba(74,109,140,.12); color: var(--lake); border: 1px solid rgba(74,109,140,.2);
}
.tag-chip.selected { background: var(--lake); color: #fff; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; font-size: .88rem; }
.bar-track { flex: 1; height: 8px; background: rgba(74,109,140,.12); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--lake), var(--kbt-blue)); border-radius: 999px; }
.star-rating { display: flex; gap: .35rem; font-size: 1.6rem; }
.star-rating button { background: none; border: none; cursor: pointer; opacity: .35; padding: 0; }
.star-rating button.on { opacity: 1; color: var(--saffron); }
.login-logo { max-width: 140px; max-height: 140px; width: 140px; height: 140px; object-fit: contain; margin: 0 auto 1rem; display: block; background: #fff; padding: 6px; border-radius: 50%; box-shadow: 0 0 0 4px #0033cc, 0 0 0 7px #e11d2e; }
.login-veloz { text-align: center; margin-top: 1.5rem; font-size: .78rem; color: rgba(255,255,255,.65); }
.login-veloz a { color: rgba(255,255,255,.85); }

@media (max-width: 960px) {
  .mobile-only { display: inline-flex; }
  .btn-icon.mobile-only { display: inline-flex; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: min(var(--sidebar), 86vw);
    transform: translateX(-105%); transition: transform .25s ease;
    height: 100dvh; max-height: 100dvh; overflow-y: auto;
    padding-top: max(1.4rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  .nav { flex-direction: column; }
  .nav-link { min-height: 44px; display: flex; align-items: center; }
  .topbar {
    padding: .85rem 1rem;
    padding-top: max(.85rem, env(safe-area-inset-top, 0px));
    gap: .65rem; position: sticky; top: 0; z-index: 30;
    background: rgba(244,248,247,.92); backdrop-filter: blur(10px);
  }
  .page-title { font-size: 1.4rem; line-height: 1.2; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content {
    padding: .5rem 1rem 2.5rem;
    padding-bottom: max(2.5rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
  }
  .stats { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-value { font-size: 1.65rem; }
  .report-grid { grid-template-columns: 1fr; }
  .split, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .modal {
    width: 100%; max-height: min(92dvh, 100%);
    border-radius: 18px 18px 0 0; align-self: flex-end;
    padding: 1.1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .modal.wide { width: 100%; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1; min-height: 44px; text-align: center; }
  .toast-host {
    left: 1rem; right: 1rem; top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
  .toast { min-width: 0; width: 100%; }
  table.data { font-size: .85rem; }
  table.data th, table.data td { padding: .65rem .5rem; }
  .kv { grid-template-columns: 1fr; }
  .toolbar { gap: .5rem; }
  .toolbar .btn, .toolbar .btn-sm { min-height: 40px; }
  .panel { padding: 1rem; }
  .brand-name { font-size: 1.25rem; }
  .login-card { padding: 1.5rem 1.15rem; border-radius: 22px; }
  .login-card h1 { font-size: clamp(1.45rem, 6vw, 2rem); }
  .login-logo { width: 112px; height: 112px; max-width: 112px; max-height: 112px; }
  .day-card .toolbar { align-items: flex-start; }
  .day-card h3 { font-size: .98rem; line-height: 1.3; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
  .catalog-pkg-head { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .notif-panel {
    left: 12px; right: 12px; width: auto;
    top: max(56px, calc(env(safe-area-inset-top, 0px) + 48px));
  }
  .veloz-footer { font-size: .72rem; padding: .75rem .75rem 1.5rem; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .spacer { display: none; }
  .toolbar .btn, .toolbar a.btn { width: 100%; text-align: center; justify-content: center; }
  .topbar-actions { gap: .35rem; }
  .btn-sm { padding: .5rem .85rem; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .dash-quicklinks { grid-template-columns: repeat(2, 1fr); }
  .dash-mini-stats { grid-template-columns: 1fr 1fr; }
  .dash-hero { padding: 1rem; }
  .dash-hero-title { font-size: 1.15rem; }
  .kanban-col { flex: 0 0 85vw; min-width: 85vw; }
  .act-row, .form-row { display: grid !important; grid-template-columns: 1fr !important; gap: .45rem; }
  .pricing-staff .grid-3 { grid-template-columns: 1fr; }
  .day-cost-chip { display: block; }
}

/* Touch devices: larger hit areas, less hover-dependent affordances */
@media (hover: none) and (pointer: coarse) {
  .btn, .tab, .nav-link, .catalog-card { min-height: 44px; }
  .btn:hover, .catalog-card:hover, .dash-qlink:hover { transform: none; }
  .day-card--draggable { cursor: grab; }
  .input, .select, .textarea { padding: .8rem .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Features 200 dashboard */
.features-summary .stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.features-summary .stat { background: var(--card); padding: .75rem 1.25rem; border-radius: 12px; min-width: 100px; }
.features-summary .stat strong { display: block; font-size: 1.5rem; }
.features-summary .stat-ok strong { color: var(--ok); }
.features-summary .stat-warn strong { color: var(--saffron); }
.features-filters { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.features-filters .btn.active { background: var(--pine); color: #fff; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .65rem; }
.feature-card { background: var(--card); border-radius: 12px; padding: .75rem; border: 1px solid var(--line); display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; }
.feature-card.ok { border-left: 3px solid var(--ok); }
.feature-card.fail { border-left: 3px solid var(--danger); }
.feature-card .feature-id { font-size: .75rem; color: var(--muted); }

/* Dashboard pipeline + kanban */
.dash-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1.25rem 1.4rem; }
.dash-hero-title { margin: 0; font-family: var(--display); font-size: 1.35rem; color: var(--pine-deep); }
.dash-hero-sub { margin: .35rem 0 0; color: var(--muted); font-size: .92rem; max-width: 42rem; }
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.dash-quicklinks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.dash-qlink {
  display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .85rem .5rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: center;
  font-size: .82rem; font-weight: 600; color: var(--pine); transition: transform .15s, box-shadow .15s;
}
.dash-qlink:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--lake); }
.dash-qicon { font-size: 1.25rem; line-height: 1; }

.dash-visual { margin-bottom: 1rem; padding: 1.1rem 1.25rem; }
.dash-visual-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .85rem; }
.dash-bars { display: grid; gap: .45rem; margin-bottom: 1rem; }
.dash-bar-row { display: grid; grid-template-columns: 110px 1fr 28px; gap: .6rem; align-items: center; font-size: .82rem; }
.dash-bar-label { color: var(--muted); }
.dash-bar-track { height: 8px; background: rgba(20,53,44,.08); border-radius: 99px; overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.dash-bar-count { font-weight: 700; text-align: right; color: var(--pine); }
.dash-mini-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .65rem; }
.dash-mini-stat {
  display: block; padding: .75rem; border-radius: 12px; background: rgba(255,255,255,.55);
  border: 1px solid var(--line); text-align: center;
}
.dash-mini-stat:hover { background: #fff; }
.dash-mini-val { display: block; font-family: var(--display); font-size: 1.5rem; color: var(--pine); }
.dash-mini-label { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; text-transform: uppercase; letter-spacing: .06em; }

.dash-kanban-wrap { overflow: hidden; }
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; min-height: 320px; align-items: flex-start; }
.kanban-col { flex: 0 0 240px; min-width: 240px; background: rgba(255,255,255,.45); border: 1px solid var(--line); border-radius: 14px; }
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: center; padding: .65rem .75rem;
  border-bottom: 3px solid var(--stage-color, var(--lake)); border-radius: 14px 14px 0 0;
  background: rgba(255,255,255,.7);
}
.kanban-col-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pine); }
.kanban-col-count { font-size: .75rem; background: var(--pine); color: #fff; border-radius: 99px; padding: .1rem .45rem; min-width: 1.4rem; text-align: center; }
.kanban-col-body { padding: .55rem; display: grid; gap: .5rem; max-height: 480px; overflow-y: auto; min-height: 72px; transition: background .15s, box-shadow .15s; }
.kanban-col-body.is-drag-over {
  background: rgba(74,109,140,.12);
  box-shadow: inset 0 0 0 2px rgba(74,109,140,.35);
  border-radius: 10px;
}
.kanban-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(12,34,28,.06); display: grid; grid-template-columns: auto 1fr;
  align-items: stretch; transition: opacity .15s, transform .15s;
}
.kanban-card.is-dragging { opacity: .45; transform: scale(.98); }
.kanban-drag-handle {
  display: flex; align-items: center; justify-content: center; width: 28px; cursor: grab;
  color: var(--muted); font-size: 1rem; user-select: none; touch-action: none;
  border-right: 1px solid var(--line); background: rgba(20,53,44,.03);
}
.kanban-drag-handle:active { cursor: grabbing; color: var(--lake); }
.kanban-card-link { display: block; padding: .65rem .7rem; color: inherit; min-width: 0; }
.kanban-card-link:hover { background: rgba(74,109,140,.06); }
.kanban-card-name { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.kanban-card-sub { font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.kanban-card-meta { font-size: .72rem; color: var(--lake); margin-top: .35rem; line-height: 1.35; }
.kanban-empty {
  text-align: center; color: var(--muted); font-size: .82rem; padding: 1.25rem .5rem;
  border: 2px dashed rgba(20,53,44,.12); border-radius: 10px;
}

.journey-stepper { display: flex; flex-wrap: wrap; gap: .35rem 0; margin-top: .5rem; }
.journey-step { display: flex; align-items: center; gap: .35rem; flex: 1 1 auto; min-width: 80px; font-size: .72rem; color: var(--muted); position: relative; padding-right: .5rem; }
.journey-step:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 50%; width: 12px; height: 2px; background: var(--line); transform: translateY(-50%); }
.journey-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.journey-step.done .journey-dot { background: var(--ok); }
.journey-step.active .journey-dot { background: var(--lake); box-shadow: 0 0 0 3px rgba(74,109,140,.25); }
.journey-step.active .journey-label { color: var(--pine); font-weight: 700; }
.cust-journey-panel { margin-bottom: 1rem; }

/* Catalog (hotels / cabs / destinations) */
.catalog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem;
}
.catalog-workspace {
  display: flex; flex-direction: column; gap: 1rem;
}
.catalog-workspace.has-detail {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
}
.catalog-workspace.has-detail .catalog-grid {
  margin-bottom: 0;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  grid-template-columns: 1fr;
  position: sticky;
  top: .75rem;
  padding-right: .15rem;
}
.catalog-workspace.has-detail .catalog-card-media { height: 90px; }
.catalog-workspace.has-detail .catalog-detail {
  margin-top: 0;
  animation: catalogExpand .28s ease;
  scroll-margin-top: 1rem;
}
@keyframes catalogExpand {
  from { opacity: .35; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 960px) {
  .catalog-workspace.has-detail {
    grid-template-columns: 1fr;
  }
  .catalog-workspace.has-detail .catalog-detail { order: -1; }
  .catalog-workspace.has-detail .catalog-grid {
    max-height: none;
    position: static;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
.catalog-card {
  appearance: none; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  padding: 0; overflow: hidden; text-align: left; cursor: pointer; color: inherit; font: inherit;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.catalog-card:hover { transform: translateY(-2px); }
.catalog-card.active { outline: 2px solid var(--lake); }
.catalog-card-media {
  height: 120px; background: linear-gradient(135deg, rgba(26,51,68,.2), rgba(200,151,58,.2));
  background-size: cover; background-position: center;
}
.catalog-card-body { padding: .85rem 1rem 1rem; }
.catalog-card-meta { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.catalog-detail { margin-top: .5rem; }
.catalog-photos { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; }
.catalog-photos img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.catalog-upload-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .35rem 0 .75rem; }
.catalog-photo-tile {
  position: relative; width: 112px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: #fff;
}
.catalog-photo-tile.is-cover { border-color: var(--pine); box-shadow: 0 0 0 2px rgba(74,109,140,.25); }
.catalog-photo-tile img { display: block; width: 112px; height: 84px; object-fit: cover; border: 0; border-radius: 0; }
.catalog-photo-badge {
  position: absolute; top: 4px; left: 4px; font-size: .65rem; font-weight: 700;
  background: var(--pine); color: #fff; padding: .15rem .4rem; border-radius: 6px;
}
.catalog-photo-actions {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: rgba(255,255,255,.95);
  border-top: 1px solid var(--line);
}
.catalog-photo-actions .btn-xs { padding: .15rem .35rem; font-size: .68rem; min-height: 0; line-height: 1.2; }
.catalog-photos.empty-gallery { min-height: 48px; align-items: center; }
.guide-photo-strip { display: flex; gap: .45rem; overflow-x: auto; padding: .35rem 0 .6rem; -webkit-overflow-scrolling: touch; }
.guide-photo-strip img {
  flex: 0 0 auto; width: 120px; height: 80px; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
}
.catalog-pkg-list { display: grid; gap: .85rem; }
.catalog-pkg {
  border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; background: rgba(255,255,255,.6);
}
.catalog-pkg.inactive { opacity: .55; }
.catalog-pkg-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.catalog-pkg-rate { font-weight: 700; color: var(--pine); white-space: nowrap; }
.catalog-incl {
  white-space: pre-wrap; font: inherit; font-size: .85rem; background: #f4f7f6; padding: .55rem .7rem;
  border-radius: 8px; margin: .35rem 0;
}
.catalog-facilities { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .35rem; }
.catalog-facility {
  display: inline-block; font-size: .78rem; font-weight: 600; padding: .3rem .65rem;
  border-radius: 999px; background: rgba(74,109,140,.12); color: var(--pine); border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .dash-quicklinks { grid-template-columns: repeat(3, 1fr); }
  .dash-mini-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .dash-quicklinks { grid-template-columns: repeat(2, 1fr); }
  .dash-mini-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-bar-row { grid-template-columns: 90px 1fr 24px; }
}

/* Dark mode (Ctrl+Shift+D) */
html[data-theme="dark"] {
  --ink: #e8eef0;
  --muted: #9ab0a8;
  --line: rgba(255,255,255,.08);
  --card: rgba(20, 40, 50, 0.92);
  --snow: #0f2230;
}
html[data-theme="dark"] body {
  background: linear-gradient(165deg, #0f2230 0%, #1a3344 50%, #152028 100%);
  color: var(--ink);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] table.data { color: var(--ink); }
html[data-density="compact"] table.data th,
html[data-density="compact"] table.data td { padding: .4rem .5rem; font-size: .82rem; }

/* CRM / Guide install banner — once per IP */
.pwa-install-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.pwa-install-banner.is-visible { transform: translateY(0); pointer-events: auto; }
.pwa-install-card {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  max-width: 520px; margin: 0 auto;
  background: #0a3a42; color: #eef6f3;
  border-radius: 18px; padding: .85rem 1rem;
  box-shadow: 0 16px 40px rgba(6, 30, 34, .45);
  border: 1px solid rgba(255,255,255,.12);
}
.pwa-install-icon {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  background: #fff; flex-shrink: 0;
}
.pwa-install-copy { flex: 1; min-width: 140px; }
.pwa-install-copy strong { display: block; font-size: .95rem; margin-bottom: .15rem; }
.pwa-install-hint { margin: 0; font-size: .78rem; line-height: 1.35; opacity: .88; }
.pwa-install-actions { display: flex; gap: .4rem; align-items: center; margin-left: auto; }
.pwa-install-btn {
  appearance: none; border: none; border-radius: 999px;
  padding: .55rem .95rem; font: inherit; font-weight: 700; font-size: .85rem;
  background: linear-gradient(135deg, #c8973a, #b8842f); color: #fff; cursor: pointer;
}
.pwa-install-dismiss {
  appearance: none; border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  padding: .5rem .75rem; font: inherit; font-size: .78rem;
  background: transparent; color: #cfe3df; cursor: pointer;
}
