@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600&family=Playfair+Display:wght@400;700;900&display=swap');

:root {
  --bg: #0a0c0f;
  --surface: #13161b;
  --surface2: #1a1e26;
  --border: #252932;
  --accent: #c9f368;
  --accent2: #68d4f3;
  --accent3: #f368a8;
  --accent4: #f3c068;
  --text: #eef0f4;
  --muted: #6b7280;
  --danger: #f36868;
  --success: #68f3a0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; min-height: 100vh; overflow-x: hidden; }

/* HEADER */
header { padding: 14px 28px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #0a0c0f 60%, #10141c); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.logo h1 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 900; color: var(--text); line-height: 1.1; }
.logo h1 span { color: var(--accent); }
.logo small { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; display: block; margin-top: 4px; }
.hdr-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* STATUS DE SINCRONIZAÇÃO AUTOMÁTICA */
.sync-status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.2s;
}
.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.03);
}
.sync-ok {
  border-color: rgba(104,243,160,0.20);
  color: var(--success);
  background: rgba(104,243,160,0.055);
}
.sync-ok .sync-status-dot { background: var(--success); }
.sync-saving {
  border-color: rgba(243,192,104,0.35);
  color: var(--accent4);
  background: rgba(243,192,104,0.06);
}
.sync-saving .sync-status-dot {
  background: var(--accent4);
  animation: syncPulse 0.9s ease-in-out infinite;
}
.sync-error {
  border-color: rgba(243,104,104,0.45);
  color: var(--danger);
  background: rgba(243,104,104,0.07);
}
.sync-error .sync-status-dot { background: var(--danger); }
.sync-idle .sync-status-dot { background: var(--muted); }
@keyframes syncPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* BARRAS SUPERIORES */
.mesa-tabs-bar { display: flex; gap: 8px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; align-items: center; }
.mesa-tabs-bar::-webkit-scrollbar { display: none; }
.mesa-tab { background: var(--surface2); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; transition: 0.2s; }
.mesa-tab:hover { border-color: var(--muted); }
.mesa-tab.active { background: rgba(201, 243, 104, 0.1); border-color: var(--accent); color: var(--accent); }
.mesa-dot { width: 8px; height: 8px; border-radius: 50%; }
.add-mesa-tab { background: transparent; border: 1px dashed var(--muted); color: var(--muted); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.2s; white-space: nowrap; }
.add-mesa-tab:hover { border-color: var(--text); color: var(--text); }

.periodo-bar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--surface2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.periodo-bar .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.periodo-bar select { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 6px 12px; border-radius: 6px; outline: none; font-family: inherit; font-size: 13px; cursor: pointer; }
.periodo-badge { margin-left: auto; background: rgba(255,255,255,0.03); padding: 6px 12px; border-radius: 20px; font-size: 12px; border: 1px solid var(--border); font-weight: 500; white-space: nowrap; }

/* NAVEGAÇÃO & MAIN */
nav { display: flex; gap: 10px; padding: 14px 28px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); align-items: center; }
nav::-webkit-scrollbar { display: none; }
nav button { background: transparent; border: none; color: var(--muted); font-size: 14px; font-family: inherit; font-weight: 500; cursor: pointer; padding: 8px 12px; border-radius: 8px; transition: 0.2s; white-space: nowrap; }
nav button:hover { color: var(--text); background: var(--surface); }
nav button.active { color: var(--bg); background: var(--accent); font-weight: 600; }

main { position: relative; isolation: isolate; padding: 28px; max-width: 1400px; margin: 0 auto; }
main::before {
  content: '';
  position: absolute;
  left: 50%;
  top: clamp(260px, 38vw, 420px);
  transform: translate(-50%, -50%);
  width: min(64vw, 860px);
  aspect-ratio: 1020 / 480;
  background: url('assets/ff-watermark-logo.png') center/contain no-repeat;
  opacity: 0.055;
  filter: saturate(0.9) brightness(0.95);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}
main > * { position: relative; z-index: 1; }
.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.stitle { font-family: 'Playfair Display', serif; font-size: 20px; margin-bottom: 16px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* BOTÕES */
.btn { background: var(--accent); color: var(--bg); border: none; padding: 8px 16px; font-family: inherit; font-weight: 600; font-size: 13px; border-radius: 8px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface2); }
.btn-danger { background: rgba(243, 104, 104, 0.1); border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.del-btn { background: none; border: none; cursor: pointer; padding: 4px; opacity: 0.7; transition: 0.2s; font-size: 14px; }
.del-btn:hover { opacity: 1; transform: scale(1.1); }

/* Força a lixeira a ficar cinza claro independente do sistema do usuário */
.del-btn.danger { filter: contrast(0) brightness(1.6); }
.del-btn.danger:hover { filter: contrast(0) brightness(2) drop-shadow(0 0 4px var(--danger)); }

/* GRIDS E CARDS */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 768px) { .g2, .g3 { grid-template-columns: 1fr; } .periodo-badge { margin-left: 0; } main::before { width: min(88vw, 520px); top: 320px; opacity: 0.045; } }

