/* ============================================================
 * QOTT — DESIGN SYSTEM COMPONENTS
 * Utility classes que implementam os componentes do DS.
 * Use tokens.css como fonte das variáveis CSS.
 * ============================================================ */

/* ============================================================
 * TYPOGRAPHY HELPERS
 * ============================================================ */
.qott-num { font-variant-numeric: tabular-nums; }

.qott-eyebrow {
  font-family: var(--qott-font-body);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--qott-ink-55);
}

/* ============================================================
 * BUTTONS — 5 variants × 3 sizes
 * ============================================================ */
.qott-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--qott-font-body);
  font-weight: 600;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition: background var(--qott-dur-fast) var(--qott-ease-out),
              color var(--qott-dur-fast) var(--qott-ease-out),
              filter var(--qott-dur-fast) var(--qott-ease-out),
              box-shadow var(--qott-dur-fast) var(--qott-ease-out),
              transform var(--qott-dur-fast) var(--qott-ease-out);
  user-select: none;
  text-decoration: none;
}
.qott-btn:disabled,
.qott-btn[disabled],
.qott-btn.is-disabled {
  cursor: not-allowed;
  opacity: 1; /* color tokens handle visual */
}
.qott-btn:focus-visible { outline: none; }

/* Sizes */
.qott-btn-sm { height: var(--qott-h-sm); padding: 0 14px; font-size: 13px; border-radius: 10px; }
.qott-btn-md { height: var(--qott-h-md); padding: 0 18px; font-size: 14px; border-radius: 12px; }
.qott-btn-lg { height: var(--qott-h-lg); padding: 0 22px; font-size: 15px; border-radius: 14px; }
.qott-btn-block { width: 100%; }

