/* assets/ui-premium.css */
:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --muted2: rgba(255,255,255,.52);
  --shadow: 0 22px 60px rgba(0,0,0,.35);
  --shadow2: 0 10px 30px rgba(0,0,0,.28);

  /* ===== NOVO TEMA LARANJA ===== */
  --brand: #F58320;
  --brand2: #E46F10;              /* laranja mais escuro p/ gradiente */
  --brand-soft: rgba(245,131,32,.18);
  --brand-soft2: rgba(245,131,32,.10);
  --brand-stroke: rgba(245,131,32,.35);
  --focus: rgba(245,131,32,.35);

  /* mantém semântica */
  --accent: var(--brand);
  --accent2: var(--brand2);

  --ok: #F58320;                  /* “ok” agora é laranja */
  --warn: #fbbf24;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --topbar-h: 76px;
}

/* Base */
*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 18% 0%, rgba(245,131,32,.20), transparent 60%),
    radial-gradient(1100px 560px at 82% 0%, rgba(228,111,16,.18), transparent 60%),
    radial-gradient(900px 500px at 50% 115%, rgba(245,131,32,.12), transparent 70%),
    var(--bg);
}

/* Layout */
.shell{
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 16px) 16px 36px;
}

/* Topbar (fixa, premium glass) */
.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(10,14,24,.76), rgba(10,14,24,.56));
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}

.topbar-inner{
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 240px;
}

.brand-badge{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  letter-spacing: .6px;

  background: linear-gradient(135deg, rgba(245,131,32,.35), rgba(228,111,16,.30));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow2);
}

.brand-text{ line-height: 1.1; }
.brand-title{
  margin:0;
  font-size: 18px;
  letter-spacing: .2px;
}
.brand-subtitle{
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* Center controls */
.topbar-center{
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
}

.format-pill{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.format-pill span{
  color: var(--muted);
  font-size: 12px;
}

.select{
  appearance: none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  color: var(--text);
  padding: 8px 34px 8px 12px;
  border-radius: 999px;
  outline: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.select-wrap{
  position: relative;
  display:flex;
  align-items:center;
}
.select-wrap:after{
  content: "▾";
  position: absolute;
  right: 12px;
  color: rgba(255,255,255,.70);
  font-size: 12px;
  pointer-events: none;
}

/* Right actions */
.topbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  min-width: 300px;
}

.status{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.75);
  font-size: 12px;
  white-space: nowrap;
}
.dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
}
.status.ok .dot{ background: var(--ok); }
.status.busy .dot{ background: var(--warn); }

/* Buttons */
.btn{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 700;
  font-size: 13px;
  transition: transform .06s ease, filter .2s ease, background .2s ease;
}
.btn:hover{ background: rgba(255,255,255,.08); }
.btn:active{ transform: translateY(1px); }
.btn[disabled]{ opacity:.6; cursor:not-allowed; }

.btn-primary{
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #1b1208;
}
.btn-primary:hover{ filter: brightness(1.05); }

.btn-soft{
  background: rgba(255,255,255,.04);
}

/* Card hero (opcional, se quiser manter) */
.hero-card{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
}

.hero-copy{ flex: 1; }
.hero-eyebrow{
  display:inline-block;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.hero-headline{
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
}
.hero-art{
  width: 220px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245,131,32,.14), rgba(228,111,16,.12));
  border: 1px solid rgba(255,255,255,.10);
}
.hero-img, .hero-svg{
  width: 172px;
  height: auto;
  display:block;
  filter: drop-shadow(0 14px 25px rgba(0,0,0,.35));
}

/* Quill premium theme-ish */
.ql-toolbar.ql-snow{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding: 10px 10px;
}
.ql-toolbar.ql-snow .ql-picker,
.ql-toolbar.ql-snow .ql-formats button{
  filter: saturate(.9);
}
.ql-toolbar.ql-snow .ql-stroke{ stroke: rgba(255,255,255,.82); }
.ql-toolbar.ql-snow .ql-fill{ fill: rgba(255,255,255,.82); }
.ql-toolbar.ql-snow .ql-picker-label{ color: rgba(255,255,255,.86); }
.ql-toolbar.ql-snow .ql-picker-options{
  background: #0f1730;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 6px;
}
.ql-container.ql-snow{
  border: none;
  background: transparent;
}

/* Responsive */
@media (max-width: 980px){
  .brand{ min-width: 200px; }
  .topbar-actions{ min-width: 240px; }
  .status{ display:none; }
}
@media (max-width: 760px){
  :root{ --topbar-h: 86px; }
  .topbar-inner{ flex-wrap: wrap; justify-content: space-between; }
  .topbar-center{ order: 3; width: 100%; justify-content: flex-start; }
  .format-pill{ width: 100%; justify-content: space-between; }
}

