/* Pando design system — ported from the Pando.dc.html prototype's inline tokens. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #fdf6ef;
  color: #4a3f38;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 14px;
}
input, select, textarea, button { font-family: inherit; }
::placeholder { color: #b7a496; }
a { color: #e2684f; text-decoration: none; }
a:hover { color: #c9532e; }
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; }

.pando-app { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }

/* --- Top nav --- */
.pando-nav {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 26px; background: #fff;
  box-shadow: 0 2px 12px rgba(120,80,50,0.06);
  flex-wrap: wrap; position: sticky; top: 0; z-index: 30;
}
.pando-nav .brand { display: flex; align-items: center; gap: 10px; }
.pando-nav .brand span { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.pando-pills { display: flex; gap: 4px; background: #fdf6ef; border-radius: 999px; padding: 4px; flex-wrap: wrap; }
.pando-pill {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; cursor: pointer; color: #a08d80; white-space: nowrap;
}
.pando-pill.active {
  font-weight: 800; background: #f0806a; color: #fff;
  box-shadow: 0 4px 12px rgba(240,128,106,0.3);
}
.pando-pill .badge {
  background: #e2684f; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px;
  min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.pando-spacer { flex: 1; }
.pando-nav-search {
  width: 230px; padding: 10px 18px; font-size: 13.5px; border: none; border-radius: 999px;
  background: #fdf6ef; color: #4a3f38;
}
@media (max-width: 760px) {
  .nav-search-form { display: none; }
}
.pando-nav-right { display: flex; align-items: center; gap: 10px; }
.pando-icon-btn {
  cursor: pointer; color: #a08d80; padding: 7px; border-radius: 999px; display: flex; border: none; background: none;
}
.pando-icon-btn:hover { background: #fdf6ef; color: #4a3f38; }
.pando-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0;
}

/* --- Main --- */
.pando-main { flex: 1; min-width: 0; }
.pando-page { padding: 30px 34px 60px; max-width: 1160px; margin: 0 auto; }
.pando-page.wide { max-width: 1220px; }
.pando-page.narrow { max-width: 1000px; }
.pando-page.settings-page { max-width: 1080px; }

.pando-card {
  background: #fff; border-radius: 20px; box-shadow: 0 6px 20px rgba(120,80,50,0.07);
}

/* --- Buttons --- */
.btn {
  border: none; border-radius: 999px; cursor: pointer; font-weight: 700; font-family: inherit;
}
.btn-primary {
  background: #f0806a; color: #fff; font-weight: 800; padding: 12px 24px; font-size: 14px;
  box-shadow: 0 6px 16px rgba(240,128,106,0.35);
}
.btn-primary:hover { background: #e2684f; }
.btn-primary.small { padding: 8px 16px; font-size: 13px; box-shadow: none; }
.btn-outline {
  padding: 11px 18px; font-size: 14px; font-weight: 700; border: 1.5px solid #eadfd3;
  background: #fff; color: #4a3f38; border-radius: 999px; cursor: pointer;
}
.btn-outline:hover { border-color: #d8c8b8; }
.btn-outline.small { padding: 8px 14px; font-size: 12.5px; }
.btn-danger-outline {
  padding: 9px 16px; font-size: 13.5px; font-weight: 700; border: 1.5px solid #f0d5cb;
  background: #fff; color: #b3543c; border-radius: 999px; cursor: pointer;
}
.btn-danger-outline:hover { background: #fdf1ee; }
.btn-danger-filled {
  padding: 9px 16px; font-size: 13px; font-weight: 700; border: 1.5px solid #f0d5cb;
  color: #FAFAFA; border-radius: 999px; cursor: pointer; background-color: #B3543C;
}
.btn-danger-solid { padding: 8px 14px; font-size: 13px; font-weight: 700; border: none; background: #c94f35; color: #fff; border-radius: 999px; cursor: pointer; }
.btn-green { padding: 8px 16px; font-size: 13px; font-weight: 800; border: none; background: #7aa874; color: #fff; border-radius: 999px; cursor: pointer; }
.btn-green:hover { background: #699565; }
.btn-ghost { border: none; background: none; color: #a08d80; cursor: pointer; font-size: 12.5px; }
.btn-chip { padding: 7px 12px; font-size: 12.5px; font-weight: 700; border: 1.5px solid #eadfd3; background: #fff; border-radius: 999px; cursor: pointer; }

/* --- Chips --- */
.chip {
  padding: 8px 15px; font-size: 13px; font-weight: 700; border-radius: 999px; cursor: pointer;
  border: 1.5px solid #eadfd3; background: #fff; color: #8d7c6e; display: inline-block;
}
.chip.active { border-color: #f0806a; background: #f0806a; color: #fff; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-row .chip-label {
  font-size: 11.5px; font-weight: 800; color: #a08d80; text-transform: uppercase;
  letter-spacing: 0.03em; margin-right: 4px; width: 60px;
}
.status-chip { font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #a08d80; }
.field input, .field select, .field textarea {
  padding: 11px 15px; font-size: 14.5px; border: 1.5px solid #eadfd3; border-radius: 12px; color: #4a3f38; background: #fff;
}
.field textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .col-span { grid-column: 1/3; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-span { grid-column: auto; }
}

/* --- Tiles (dashboard) --- */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
@media (max-width: 760px) { .tile-grid { grid-template-columns: 1fr; } }
.tile { border-radius: 22px; padding: 22px; cursor: pointer; }
.tile.light { background: #fff; box-shadow: 0 6px 20px rgba(120,80,50,0.07); }
.tile.light:hover { box-shadow: 0 10px 26px rgba(120,80,50,0.13); }
.tile.dark { background: #4a3f38; color: #fdf6ef; }
.tile.dark:hover { box-shadow: 0 10px 26px rgba(74,63,56,0.35); }
.tile .num { font-size: 34px; font-weight: 800; }
.tile .label { font-size: 14.5px; font-weight: 800; margin-top: 2px; }
.tile .preview { font-size: 12.5px; margin-top: 6px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .cta { margin-top: 14px; font-size: 13px; font-weight: 800; }
.tile-bars { display: flex; gap: 5px; margin-top: 12px; align-items: flex-end; height: 34px; }
.tile-bars > div { flex: 1; border-radius: 6px 6px 0 0; }

/* --- Table / list rows --- */
.list-row {
  display: flex; align-items: center; gap: 0; padding: 14px 22px; border-bottom: 1px solid #f7ede2;
  cursor: pointer; font-size: 14px;
}
.list-row:hover { background: #fdf9f4; }
.list-row:last-child { border-bottom: none; }
.table-head {
  display: flex; padding: 12px 22px; background: #fdf9f4; border-bottom: 1px solid #f2e7da;
  font-size: 12px; font-weight: 800; color: #a08d80; text-transform: uppercase; letter-spacing: 0.04em;
}
.table-head > div { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px; }
.table-head > div:hover { color: #4a3f38; }
@media (max-width: 760px) {
  .list-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .table-head { display: none; }
}

/* --- Phase funnel --- */
.phase-funnel { background: #fff; border-radius: 16px; box-shadow: 0 4px 14px rgba(120,80,50,0.07); padding: 14px 18px 12px; }
.phase-funnel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: #a08d80; margin-bottom: 10px; flex-wrap: wrap; }
.phase-funnel-head .title { font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.phase-segments { display: flex; gap: 4px; align-items: flex-end; }
.phase-seg { flex: 1; text-align: center; cursor: pointer; position: relative; min-width: 0; }
.phase-seg .count { font-size: 11.5px; font-weight: 800; margin-bottom: 4px; }
.phase-seg .bar { height: 9px; border-radius: 6px; transition: height .12s; background: #f2e7da; }
.phase-seg .bar.active { height: 14px; }
.phase-seg .plabel { font-size: 10.5px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #b7a496; }
.phase-seg .plabel.active { font-weight: 800; color: #4a3f38; }
.phase-tip {
  position: absolute; top: 100%; margin-top: 2px; z-index: 20; background: #fff; border: 1px solid #f2e7da;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(120,80,50,0.18); padding: 8px; min-width: 200px; display: none;
  text-align: left;
}
.phase-seg:hover .phase-tip { display: block; }
.phase-tip-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #b7a496; padding: 2px 10px 6px; }
.phase-tip-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; color: #4a3f38;
}
.phase-tip-row:hover, .phase-tip-row.selected { background: #fdf0e8; }
.phase-tip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.phase-tip-count { color: #b7a496; font-weight: 700; margin-left: auto; }

/* --- Client card --- */
.client-layout { display: flex; flex-direction: row-reverse; gap: 16px; align-items: flex-start; }
@media (max-width: 760px) { .client-layout { flex-direction: column; } }
.client-main { flex: 1; min-width: 0; }
.client-rail { width: 76px; flex-shrink: 0; position: sticky; top: 70px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 760px) { .client-rail { flex-direction: row; width: 100%; position: static; flex-wrap: wrap; } }
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px;
  border-radius: 14px; cursor: pointer; font-size: 11px; font-weight: 700; color: #a08d80;
  background: #fff; box-shadow: 0 4px 14px rgba(120,80,50,0.06); border: none; position: relative;
}
.rail-btn.active { background: #4a3f38; color: #fff; }
.rail-btn .rail-badge {
  position: absolute; top: 2px; right: 6px; background: #e2684f; color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 999px; min-width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.back-link { font-size: 13.5px; font-weight: 700; color: #a08d80; cursor: pointer; margin-bottom: 16px; display: inline-block; }
.back-link:hover { color: #4a3f38; }

.proc-bar { padding: 16px 22px; margin-bottom: 16px; }
.proc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.proc-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.proc-product-chip { font-size: 11.5px; font-weight: 800; padding: 3px 12px; border-radius: 999px; background: #fdf6ef; color: #8d7c6e; }
.proc-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.proc-pill { font-size: 16px; font-weight: 800; }
.proc-counter { font-size: 12.5px; font-weight: 800; padding: 3px 12px; border-radius: 999px; }
.proc-right { font-size: 12.5px; color: #a08d80; text-align: right; }
.proc-segments { display: flex; align-items: center; gap: 3px; }
.proc-segments > div { flex: 1; border-radius: 6px; transition: all .15s; }

.overview-card { padding: 22px 26px; margin-bottom: 20px; }
.dup-banner {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; margin-top: 16px;
  background: #fbeadd; border-radius: 14px; font-size: 12.5px; color: #96551c; line-height: 1.5;
}
.dup-banner a { color: #96551c; font-weight: 800; text-decoration: underline; }
.dup-banner a:hover { color: #6e3d12; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 16px 44px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #f7ede2; }
.contact-grid .lbl { color: #a08d80; font-size: 12px; margin-bottom: 3px; }
.contact-grid .val { font-weight: 800; font-size: 14px; }
.more-toggle { margin-top: 12px; font-size: 12.5px; font-weight: 800; color: #e2684f; cursor: pointer; display: inline-block; }
.more-toggle:hover { color: #c9532e; }

.focus-strip { padding: 14px 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.tab-card { padding: 20px 24px; }
.tab-card h3 { font-size: 14px; font-weight: 800; margin: 0 0 14px; color: #a08d80; text-transform: uppercase; letter-spacing: 0.03em; }

.mic-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid #eadfd3; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #4a3f38; flex-shrink: 0;
}
.mic-btn.recording { background: #fdf1ee; border-color: #f0806a; color: #c94f35; }

.note-item { padding: 13px 16px; background: #fdf9f4; border-radius: 14px; margin-bottom: 12px; }
.note-item:last-child { margin-bottom: 0; }
.note-type-chip { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

.reminder-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f7ede2; flex-wrap: wrap; }
.reminder-row:last-child { border-bottom: none; }
.reminder-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.reminder-tag { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; display: inline-block; }
@media (max-width: 760px) { .reminder-row { flex-direction: column; align-items: flex-start; } }

.dziennik-row { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid #f7ede2; align-items: baseline; }
.dziennik-row:last-child { border-bottom: none; }
.dziennik-date { width: 64px; flex-shrink: 0; font-size: 12.5px; color: #a08d80; }
.dziennik-typ { width: 110px; flex-shrink: 0; }
@media (max-width: 760px) {
  .dziennik-row { flex-wrap: wrap; }
  .dziennik-date, .dziennik-typ { width: auto; }
}
.dz-chip { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }

/* --- Modals --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(74,63,56,0.4); display: none;
  align-items: center; justify-content: center; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; border-radius: 24px; width: 540px; max-width: 92vw; max-height: 90vh; overflow-y: auto; padding: 28px 30px; }
.modal-box.w-360 { width: 360px; }
.modal-box.w-480 { width: 480px; }
.modal-box.w-500 { width: 500px; }
.modal-box.w-560 { width: 560px; }
.modal-box.w-640 { width: 640px; }
.modal-box h2 { font-size: 19px; font-weight: 800; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.op-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 700; border: 1.5px solid #eadfd3; }
.op-item.checked { border-color: #f0806a; background: #fdf1ee; }
.op-box { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #d8c8b8; display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; flex-shrink: 0; }
.op-item.checked .op-box { background: #f0806a; border-color: #f0806a; color: #fff; }
.reminder-box { background: #fdf6ef; border-radius: 16px; padding: 15px 18px; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 26px; right: 26px; background: #4a3f38; color: #fdf6ef; padding: 14px 22px;
  border-radius: 999px; font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(74,63,56,0.3); z-index: 60;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* --- Login / lock --- */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; background: #fdf6ef; min-height: 100vh; }
.auth-card {
  display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 36px 34px 28px;
  background: #fff; border-radius: 24px; box-shadow: 0 12px 40px rgba(120,80,50,0.12); width: 340px; max-width: 92vw;
}
.auth-logo-wrap { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; background: #fdf6ef; display: flex; align-items: center; justify-content: center; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.auth-sub { font-size: 13px; color: #a08d80; margin-top: 2px; }
.auth-error { font-size: 12.5px; font-weight: 700; color: #c94f35; }
.auth-card form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.pin-dots { display: flex; gap: 10px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: #fdf6ef; border: 1.5px solid #eadfd3; }
.pin-dot.filled { background: #f0806a; border: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.keypad button {
  height: 60px; border-radius: 16px; border: 1.5px solid #f2e7da; background: #fff; font-size: 21px;
  font-weight: 700; cursor: pointer; color: #4a3f38;
}
.keypad button:hover { background: #fdf6ef; }
.keypad button.empty { visibility: hidden; }

/* --- Settings --- */
.settings-wrap { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.settings-nav { flex: 0 0 232px; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.settings-nav-tile {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; border-radius: 16px; cursor: pointer;
  background: #fff; box-shadow: 0 4px 14px rgba(120,80,50,0.06); border: 1.5px solid transparent;
}
.settings-nav-tile.active { border-color: #f0806a; }
.settings-nav-tile .t { font-size: 14px; font-weight: 800; color: #4a3f38; }
.settings-nav-tile .s { font-size: 11.5px; font-weight: 600; color: #b7a496; }
.settings-nav-tile.active .s { color: #e2684f; }
.settings-content { flex: 1; min-width: 320px; display: flex; flex-direction: column; gap: 16px; }
.settings-section { padding: 22px 26px; }
.settings-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 16px; color: #a08d80; text-transform: uppercase; letter-spacing: 0.03em; }
.avatar-color-row { display: flex; gap: 6px; }
.avatar-color-dot { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.avatar-color-dot.selected { border-color: #4a3f38; }
.wf-step-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #fdf9f4; border-radius: 12px; margin-bottom: 6px; }
.wf-step-row[draggable="true"] { cursor: grab; }
.wf-step-row.dragging { opacity: 0.45; cursor: grabbing; }
.wf-drag { color: #cbbaa9; font-size: 15px; line-height: 1; cursor: grab; user-select: none; flex-shrink: 0; }
.wf-drag:active { cursor: grabbing; }
.wf-icon-btn:disabled { opacity: 0.3; cursor: default; }
.wf-icon-btn:disabled:hover { background: none; color: #a08d80; }
.wf-step-row .num { width: 22px; font-size: 12px; font-weight: 800; color: #b7a496; }
.wf-step-row .name { flex: 1; font-size: 13.5px; font-weight: 700; }
.wf-step-row .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wf-icon-btn { border: none; background: none; cursor: pointer; color: #a08d80; font-size: 14px; padding: 3px 7px; border-radius: 8px; }
.wf-icon-btn:hover { background: #f2e7da; color: #4a3f38; }
.wf-icon-btn.danger:hover { background: #fdf1ee; color: #c94f35; }
.tag-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; background: #fdf6ef; border-radius: 999px; font-size: 13.5px; font-weight: 700; margin: 0 6px 6px 0; }
.tag-pill .rm { cursor: pointer; color: #a08d80; font-weight: 800; padding: 0 4px; }
.tag-pill .rm:hover { color: #c94f35; }

/* --- Login form (email/password variant) --- */
.pando-login-input {
  padding: 12px 16px; font-size: 14.5px; border: 1.5px solid #eadfd3; border-radius: 12px; color: #4a3f38; width: 100%;
}