/* Primary — Ink filled */
.qott-btn-primary {
  background: var(--qott-ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14, 14, 18, 0.2);
}
.qott-btn-primary:hover:not(:disabled) { background: #28282F; }
.qott-btn-primary:active:not(:disabled) { background: #1A1A20; }
.qott-btn-primary:focus-visible { box-shadow: 0 1px 2px rgba(14,14,18,0.2), 0 0 0 3px rgba(254, 65, 115, 0.32); }
.qott-btn-primary:disabled,
.qott-btn-primary.is-disabled { background: var(--qott-ink-25); color: #fff; box-shadow: none; }

/* Hero — Brand gradient (max one per screen) */
.qott-btn-hero {
  background: var(--qott-gradient);
  color: #fff;
  box-shadow: var(--qott-shadow-glow);
}
.qott-btn-hero:hover:not(:disabled) { filter: brightness(1.08); }
.qott-btn-hero:active:not(:disabled) { filter: brightness(0.92); }
.qott-btn-hero:focus-visible { box-shadow: var(--qott-shadow-glow), 0 0 0 3px rgba(254, 65, 115, 0.32); }
.qott-btn-hero:disabled,
.qott-btn-hero.is-disabled { background: var(--qott-ink-25); color: #fff; box-shadow: none; filter: none; }

/* Secondary — White with inset border */
.qott-btn-secondary {
  background: #fff;
  color: var(--qott-ink);
  box-shadow: inset 0 0 0 1px var(--qott-line-mid);
}
.qott-btn-secondary:hover:not(:disabled) { background: var(--qott-cream); }
.qott-btn-secondary:active:not(:disabled) { background: #E5DFD2; }
.qott-btn-secondary:focus-visible { box-shadow: inset 0 0 0 1px var(--qott-line-mid), 0 0 0 3px rgba(14,14,18,0.12); }
.qott-btn-secondary:disabled,
.qott-btn-secondary.is-disabled { color: var(--qott-ink-25); box-shadow: inset 0 0 0 1px var(--qott-line); background: #fff; }

/* Ghost — transparent */
.qott-btn-ghost {
  background: transparent;
  color: var(--qott-ink);
}
.qott-btn-ghost:hover:not(:disabled) { background: rgba(14,14,18,0.06); }
.qott-btn-ghost:active:not(:disabled) { background: rgba(14,14,18,0.10); }
.qott-btn-ghost:focus-visible { box-shadow: 0 0 0 3px rgba(14,14,18,0.12); }
.qott-btn-ghost:disabled,
.qott-btn-ghost.is-disabled { color: var(--qott-ink-25); }

/* Danger — destructive */
.qott-btn-danger {
  background: transparent;
  color: var(--qott-lost-fg);
  box-shadow: inset 0 0 0 1px var(--qott-lost-bg);
}
.qott-btn-danger:hover:not(:disabled) { background: var(--qott-lost-bg); }
.qott-btn-danger:active:not(:disabled) { background: #FFD0D2; }
.qott-btn-danger:focus-visible { box-shadow: inset 0 0 0 1px var(--qott-lost-bg), 0 0 0 3px rgba(180,51,56,0.18); }

/* Trailing chevron rotation when menu open */
.qott-btn .qott-chevron { font-size: 0.85em; opacity: 0.7; transition: transform var(--qott-dur-fast); }
.qott-btn.is-open .qott-chevron { transform: rotate(180deg); }

/* ============================================================
 * INPUTS / FIELDS
 * ============================================================ */
.qott-field { display: flex; flex-direction: column; gap: 6px; }
.qott-label {
  font-family: var(--qott-font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--qott-ink);
}
.qott-label .qott-label-optional {
  font-weight: 400;
  font-size: 11px;
  color: var(--qott-ink-55);
  margin-left: 4px;
}
.qott-hint  { font-size: 12px; color: var(--qott-ink-55); }
.qott-error { font-size: 12px; color: var(--qott-lost-fg); display: flex; align-items: center; gap: 6px; }
.qott-success-msg { font-size: 12px; color: var(--qott-approved-fg); display: flex; align-items: center; gap: 6px; }

.qott-input {
  width: 100%;
  height: var(--qott-h-md-input);
  padding: 0 14px;
  font-family: var(--qott-font-body);
  font-size: 15px;
  color: var(--qott-ink);
  background: var(--qott-white);
  border: 0;
  border-radius: var(--qott-radius-md);
  box-shadow: inset 0 0 0 1px var(--qott-line-mid);
  transition: box-shadow var(--qott-dur-fast) var(--qott-ease-out);
  outline: none;
}
.qott-input::placeholder { color: var(--qott-ink-40); }
.qott-input:hover:not(:disabled):not(:focus) { box-shadow: inset 0 0 0 1px var(--qott-line-strong); }
.qott-input:focus { box-shadow: inset 0 0 0 1.5px var(--qott-ink), 0 0 0 3px rgba(14,14,18,0.10); }
.qott-input.is-filled { box-shadow: inset 0 0 0 1px var(--qott-line-strong); }
.qott-input.is-error { box-shadow: inset 0 0 0 1.5px var(--qott-lost-fg), 0 0 0 3px rgba(180,51,56,0.12); }
.qott-input.is-success { box-shadow: inset 0 0 0 1.5px var(--qott-approved-fg); }
.qott-input:disabled,
.qott-input.is-disabled { background: var(--qott-cream); color: var(--qott-ink-40); box-shadow: inset 0 0 0 1px var(--qott-line); cursor: not-allowed; }

.qott-input-sm { height: var(--qott-h-sm); font-size: 13px; padding: 0 10px; border-radius: 10px; }
.qott-input-lg { height: var(--qott-h-lg-input); }

/* Select: chevron custom + paddings; estados herdam de .qott-input */
select.qott-input {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230E0E12' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  cursor: pointer;
}
select.qott-input::-ms-expand { display: none; }

/* Pill select — usado nos filtros (client/owner/date-field) e na coluna Category do quote.
 * Visual: Cream chip com chevron, sem border, font-weight 500, ink. */
select.qott-pill-select {
  appearance: none; -webkit-appearance: none;
  height: var(--qott-h-sm);
  padding: 0 28px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--qott-cream);
  color: var(--qott-ink);
  font-family: var(--qott-font-body);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230E0E12' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  transition: background var(--qott-dur-fast) var(--qott-ease-out), box-shadow var(--qott-dur-fast);
}
select.qott-pill-select:hover { background-color: #E5DFD2; }
select.qott-pill-select:focus-visible {
  box-shadow: 0 0 0 3px rgba(14,14,18,0.12);
}
select.qott-pill-select::-ms-expand { display: none; }

/* Date input: accent quente do brand + color-scheme automático */
input[type="date"].qott-input,
input[type="datetime-local"].qott-input,
input[type="time"].qott-input,
input[type="month"].qott-input,
input[type="week"].qott-input {
  color-scheme: light;
  accent-color: var(--qott-mango);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
input[type="date"].qott-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(20%) sepia(72%) saturate(2200%) hue-rotate(346deg) brightness(102%) contrast(101%);
  opacity: 0.75;
  transition: opacity var(--qott-dur-fast);
}
input[type="date"].qott-input:hover::-webkit-calendar-picker-indicator { opacity: 1; }
input[type="date"].qott-input::-webkit-datetime-edit { font-variant-numeric: tabular-nums; }

textarea.qott-input { height: auto; min-height: 76px; padding: 12px 14px; line-height: 1.55; resize: vertical; }

/* Input with leading/trailing icons */
.qott-input-wrap { position: relative; display: block; }
.qott-input-wrap .qott-input-icon-leading,
.qott-input-wrap .qott-input-icon-trailing {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--qott-ink-55); font-size: 16px; pointer-events: none;
}
.qott-input-wrap .qott-input-icon-leading { left: 14px; }
.qott-input-wrap .qott-input-icon-trailing { right: 14px; pointer-events: auto; cursor: pointer; }
.qott-input.has-leading { padding-left: 36px; }
.qott-input.has-trailing { padding-right: 36px; }
.qott-input.has-leading.qott-input-sm { padding-left: 32px; }
.qott-input.has-trailing.qott-input-sm { padding-right: 32px; }

/* ============================================================
 * CHECKBOX / RADIO / TOGGLE / SEGMENTED
 * ============================================================ */
.qott-checkbox {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--qott-line-mid);
  cursor: pointer; transition: background var(--qott-dur-fast), box-shadow var(--qott-dur-fast);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qott-checkbox:hover { box-shadow: inset 0 0 0 1.5px var(--qott-line-strong); }
.qott-checkbox:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--qott-line-mid), 0 0 0 3px rgba(14,14,18,0.12); }
.qott-checkbox:checked {
  background: var(--qott-ink);
  box-shadow: inset 0 0 0 1.5px var(--qott-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 8.5 7 12 13 5'/%3E%3C/svg%3E");
  background-size: 12px; background-repeat: no-repeat; background-position: center;
}

.qott-radio {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--qott-line-mid);
  cursor: pointer; transition: box-shadow var(--qott-dur-fast);
  flex-shrink: 0;
}
.qott-radio:checked {
  box-shadow: inset 0 0 0 1.5px var(--qott-ink), inset 0 0 0 5px #fff, inset 0 0 0 9px var(--qott-ink);
}

.qott-toggle {
  appearance: none; -webkit-appearance: none;
  position: relative;
  width: 32px; height: 18px;
  border-radius: 999px;
  background: var(--qott-line-mid);
  cursor: pointer; transition: background var(--qott-dur) var(--qott-ease-out);
  flex-shrink: 0;
}
.qott-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: left var(--qott-dur) var(--qott-ease-out);
}
.qott-toggle:checked { background: var(--qott-ink); }
.qott-toggle:checked::after { left: 16px; }

.qott-segmented {
  display: inline-flex;
  padding: 4px;
  background: var(--qott-cream);
  border-radius: 12px;
  gap: 2px;
}
.qott-segmented > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-family: var(--qott-font-body); font-weight: 600; font-size: 13px;
  color: var(--qott-ink-70);
  background: transparent; border: 0; border-radius: 9px;
  cursor: pointer; transition: background var(--qott-dur-fast), color var(--qott-dur-fast);
}
.qott-segmented > button:hover { color: var(--qott-ink); }
.qott-segmented > button.is-active {
  background: #fff;
  color: var(--qott-ink);
  box-shadow: 0 1px 2px rgba(14,14,18,0.06);
}
.qott-segmented > button[disabled],
.qott-segmented > button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
 * STATUS PILLS / MARKUP BADGE
 * ============================================================ */
.qott-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-family: var(--qott-font-body); font-weight: 600; font-size: 12px;
}
.qott-status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.qott-status-draft    { background: var(--qott-draft-bg);    color: var(--qott-draft-fg); }
.qott-status-draft::before    { background: var(--qott-draft-dot); }
.qott-status-sent     { background: var(--qott-sent-bg);     color: var(--qott-sent-fg); }
.qott-status-sent::before     { background: var(--qott-sent-dot); }
.qott-status-approved { background: var(--qott-approved-bg); color: var(--qott-approved-fg); }
.qott-status-approved::before { background: var(--qott-approved-dot); }
.qott-status-lost     { background: var(--qott-lost-bg);     color: var(--qott-lost-fg); }
.qott-status-lost::before     { background: var(--qott-lost-dot); }

.qott-markup {
  display: inline-block;
  font-family: var(--qott-font-mono); font-weight: 600; font-size: 13px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--qott-approved-bg); color: var(--qott-approved-fg);
}
.qott-markup-warn { background: var(--qott-sent-bg); color: var(--qott-sent-fg); }
.qott-markup-bad  { background: var(--qott-lost-bg); color: var(--qott-lost-fg); }

