/* ============================================
   MENOUNO Recensioni — app styles
   ============================================ */

.v1-root {
  position: relative;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-ui);
}

/* ---- top bar ---- */
.v1-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  flex-shrink: 0;
}
.v1-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.v1-dot {
  width: 10px; height: 10px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,107,128,0.18);
}
.v1-sub { font-size: 11.5px; letter-spacing: 0.16em; color: var(--ink-3); }
.v1-search {
  position: relative;
  max-width: 520px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
}
.v1-search:focus-within { border-color: var(--coral); color: var(--coral); }
.v1-search-input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--ink-0); font-size: 13px; padding: 10px 0; font-family: inherit;
}
.v1-clear {
  border: 0; background: var(--bg-3); color: var(--ink-1);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.v1-meta {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--coral-soft);
  border: 1px solid var(--coral-line);
  border-radius: var(--r-md);
}
.v1-meta-num { font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--coral); }
.v1-meta-lab { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-1); line-height: 1.15; }

/* ---- chips row ---- */
.v1-chips {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.v1-using {
  margin-left: auto;
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
}
.v1-using-name {
  font-size: 12.5px; color: var(--coral); font-weight: 500;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v1-side-reopen {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 8px; padding: 6px 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--ink-1);
  font-family: inherit; font-size: 12.5px; cursor: pointer;
  transition: all 120ms ease;
}
.v1-side-reopen:hover { background: var(--bg-3); color: var(--ink-0); border-color: var(--line-2); }
.v1-side-reopen-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px; background: var(--coral-soft); color: var(--coral);
  font-size: 10.5px; font-variant-numeric: tabular-nums;
}

/* ---- body ---- */
.v1-body {
  flex: 1; display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 0;
  transition: grid-template-columns 220ms ease;
}
.v1-root.side-collapsed .v1-body { grid-template-columns: 1fr 0; }

/* ---- table ---- */
.v1-table-pane {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  border-right: 1px solid var(--line);
}

.v1-thead, .v1-row {
  display: grid;
  grid-template-columns:
    minmax(160px, 1.5fr)   /* cliente */
    minmax(100px, 0.9fr)   /* contatto */
    minmax(95px,  0.85fr)  /* tatuatore */
    minmax(135px, 1.15fr)  /* soddisfazione */
    minmax(118px, 1fr)     /* richiesta */
    minmax(95px,  0.85fr)  /* modalita */
    minmax(145px, 1.2fr)   /* risultato */
    minmax(80px,  0.7fr)   /* stelle */
    minmax(44px,  0.38fr)  /* foto */
    minmax(116px, 1fr);    /* azione */
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  padding-right: 28px;
}
.v1-thead {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
  background: var(--bg-1); height: 38px; flex-shrink: 0;
}
.v1-tbody { flex: 1; overflow-y: auto; min-height: 0; scrollbar-gutter: stable; }
.v1-row {
  height: 56px; border-bottom: 1px solid var(--line);
  transition: background 100ms ease; font-size: 13px;
}
.v1-row:hover { background: var(--bg-1); }