/* ===== Layout com Sidebar ===== */
.layout{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.sidebar{
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
}

.sidebar-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-title{
  font-weight: 900;
  letter-spacing: .2px;
}

.btn-small{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.sidebar-search{
  margin-top: 10px;
}
.sidebar-search input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.92);
  outline: none;
}
.sidebar-search input:focus{
  border-color: var(--brand-stroke);
  box-shadow: 0 0 0 4px var(--focus);
}

.project-list{
  margin-top: 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - (var(--topbar-h) + 220px));
  overflow: auto;
  padding-right: 4px;
}

.project-item{
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}

.project-item:hover{ background: rgba(255,255,255,.07); }
.project-item:active{ transform: translateY(1px); }

.project-item.active{
  background: linear-gradient(135deg, rgba(245,131,32,.18), rgba(228,111,16,.10));
  border-color: rgba(245,131,32,.38);
}

.project-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.project-title{
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,.92);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 220px;
}

.project-meta{
  margin-top: 6px;
  display:flex;
  gap: 10px;
  color: rgba(255,255,255,.60);
  font-size: 11px;
}

.project-pill{
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.project-edit{
  border: none;
  background: transparent;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 10px;
}
.project-edit:hover{ background: rgba(255,255,255,.06); }

/* ===== Doc header premium ===== */
.doc-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px 0;
}

.doc-title-wrap{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 420px;
  flex: 1;
}

.doc-title{
  flex: 1;
  min-width: 260px;
  height: 42px;
  padding: 10px 14px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);

  color: rgba(255,255,255,.92);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2px;
  outline: none;
}

.doc-title::placeholder{ color: rgba(255,255,255,.50); }

.doc-title:focus{
  border-color: var(--brand-stroke);
  box-shadow: 0 0 0 4px var(--focus);
}

.doc-sub{
  margin: 0;
  display: flex;
  align-items: center;
}

.doc-id{
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;

  color: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  white-space: nowrap;
}

.doc-actions{
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Ações na lista de projetos ===== */
.project-actions{
  display:flex;
  gap: 6px;
  align-items:center;
}

.project-action{
  border: none;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.80);
  cursor: pointer;
  font-weight: 900;
  padding: 6px 8px;
  border-radius: 10px;
  line-height: 1;
}
.project-action:hover{ background: rgba(255,255,255,.10); }

.project-action.danger{
  color: rgba(255,180,180,.95);
  border-color: rgba(255,180,180,.18);
}
.project-action.danger:hover{
  background: rgba(255,0,0,.10);
}

/* garante que botões pequenos fiquem alinhados e com altura do input */
.btn.btn-small{
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 14px;
}

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ position: relative; top: 0; }
  .doc-title-wrap{ min-width: 0; }
}

/* contador de palavras menor */
.counter,
#wordCount{
  font-size: 11px;       /* ajuste aqui: 10px / 11px / 12px */
  font-weight: 700;
  color: rgba(255,255,255,.65);
}

.brand-logo{
  padding: 6px;
}

.brand-logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}

/* ===== Logo Perse no lugar do "CD" ===== */
.brand{
  align-items: center;
  gap: 12px;
}

.brand-badge.brand-logo{
  width: 62px !important;
  height: 62px !important;
  padding: 6px !important;
  border-radius: 14px !important;

  /* tira o “badge” chamativo e deixa mais clean */
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: var(--shadow2) !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  overflow: hidden !important; /* ✅ impede o logo de estourar */
}

.brand-badge.brand-logo img{
  width: 100% !important;
  height: 100% !important;
  max-width: 60px !important;  /* ✅ controla o tamanho real do logo */
  max-height: 60px !important;

  object-fit: contain !important;
  display: block !important;

  /* se o logo estiver muito “forte”, reduz um pouco */
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.25));
}

/* Se o logo estiver muito grande em telas menores */
@media (max-width: 760px){
  .brand-badge.brand-logo{
    width: 38px !important;
    height: 38px !important;
    padding: 6px !important;
  }
  .brand-badge.brand-logo img{
    max-width: 26px !important;
    max-height: 26px !important;
  }
}

:root{
  --topbar-h: 92px; /* antes era ~76px */
}

/* ===== Overlay de carregamento ===== */
.loading-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,14,24,.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay.hidden{
  display: none;
}

.loading-card{
  padding: 22px 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  text-align: center;
  min-width: 260px;
}

/* Spinner */
.spinner{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: #F58320; /* cor Perse */
  animation: spin 1s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin{
  to{ transform: rotate(360deg); }
}

.loading-title{
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .2px;
}

.loading-sub{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.75);
}