/* ============================================================
 * AVATAR / TAG
 * ============================================================ */
.qott-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--qott-font-display); font-weight: 700; font-size: 13px;
  color: #fff; user-select: none; flex-shrink: 0;
}
.qott-avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.qott-avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.qott-avatar-mango   { background: var(--qott-mango); }
.qott-avatar-coral   { background: var(--qott-coral); }
.qott-avatar-magenta { background: var(--qott-magenta); }
.qott-avatar-iris    { background: var(--qott-iris); }
.qott-avatar-teal    { background: var(--qott-teal); }

.qott-avatar-stack { display: inline-flex; }
.qott-avatar-stack > .qott-avatar { border: 2px solid #fff; margin-left: -10px; }
.qott-avatar-stack > .qott-avatar:first-child { margin-left: 0; }

.qott-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--qott-cream);
  border-radius: 999px;
  font-family: var(--qott-font-body); font-weight: 500; font-size: 12px;
  color: var(--qott-ink);
}
.qott-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--qott-ink-55);
}

/* ============================================================
 * MODAL SHELL
 * ============================================================ */
.qott-modal-scrim {
  position: fixed; inset: 0;
  background: rgba(14,14,18,0.45);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  animation: qott-modal-scrim-in var(--qott-dur) var(--qott-ease-out);
}
.qott-modal {
  background: var(--qott-white);
  border-radius: var(--qott-radius-2xl);
  box-shadow: var(--qott-shadow-modal);
  width: 100%;
  margin: 0 16px;
  display: flex; flex-direction: column;
  max-height: 90vh;
  animation: qott-modal-in var(--qott-dur) var(--qott-ease-out);
}
.qott-modal-sm { max-width: 400px; }
.qott-modal-md { max-width: 620px; }
.qott-modal-lg { max-width: 720px; }