.v1-col.cliente { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v1-name-stack { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.v1-name { font-weight: 500; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v1-sub-line { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.v1-col.richiesta { display: flex; flex-direction: column; gap: 3px; }
.v1-mini { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Risultato select */
.risultato-select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--ink-1);
  font-family: inherit;
  font-size: 11.5px;
  padding: 5px 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 120ms ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'%3E%3Cpath d='m9 6 6 6-6 6' fill='none' stroke='%235a5a62' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
}
.risultato-select:focus { border-color: var(--coral); }
.risultato-select option { background: var(--bg-3); }

/* Risultato colored options via data-value class */
.risultato-lasciata { color: var(--ok); }
.risultato-nessuna  { color: var(--no); }
.risultato-rifiutata{ color: var(--bad); }
.risultato-attesa   { color: var(--warn); }

/* Send button */
.v1-send {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid; font-family: inherit;
  transition: all 120ms ease; white-space: nowrap;
}
.v1-send.wa   { background: var(--wa-soft);   color: var(--wa);   border-color: rgba(37,211,102,0.3); }
.v1-send.mail { background: var(--mail-soft); color: var(--mail); border-color: rgba(106,169,255,0.3); }
.v1-send.call { background: var(--call-soft); color: var(--call); border-color: rgba(245,177,74,0.3); }
.v1-send:hover { filter: brightness(1.15); transform: translateY(-1px); }
.v1-send.soft { opacity: 0.5; }
.v1-send.soft:hover { opacity: 1; }

/* Sticky azione column */
.v1-col.azione {
  position: sticky; right: 0;
  justify-self: end; align-self: stretch;
  display: flex; align-items: center; justify-content: flex-end;
  padding-left: 22px; margin-right: -10px; padding-right: 10px;
  background: linear-gradient(to right, transparent 0, var(--bg-0) 22px, var(--bg-0) 100%);
  z-index: 1;
}
.v1-row:hover .v1-col.azione {
  background: linear-gradient(to right, transparent 0, var(--bg-1) 22px, var(--bg-1) 100%);
}
.v1-thead .v1-col.azione {
  position: sticky; right: 0;
  background: var(--bg-1); z-index: 2;
  text-align: right; justify-content: flex-end;
  padding-left: 22px;
}

.v1-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3); background: var(--bg-1);
  flex-shrink: 0;
}
.v1-tip { color: var(--ink-2); }
.v1-empty { padding: 60px 24px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---- sidebar ---- */
.v1-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-1); overflow: hidden; }
.v1-side-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.v1-side-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.04em; margin-top: 4px; line-height: 1; }
.v1-msglist {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.v1-msg {
  position: relative; padding: 14px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--line);
  cursor: pointer; transition: all 120ms ease;
}
.v1-msg:hover { border-color: var(--line-2); background: var(--bg-3); }
.v1-msg.active { border-color: var(--coral); background: var(--coral-soft); }
.v1-msg-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 8px;
}
.v1-msg-title { font-size: 13px; font-weight: 500; color: var(--ink-0); flex: 1; min-width: 0; }
.v1-msg-preview {
  font-size: 11.5px; color: var(--ink-2); line-height: 1.5;
  white-space: pre-line; display: -webkit-box;
  -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.v1-msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 120ms ease; flex-shrink: 0; }
.v1-msg:hover .v1-msg-actions, .v1-msg.active .v1-msg-actions { opacity: 1; }
.v1-msg-active-mark {
  position: absolute; top: -7px; right: 10px;
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; background: var(--coral); color: #1a0a0d;
  border-radius: 3px; font-weight: 600;
}

/* Editor */
.v1-editor {
  border-top: 1px solid var(--line); padding: 14px;
  background: var(--bg-0); display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.v1-editor-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-1);
}
.v1-editor-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* Status pill — extra variant */
.pill.nonrichiesta { color: var(--ink-3); background: rgba(90,90,98,0.16); }

/* Skeleton loading rows */
@keyframes sk-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.skeleton-row { pointer-events: none; }
.sk {
  border-radius: var(--r-xs);
  background: var(--bg-3);
  animation: sk-pulse 1.4s ease-in-out infinite;
}
.sk-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.sk-stack  { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.sk-name   { height: 12px; width: 70%; }
.sk-sub    { height: 10px; width: 50%; }
.sk-xs     { height: 12px; width: 24px; }
.sk-sm     { height: 12px; width: 64px; }
.sk-med    { height: 22px; width: 100px; border-radius: var(--r-xs); }
.sk-lg     { height: 28px; width: 100%; border-radius: var(--r-xs); }
.sk-btn    { height: 30px; width: 90px; border-radius: var(--r-sm); }

/* Scrollbar */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 999px; border: 2px solid var(--bg-0); }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--line-2); }