.mesas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mesa-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; position: relative; cursor: pointer; transition: 0.2s; }
.mesa-card:hover { border-color: var(--muted); transform: translateY(-2px); }
.mesa-card.sel { border-color: var(--accent); box-shadow: 0 4px 20px rgba(201, 243, 104, 0.1); }
.mc-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 6px; padding-right: 40px; }
.mc-meta { font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.mc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mc-stat { background: var(--surface2); padding: 10px; border-radius: 8px; }
.mc-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mc-stat-val { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 700; margin-top: 4px; }

.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--card-color, var(--border)); }
.card-icon { font-size: 20px; margin-bottom: 8px; }
.card-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.card-value { font-family: 'DM Mono', monospace; font-size: 20px; font-weight: 700; color: var(--text); }
.card-sub { font-size: 10px; color: var(--muted); margin-top: 6px; opacity: 0.7; }

/* TABELAS */
.tw { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.tw-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.tw-head h3 { font-size: 15px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding: 12px 10px; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
td { padding: 14px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* TAGS E CORES */
.tag { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tag-win { background: rgba(104, 212, 243, 0.1); color: var(--accent2); }
.tag-wdo { background: rgba(243, 192, 104, 0.1); color: var(--accent4); }
.tag-est { background: rgba(163, 104, 243, 0.1); color: #a368f3; }
.tag-c { background: rgba(104, 243, 160, 0.1); color: var(--success); }
.tag-v { background: rgba(243, 104, 104, 0.1); color: var(--danger); }
.vp { color: var(--success) !important; font-family: 'DM Mono', monospace; }
.vn { color: var(--danger) !important; font-family: 'DM Mono', monospace; }
.vm { color: var(--text); font-family: 'DM Mono', monospace; }

/* FORMULÁRIOS E MODAIS */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select { width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 8px; outline: none; font-family: inherit; font-size: 13px; transition: 0.2s; }
.field input:focus, .field select:focus { border-color: var(--accent); }

.mo { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; padding: 20px; }
.mo.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 500px; padding: 24px; transform: translateY(20px); transition: 0.3s; box-shadow: 0 10px 40px rgba(0,0,0,0.5); max-height: 90vh; overflow-y: auto; }
.mo.open .modal { transform: translateY(0); }
.modal h2 { font-family: 'Playfair Display', serif; font-size: 20px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ma { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* UTILITÁRIOS E TELAS ESPECÍFICAS */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }
.cfg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.cfg-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.drow { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.drow:last-child { border-bottom: none; }
.pbar { background: var(--surface2); border-radius: 10px; overflow: hidden; }
.pfill { height: 100%; border-radius: 10px; transition: width 0.5s ease; }

.anual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.mes-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: 0.2s; }
.mes-card:hover { border-color: var(--muted); }
.mes-card.cur { border-color: var(--accent); background: rgba(201, 243, 104, 0.05); }
.mes-card.vazio { opacity: 0.5; cursor: default; }
.mes-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.mes-val { font-family: 'DM Mono', monospace; font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.mes-sub { font-size: 11px; color: var(--muted); }

.chart-container { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }

/* Bloqueia o fundo branco de preenchimento automático do navegador */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px var(--surface2) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    transition: background-color 5000s ease-in-out 0s;
}
/* ESTRUTURAS MULTIMESA: EXAME, MESA REAL E GLOBAL */
.mc-badges { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 10px; padding-right:38px; }
.pill { display:inline-flex; align-items:center; justify-content:center; padding:3px 8px; border-radius:999px; border:1px solid var(--border); background:rgba(255,255,255,0.04); color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.3px; text-transform:uppercase; }
.muted-text { color:var(--muted); font-size:13px; line-height:1.55; }
.actions-inline { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.small-title { font-size:15px; margin:18px 0 10px; }
.tw.compact { padding:10px; margin-bottom:12px; }
.tw.compact th, .tw.compact td { padding:9px 8px; font-size:12px; }

/* BLOQUEIO SEGURO DA ESTRUTURA DA MESA */
.cfg-card-estrutura { position: relative; }
.cfg-card-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.cfg-card-head h3 { margin:0; }
.estrutura-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.estrutura-lock-note { color:var(--muted); font-size:12px; line-height:1.45; margin-top:6px; border-top:1px solid var(--border); padding-top:12px; }
.cfg-card-estrutura select:disabled { opacity:.72; cursor:not-allowed; background:rgba(255,255,255,0.035); color:var(--muted); }
.cfg-card-estrutura.editando { border-color:var(--accent); box-shadow:0 0 0 1px rgba(201,243,104,.15), 0 12px 32px rgba(0,0,0,.18); }
.cfg-card-estrutura.editando select { border-color:rgba(201,243,104,.55); }
.cfg-card-estrutura.editando .estrutura-lock-note { color:var(--accent); }
.estrutura-confirm-box { background:var(--surface2); border:1px solid var(--border); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:9px; color:var(--muted); font-size:12px; line-height:1.45; }
.estrutura-confirm-box strong { color:var(--text); }
.modal-confirmacao { box-shadow:0 18px 50px rgba(0,0,0,.55); }

/* MANUAL DE USO - BOTÃO COMO USAR */
.manual-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.84);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.manual-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 1040px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  overflow: hidden;
}
.manual-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(201,243,104,0.06), rgba(104,212,243,0.03), transparent);
}
.manual-kicker {
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-bottom: 6px;
}
.manual-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
}
.manual-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 760px;
}
.manual-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: .2s;
}
.manual-close:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--surface2);
}
.manual-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.manual-menu {
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  padding: 16px;
  overflow-y: auto;
}
.manual-menu a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 9px;
  margin-bottom: 4px;
  transition: .2s;
}
.manual-menu a:hover {
  color: var(--bg);
  background: var(--accent);
}
.manual-content {
  padding: 24px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.manual-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 24px;
  scroll-margin-top: 18px;
}
.manual-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.manual-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  margin-bottom: 14px;
  color: var(--text);
}
.manual-section h4 {
  color: var(--accent);
  margin: 18px 0 8px;
  font-size: 14px;
}
.manual-section p,
.manual-section li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.manual-section strong {
  color: var(--text);
}
.manual-section ol {
  padding-left: 20px;
  margin: 10px 0;
}
.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.manual-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.manual-card strong {
  display: block;
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 13px;
}
.manual-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.manual-list {
  display: grid;
  gap: 8px;
}
.manual-list p {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.manual-alert,
.manual-example {
  margin-top: 14px;
  background: rgba(201,243,104,0.08);
  border: 1px solid rgba(201,243,104,0.22);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.manual-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.manual-flow span {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.manual-flow b {
  color: var(--accent);
}
.manual-footer-note {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.manual-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.015);
}
.manual-actions span {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 860px) {
  .manual-modal { max-height: 92vh; }
  .manual-body { grid-template-columns: 1fr; }
  .manual-menu {
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
  }
  .manual-menu a {
    white-space: nowrap;
    margin-bottom: 0;
  }
  .manual-content { padding: 18px; }
  .manual-head { padding: 18px; }
  .manual-head h2 { font-size: 24px; }
}


/* PERFIL DO USUÁRIO */
.user-profile-chip {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  transition: 0.2s;
  font-family: inherit;
}
.user-profile-chip:hover {
  border-color: var(--accent);
  background: rgba(201,243,104,0.08);
  transform: translateY(-1px);
}
.user-profile-chip .user-avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(201,243,104,0.12);
  border: 1px solid rgba(201,243,104,0.18);
  font-size: 12px;
}
.user-profile-chip strong,
.user-profile-chip small {
  display: block;
  line-height: 1.15;
  text-align: left;
}
.user-profile-chip strong {
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}
.user-profile-chip small {
  margin-top: 2px;
  font-size: 9px;
  color: var(--muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(5px);
  z-index: 20050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.profile-modal {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
}
.profile-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.profile-modal-head h2 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
  font-size: 22px;
  margin: 0 0 6px;
}
.profile-modal-head p,
.profile-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.profile-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  padding: 0 4px;
}
.profile-close:hover { color: var(--text); }
.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
@media (max-width: 760px) {
  .user-profile-chip { width: 100%; justify-content: flex-start; }
  .user-profile-chip small { max-width: 210px; }
  .sync-status { width: 100%; justify-content: center; }
}


/* PERFIL BLOQUEADO E MENU DE VISUALIZAÇÃO DO TOPO */
.user-profile-chip-view {
  padding: 7px 10px;
  gap: 7px;
}
.user-profile-chip-view strong {
  font-size: 12px;
  white-space: nowrap;
}
.user-profile-chip-view .user-avatar {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
}
.user-menu-arrow {
  color: var(--muted);
  font-size: 10px;
  margin-left: 2px;
}
.user-profile-menu {
  position: fixed;
  z-index: 30000;
  min-width: 250px;
  animation: fadeIn 0.16s ease;
}
.user-profile-menu-card {
  background: #eaf0f8;
  color: #0f172a;
  border-radius: 10px;
  padding: 16px 16px 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.45);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.35);
}
.user-profile-menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #f97316;
  border: 2px solid #fb923c;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.12);
}
.user-profile-menu-name {
  color: #020617;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
.user-profile-menu-email {
  color: #334155;
  font-size: 12px;
  margin-top: 3px;
  word-break: break-word;
}
.user-profile-sync-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
}
.user-profile-sync-btn:hover {
  background: #f8fafc;
  border-color: rgba(15,23,42,0.22);
  transform: translateY(-1px);
}
.user-profile-menu-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,0.10);
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}
.user-profile-menu-note strong { color: #0f172a; }
.cfg-card-perfil { position: relative; }
.perfil-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.perfil-lock-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.cfg-card-perfil input:disabled {
  opacity: .72;
  cursor: not-allowed;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
}
.cfg-card-perfil.editando {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(201,243,104,.15), 0 12px 32px rgba(0,0,0,.18);
}
.cfg-card-perfil.editando input:not(:disabled) {
  border-color: rgba(201,243,104,.55);
}
.cfg-card-perfil.editando .perfil-lock-note { color: var(--accent); }
@media (max-width: 760px) {
  .user-profile-menu { left: 12px !important; right: 12px !important; min-width: 0; }
}

/* CONTROLE DE ASSINATURA E PAINEL ADMINISTRATIVO */
.cfg-card-assinatura {
  position: relative;
}
.cfg-card-assinatura.assinatura-ativo { border-color: rgba(104,243,160,.25); }
.cfg-card-assinatura.assinatura-vencido { border-color: rgba(243,192,104,.45); }
.cfg-card-assinatura.assinatura-bloqueado { border-color: rgba(243,104,104,.55); }
.assinatura-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.user-profile-menu-assinatura {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}
.assinatura-bloqueada-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.assinatura-bloqueada-icon { font-size: 46px; margin-bottom: 12px; }
.assinatura-bloqueada-card h2 {
  font-family: 'Playfair Display', serif;
  color: var(--danger);
  font-size: 24px;
  margin-bottom: 10px;
}
.assinatura-bloqueada-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.assinatura-bloqueada-info {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 18px 0;
  padding: 12px;
  text-align: left;
}
.assinatura-bloqueada-info div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.assinatura-bloqueada-info div:last-child { border-bottom: none; }
.assinatura-bloqueada-info span { color: var(--muted); }
.assinatura-bloqueada-info strong { color: var(--text); text-align: right; word-break: break-word; }
.assinatura-bloqueada-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.admin-users-overlay {
  position: fixed;
  inset: 0;
  z-index: 26000;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-users-modal {
  width: min(1360px, 98vw);
  max-height: 90vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
}
.admin-users-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.admin-users-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 4px;
}
.admin-users-head p,
.admin-users-note,
.admin-users-msg { color: var(--muted); font-size: 12px; line-height: 1.45; }
.admin-users-toolbar {
  padding: 14px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.admin-users-toolbar input,
.admin-users-table input,
.admin-users-table select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
  font-size: 12px;
}
.admin-users-toolbar input { flex: 1; min-width: 240px; }
.admin-users-msg { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.admin-users-table-wrap { overflow: auto; padding: 0 20px 14px; }
.admin-users-table { min-width: 1180px; width: 100%; }
.admin-users-table th { font-size: 10px; }
.admin-users-table td { white-space: normal; vertical-align: top; }
.admin-users-table small { color: var(--muted); font-size: 11px; }
.admin-uid { opacity: .65; }
.status-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.status-ativo { background: rgba(104,243,160,.12); color: var(--success); }
.status-vencido { background: rgba(243,192,104,.12); color: var(--accent4); }
.status-bloqueado { background: rgba(243,104,104,.12); color: var(--danger); }
.admin-actions { display: flex; flex-direction: column; gap: 8px; min-width: 210px; width: 210px; }
.admin-users-note { padding: 0 20px 16px; }
@media (max-width: 760px){
  .admin-users-overlay { padding: 10px; }
  .admin-users-head, .admin-users-toolbar { padding: 14px; }
  .admin-users-table-wrap { padding: 0 14px 14px; }
}


/* PAINEL ADMIN: RENOVAÇÃO PERSONALIZADA E CONFIRMAÇÃO DE SALVAMENTO */
.admin-renovar-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.admin-renovar-box select {
  width: 112px;
  min-width: 112px;
  padding: 6px 8px !important;
}
.admin-success-popup {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: adminSuccessFade .18s ease-out;
}
.admin-success-popup::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.20);
  backdrop-filter: blur(1px);
}
.admin-success-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid rgba(104,243,160,.55);
  border-radius: 15px;
  padding: 16px 18px;
  box-shadow: 0 18px 44px rgba(0,0,0,.45), 0 0 0 1px rgba(104,243,160,.08);
}
.admin-success-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(104,243,160,.12);
  border: 1px solid rgba(104,243,160,.28);
  font-size: 18px;
  flex: 0 0 auto;
}
.admin-success-card strong {
  display: block;
  color: var(--success);
  font-size: 14px;
  margin-bottom: 3px;
}
.admin-success-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.admin-success-popup.closing {
  animation: adminSuccessOut .22s ease-in forwards;
}
@keyframes adminSuccessFade {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes adminSuccessOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.98); }
}
@media (max-width: 760px){
  .admin-renovar-box { width: 100%; }
  .admin-renovar-box select { flex: 1; width: auto; }
}