.qott-modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.qott-modal-title {
  font-family: var(--qott-font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -0.02em; color: var(--qott-ink);
}
.qott-modal-close {
  background: transparent; border: 0; cursor: pointer;
  color: var(--qott-ink-55); font-size: 18px; padding: 4px;
}
.qott-modal-close:hover { color: var(--qott-ink); }

.qott-modal-body {
  padding: 0 24px 4px;
  overflow-y: auto;
  flex: 1;
}

.qott-modal-footer {
  padding: 16px 24px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

@keyframes qott-modal-scrim-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes qott-modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================================
 * CARDS / SURFACES
 * ============================================================ */
.qott-card {
  background: var(--qott-white);
  border-radius: var(--qott-radius-xl);
  box-shadow: 0 0 0 1px var(--qott-line);
  padding: 20px;
}
.qott-card-elevated {
  box-shadow: var(--qott-shadow-sm), 0 0 0 1px var(--qott-line);
}
.qott-card-modal { border-radius: var(--qott-radius-2xl); }

/* Quote card stripe (4px left) */
.qott-quote-card {
  position: relative;
  background: var(--qott-white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--qott-shadow-sm), 0 0 0 1px var(--qott-line);
  overflow: hidden;
}
.qott-quote-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--stripe-color, var(--qott-mango));
}
.qott-stripe-mango   { --stripe-color: var(--qott-mango); }
.qott-stripe-coral   { --stripe-color: var(--qott-coral); }
.qott-stripe-magenta { --stripe-color: var(--qott-magenta); }
.qott-stripe-iris    { --stripe-color: var(--qott-iris); }
.qott-stripe-teal    { --stripe-color: var(--qott-teal); }
.qott-stripe-honey   { --stripe-color: var(--qott-honey); }

/* ============================================================
 * LOGO MARK — QottMark (gradient square + glyph)
 * ============================================================ */
.qott-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--qott-gradient);
  font-family: var(--qott-font-display); font-weight: 800; color: #fff;
  font-size: 18px; line-height: 1;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.qott-mark::before { content: '"'; transform: translateY(2px); }
.qott-mark-sm { width: 24px; height: 24px; border-radius: 6px; font-size: 14px; }
.qott-mark-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 22px; }
.qott-mark-xl { width: 60px; height: 60px; border-radius: 14px; font-size: 36px; }

.qott-wordmark {
  font-family: var(--qott-font-display); font-weight: 800; font-size: 18px;
  letter-spacing: -0.03em; color: var(--qott-ink);
}

/* ============================================================
 * SIDEBAR ROWS (Home space list, Settings nav)
 * ============================================================ */
.qott-sidebar-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--qott-dur-fast);
  color: var(--qott-ink);
  font-family: var(--qott-font-body); font-weight: 600; font-size: 14px;
}
.qott-sidebar-row:hover { background: rgba(14,14,18,0.04); }
.qott-sidebar-row.is-active {
  background: var(--qott-cream);
  box-shadow: inset 0 0 0 1px var(--qott-line);
}
.qott-sidebar-row .qott-count {
  margin-left: auto;
  font-family: var(--qott-font-body); font-weight: 500; font-size: 12px;
  color: var(--qott-ink-55);
}
.qott-square-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  flex-shrink: 0;
}
.qott-sidebar-row .qott-square-icon { /* compat */ }
.qott-sidebar-view-only {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--qott-cream);
  color: var(--qott-ink-55);
  flex-shrink: 0;
  transition: background var(--qott-dur-fast), color var(--qott-dur-fast);
}
.qott-sidebar-view-only:hover { background: var(--qott-paper); color: var(--qott-ink); }

/* ============================================================
 * ROW ACTIONS (item rows: edit/duplicate/delete)
 * ============================================================ */
.qott-row-action {
  background: transparent; border: 0; cursor: pointer;
  padding: 4px 6px; border-radius: 6px;
  color: var(--qott-ink-40);
  transition: background var(--qott-dur-fast), color var(--qott-dur-fast);
}
.qott-row-action:hover { background: var(--qott-cream); color: var(--qott-ink); }
.qott-row-action.duplicate-row:hover { color: var(--qott-teal); }
.qott-row-action.edit-row:hover { color: var(--qott-iris); }
.qott-row-action.delete-row:hover { background: var(--qott-lost-bg); color: var(--qott-lost-fg); }
.qott-row-action.item-detail-btn:hover { color: var(--qott-mango); }
.qott-row-action.visible-toggle:hover { color: var(--qott-magenta); }

/* ============================================================
 * CATEGORY ROW (Config · Categories)
 * ============================================================ */
.qott-category-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--qott-line);
  transition: background var(--qott-dur-fast) var(--qott-ease-out);
}
.qott-category-row:last-child { border-bottom: 0; }
.qott-category-row:hover { background: var(--qott-cream); }
.qott-category-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.qott-category-name {
  flex: 0 1 320px; min-width: 0; max-width: 320px;
  background: transparent; border: 0; outline: none;
  font-family: var(--qott-font-body); font-weight: 600; font-size: 14px;
  color: var(--qott-ink);
  padding: 4px 0;
}
.qott-category-name:focus { box-shadow: inset 0 -1.5px 0 var(--qott-ink); }
.qott-category-row .qott-num { margin-left: auto; }
.qott-category-delete {
  color: var(--qott-ink-25);
  background: transparent; border: 0; cursor: pointer;
  padding: 6px; border-radius: 8px;
  transition: color var(--qott-dur-fast), background var(--qott-dur-fast);
}
.qott-category-row:hover .qott-category-delete { color: var(--qott-ink-40); }
.qott-category-delete:hover { color: var(--qott-lost-fg); background: var(--qott-lost-bg); }

/* ============================================================
 * TRASH ROW
 * ============================================================ */
.qott-trash-row {
  border-bottom: 1px solid var(--qott-line);
  transition: background var(--qott-dur-fast) var(--qott-ease-out);
  border-radius: 8px;
}
.qott-trash-row:hover { background: var(--qott-cream); }
.qott-trash-row:last-child { border-bottom: 0; }

/* ============================================================
 * SPACE PICKER ROW (modal Select Space)
 * ============================================================ */
.qott-space-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--qott-line);
  cursor: pointer;
  transition: background var(--qott-dur-fast) var(--qott-ease-out),
              box-shadow var(--qott-dur-fast) var(--qott-ease-out);
}
.qott-space-pick:hover {
  background: var(--qott-cream);
  box-shadow: inset 0 0 0 1px var(--qott-line-mid);
}

/* ============================================================
 * TOOLTIP (CSS-only via [data-tooltip])
 * ============================================================ */
[data-tooltip] { position: relative; }
/* Portal variant: rendered by tooltip-portal.js (escapes overflow ancestors).
   Suppress the CSS ::after/::before to avoid duplicate visuals. */