/* Escolha de 1 a 30 dias no painel administrativo */


.admin-users-table td:last-child,
.admin-users-table th:last-child {
  width: 230px;
}
.admin-actions .btn {
  min-height: 34px;
}
.btn-save-admin {
  width: 100%;
}
.admin-renovar-box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.admin-renovar-dias {
  width: 100% !important;
  min-width: 0 !important;
}
.btn-renovar-admin {
  min-width: 84px;
}
.admin-toggle-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}
.admin-toggle-box .btn {
  width: 100%;
}
@media (max-width: 760px){
  .admin-users-modal { width: min(98vw, 98vw); max-height: 92vh; }
  .admin-users-table { min-width: 1080px; }
  .admin-actions { min-width: 190px; width: 190px; }
}


/* IMPORTAÇÃO CSV DE OPERAÇÕES */
.csv-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 27000;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.csv-import-modal {
  width: min(1180px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
}
.csv-import-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.csv-import-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 4px;
}
.csv-import-head p,
.csv-import-info {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.csv-import-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.csv-import-summary div {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.csv-import-summary strong {
  display: block;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  margin-bottom: 2px;
}
.csv-import-summary span {
  color: var(--muted);
  font-size: 11px;
}
.csv-import-info {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.csv-import-info p + p { margin-top: 5px; }
.csv-import-table-wrap {
  overflow: auto;
  padding: 0 20px 14px;
}
.csv-import-table {
  min-width: 980px;
  width: 100%;
}
.csv-import-table th { font-size: 10px; }
.csv-import-table td {
  white-space: normal;
  vertical-align: top;
}
.csv-import-table tr.csv-bad td {
  opacity: .7;
}
.csv-import-table tr.csv-ok td:first-child {
  color: var(--success);
  font-weight: 700;
}
.csv-import-table tr.csv-bad td:first-child {
  color: var(--accent4);
  font-weight: 700;
}
.csv-import-actions {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.csv-import-actions .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
@media (max-width: 760px){
  .csv-import-overlay { padding: 10px; }
  .csv-import-summary { grid-template-columns: 1fr 1fr; padding: 12px; }
  .csv-import-head, .csv-import-info, .csv-import-actions { padding-left: 14px; padding-right: 14px; }
  .csv-import-table-wrap { padding: 0 14px 14px; }
}


/* OPÇÃO DE CRIAR PREGÃO NA IMPORTAÇÃO CSV */
.csv-import-check {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(201,243,104,.06);
  border: 1px solid rgba(201,243,104,.22);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
}
.csv-import-check input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.csv-import-check strong {
  display: block;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 3px;
}
.csv-import-check small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}


/* PAINEL ADMIN: STATUS VISUAL SEM SELETOR MANUAL */
.admin-status-cell {
  min-width: 120px;
}
.admin-status-cell .status-pill {
  margin-top: 0;
}
.status-help {
  display: block;
  margin-top: 6px;
  max-width: 150px;
  line-height: 1.35;
  opacity: .7;
}