[data-tooltip-portal]:hover::after,
[data-tooltip-portal]:hover::before { content: none !important; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--qott-ink); color: #fff;
  padding: 6px 10px; border-radius: 6px;
  font-family: var(--qott-font-body); font-weight: 500; font-size: 11px;
  white-space: nowrap; pointer-events: none;
  box-shadow: var(--qott-shadow-md);
  opacity: 0;
  animation: qott-tooltip-in 0.18s var(--qott-ease-out) 0.4s forwards;
  z-index: 1000;
}
[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--qott-ink);
  opacity: 0;
  animation: qott-tooltip-in 0.18s var(--qott-ease-out) 0.4s forwards;
  pointer-events: none;
  z-index: 1000;
}
/* Right-anchored variant: avoids clipping near container right edge */
[data-tooltip][data-tooltip-align="right"]:hover::after {
  left: auto; right: 0;
  transform: none;
}
[data-tooltip][data-tooltip-align="right"]:hover::before {
  left: auto; right: 8px;
  transform: none;
}
/* Left-anchored variant: avoids clipping near container left edge */
[data-tooltip][data-tooltip-align="left"]:hover::after {
  left: 0; right: auto;
  transform: none;
}
[data-tooltip][data-tooltip-align="left"]:hover::before {
  left: 8px; right: auto;
  transform: none;
}
/* Below-anchored variant: avoids clipping when element is at top of overflow:auto container */
[data-tooltip][data-tooltip-side="bottom"]:hover::after {
  bottom: auto; top: calc(100% + 8px);
}
[data-tooltip][data-tooltip-side="bottom"]:hover::before {
  bottom: auto; top: calc(100% + 4px);
  border-top-color: transparent; border-bottom-color: var(--qott-ink);
}
/* Wrap variant: pra labels longas que quebram em várias linhas */
[data-tooltip][data-tooltip-wrap]:hover::after {
  white-space: normal;
  width: max-content;
  max-width: 240px;  /* estreito → a caixa abraça o texto (sem sobra à direita) */
  text-align: left;
  line-height: 1.4;
  word-break: break-word;
  text-wrap: balance;  /* distribui o texto em linhas de tamanho parecido */
}
/* Tooltip do "Copy to clipboard" no <aside> de ações (w-80, overflow-y-auto):
   mais estreito pra caber no painel sem ser cortado pelo overflow lateral. */
#copy-table-btn[data-tooltip-wrap]:hover::after { max-width: 200px; }
@keyframes qott-tooltip-in { to { opacity: 1; } }

/* ============================================================
 * TOAST
 * ============================================================ */
.qott-toast {
  background: var(--qott-cream);
  color: var(--qott-ink);
  border-radius: var(--qott-radius-md);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--qott-shadow-md);
  max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px;
}
.qott-toast-success { background: var(--qott-approved-bg); color: var(--qott-approved-fg); }
.qott-toast-error   { background: var(--qott-lost-bg);     color: var(--qott-lost-fg); }
.qott-toast-bee {
  background: var(--qott-ink); color: #fff;
}
.qott-toast-bee img { width: 36px; height: 36px; flex-shrink: 0; }

/* ============================================================
 * ADD ITEM MODAL — Tabs Strip + Table (item: handoff redesign)
 * Labor / External Costs como pill segmented control, tabela
 * com ritmo do Labor Catalog (padding 14/16, hover cream-soft)
 * ============================================================ */
.qstrip-tabs {
  display: inline-flex; padding: 3px;
  background: var(--qott-cream); border-radius: 999px;
}
.qstrip-tab {
  appearance: none; border: 0; padding: 8px 16px;
  background: transparent; cursor: pointer;
  font-family: var(--qott-font-body); font-size: 13.5px; font-weight: 600;
  color: var(--qott-ink-70); border-radius: 999px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .12s, color .12s;
}
.qstrip-tab.is-active {
  background: #fff; color: var(--qott-ink);
  box-shadow: 0 1px 2px rgba(14,14,18,.08);
}
.qstrip-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 999px;
  font-family: var(--qott-font-display); font-weight: 700; font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: rgba(14,14,18,.12); color: var(--qott-ink-70);
  transition: background .12s, color .12s;
}
.qstrip-tab.is-active .qstrip-count {
  background: var(--qott-ink); color: #fff;
}
.qstrip-subtotal {
  font-family: var(--qott-font-display); font-weight: 600; font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--qott-ink-40);
  transition: color .12s;
}
.qstrip-tab.is-active .qstrip-subtotal {
  color: var(--qott-teal);
}

.qstrip-panel { padding: 0; padding-bottom: 240px; }
.qstrip-panel.hidden { display: none; }

.qstrip-table { display: flex; flex-direction: column; }
.qstrip-thead {
  display: flex; align-items: center;
  padding: 14px 28px 12px;
  border-bottom: 1px solid var(--qott-line);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.qstrip-th {
  font-family: var(--qott-font-body); font-weight: 600; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--qott-ink-55);
}
.qstrip-th.text-right { text-align: right; }

.qstrip-tbody { display: flex; flex-direction: column; }
.qstrip-row {
  display: flex; align-items: center;
  padding: 12px 28px;
  border-bottom: 1px solid var(--qott-line);
  transition: background var(--qott-dur-fast);
}
.qstrip-row:last-child { border-bottom: 0; }
.qstrip-row:hover { background: #F8F4EC; }

.qstrip-row .qstrip-cell { padding: 0 8px; }
.qstrip-row .qstrip-cell:first-child { padding-left: 0; }
.qstrip-row .qstrip-cell:last-child { padding-right: 0; }

/* Input editável dentro da linha (cell-input) */
.qstrip-cell-input {
  width: 100%; appearance: none; border: 0; outline: none;
  background: transparent;
  padding: 6px 10px; border-radius: 8px;
  font-family: var(--qott-font-body); font-size: 14px; font-weight: 500;
  color: var(--qott-ink);
  transition: background .12s, box-shadow .12s;
}
.qstrip-cell-input.num {
  font-family: var(--qott-font-display); font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.qstrip-cell-input:hover { background: rgba(14,14,18,.03); }
.qstrip-cell-input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--qott-line-mid), 0 0 0 3px rgba(14,14,18,.06);
}

.qstrip-cell-computed {
  font-family: var(--qott-font-display); font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--qott-ink); text-align: right;
}

/* Profile combobox (Labor) */
.qstrip-profile { position: relative; }
.qstrip-profile-input {
  font-size: 15px; font-weight: 600; font-family: var(--qott-font-display);
  padding-right: 24px; /* room for chevron */
}
.qstrip-profile-chevron {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: var(--qott-ink-40); font-size: 11px; pointer-events: none;
}
.qstrip-profile-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border-radius: 12px;
  box-shadow: 0 18px 40px -10px rgba(14,14,18,.18), 0 0 0 1px var(--qott-line);
  padding: 6px; z-index: 20;
  max-height: 240px; overflow-y: auto;
}
.qstrip-profile-dropdown-header {
  font-family: var(--qott-font-body); font-weight: 600; font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--qott-ink-55);
  padding: 6px 10px 4px;
}
.qstrip-profile-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.qstrip-profile-option:hover,
.qstrip-profile-option.is-active { background: var(--qott-cream); }
.qstrip-profile-option-name {
  font-family: var(--qott-font-display); font-weight: 600; font-size: 14px;
  color: var(--qott-ink);
}
.qstrip-profile-option-rate {
  font-family: var(--qott-font-display); font-weight: 600; font-size: 13px;
  color: var(--qott-ink-70);
}
.qstrip-profile-option-rate .unit {
  color: var(--qott-ink-40); margin-left: 2px;
}

/* Trash button da linha */
.qstrip-trash {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--qott-ink-40);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
}
.qstrip-trash:hover {
  color: var(--qott-magenta);
  background: #FFE0EC;
}

/* Add row button */
.qstrip-add-row {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 28px;
  font-family: var(--qott-font-body); font-weight: 600; font-size: 13.5px;
  color: var(--qott-ink-70);
  transition: background .12s, color .12s;
  width: 100%; justify-content: flex-start;
  border-top: 1px solid var(--qott-line);
}
.qstrip-add-row:hover {
  background: var(--qott-cream); color: var(--qott-ink);
}


/* ============================================================
 * WELCOME LIGHTBOXES — first login (handoff)
 * Modal A (created) e Modal B (joined). Shared shell, modos por
 * classe .is-created / .is-joined no #welcome-modal.
 * ============================================================ */
#welcome-modal .welcome-card {
  width: 520px; max-width: calc(100vw - 32px);
  max-height: 88vh;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(14,14,18,.55), 0 2px 6px rgba(14,14,18,.08);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.welcome-close-btn {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  appearance: none; border: 1px solid rgba(255,255,255,.5);
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.5); color: #fff; cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .15s, background .15s;
}
.welcome-close-btn:hover { background: rgba(255,255,255,.65); transform: translateY(-1px); }

.welcome-hero {
  position: relative; height: 320px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 100%, #A42CC9 0%, transparent 55%),
    linear-gradient(135deg, #FF872A 0%, #FE4173 45%, #EF378F 75%, #A42CC9 100%);
}
.welcome-hero::after {
  /* speckle overlay */
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.10) 1px, transparent 2px),
    radial-gradient(circle at 60% 70%, rgba(255,255,255,.08) 1px, transparent 2px),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.10) 1px, transparent 2px),
    radial-gradient(circle at 30% 80%, rgba(255,255,255,.08) 1px, transparent 2px);
  background-size: 80px 80px, 100px 100px, 70px 70px, 90px 90px;
  mix-blend-mode: overlay;
  opacity: .35;
  pointer-events: none;
}
.welcome-bee {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.welcome-bee img {
  width: 240px; height: 240px; object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.32));
  animation: welcome-bee-float 4.5s ease-in-out infinite;
}
#welcome-modal.is-joined .welcome-bee img {
  width: 220px; height: 220px;
  animation: welcome-bee-float-2 5s ease-in-out infinite;
}

@keyframes welcome-bee-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
@keyframes welcome-bee-float-2 {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-10px) rotate(-2deg); }
}

/* Sparkles (4-pointed stars) */
.welcome-sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.welcome-sparkle {
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  animation: welcome-star-pulse 2.6s ease-in-out infinite;
}
@keyframes welcome-star-pulse {
  0%, 100% { opacity: .25; transform: scale(.7) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1) rotate(45deg); }
}

/* Confetti — só na Modal A */
.welcome-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.welcome-confetti-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: welcome-dot-fall 5s linear infinite;
}
@keyframes welcome-dot-fall {
  0%   { transform: translateY(-30px) rotate(0);     opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(360px) rotate(360deg); opacity: 0; }
}

/* Body */
.welcome-body {
  padding: 28px 36px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.welcome-title {
  font-family: var(--qott-font-display); font-weight: 800; font-size: 36px;
  letter-spacing: -0.035em; color: var(--qott-ink); margin: 0; line-height: 1.05;
}
.welcome-title .gradient-text {
  background: linear-gradient(135deg, #FF872A 0%, #FE4173 38%, #EF378F 66%, #A42CC9 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.welcome-subtitle {
  font-family: var(--qott-font-body); font-size: 15.5px; color: var(--qott-ink-70);
  margin: 0; line-height: 1.45; max-width: 380px;
}
.welcome-subtitle strong { color: var(--qott-ink); font-weight: 600; }

/* Workspace chip (Modal A) */
.welcome-workspace-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; border-radius: 999px;
  background: var(--qott-cream);
}
.welcome-workspace-mark {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(135deg, #FF872A 0%, #FE4173 38%, #EF378F 66%, #A42CC9 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--qott-font-display); font-weight: 700; font-size: 13px;
}
.welcome-workspace-text {
  font-family: var(--qott-font-display); font-weight: 600; font-size: 14px;
  color: var(--qott-ink);
}
.welcome-workspace-tag {
  font-family: var(--qott-font-mono, ui-monospace, monospace); font-size: 11px;
  color: var(--qott-ink-55); margin-left: 6px;
}

/* Inviter card (Modal B) */
.welcome-inviter-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 16px;
  background: #F8F4EC;
  box-shadow: inset 0 0 0 1px var(--qott-line);
}
.welcome-inviter-text { text-align: left; }
.welcome-inviter-lead { font-size: 12px; color: var(--qott-ink-55); }
.welcome-inviter-name {
  font-family: var(--qott-font-display); font-weight: 700; font-size: 15px;
  color: #EF378F;
}

/* Avatar */
.welcome-avatar {
  width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--qott-font-display); font-weight: 700; font-size: 11px;
  border: 2px solid #fff;
}
.welcome-avatar-lg {
  width: 44px; height: 44px; font-size: 16px;
  box-shadow: 0 2px 6px rgba(14,14,18,.18);
}
.welcome-avatar.bg-iris   { background: var(--qott-iris); }
.welcome-avatar.bg-teal   { background: var(--qott-teal); }
.welcome-avatar.bg-coral  { background: var(--qott-coral); }
.welcome-avatar.bg-mango  { background: var(--qott-mango); }
.welcome-avatar.bg-honey  { background: var(--qott-honey); }
.welcome-avatar.bg-cream  { background: var(--qott-cream); color: var(--qott-ink-70); }

/* Team row */
.welcome-team-row {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--qott-font-body); font-size: 13px; color: var(--qott-ink-70);
}
.welcome-team-stack { display: inline-flex; }
.welcome-team-stack .welcome-avatar + .welcome-avatar { margin-left: -8px; }
.welcome-team-count strong { color: var(--qott-ink); font-weight: 600; }

/* CTA */
.welcome-cta {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 14px;
  font-family: var(--qott-font-body); font-weight: 700; font-size: 14.5px;
  color: #fff; transition: filter .15s, transform .15s, box-shadow .15s;
  margin-top: 4px;
}
.welcome-cta i { transition: transform .15s; }
.welcome-cta:hover i { transform: translateX(3px); }
/* Modal A: gradient + glow */
#welcome-modal.is-created .welcome-cta {
  background: linear-gradient(135deg, #FF872A 0%, #FE4173 38%, #EF378F 66%, #A42CC9 100%);
  box-shadow: 0 8px 24px -4px rgba(246,60,131,.45);
}
#welcome-modal.is-created .welcome-cta:hover { filter: brightness(1.05); }
/* Modal B: ink */
#welcome-modal.is-joined .welcome-cta {
  background: var(--qott-ink);
  box-shadow: 0 6px 18px -4px rgba(14,14,18,.3);
}
#welcome-modal.is-joined .welcome-cta:hover { background: #28282F; }

/* Reduced motion: kill float + confetti */
@media (prefers-reduced-motion: reduce) {
  .welcome-bee img { animation: none; }
  .welcome-sparkle, .welcome-confetti-dot { animation: none; }
}
