:root{
  --primary: #202080;
  --primary-600: #1b1b70;
  --accent: #700000;

  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6eaf2;

  --radius: 16px;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
}

/* RESET */
*{ box-sizing: border-box; }
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(32,32,128,0.10), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(112,0,0,0.06), transparent 55%),
    var(--bg);
  color: var(--text);
}

.container{
  max-width: 1120px;
  margin: 18px auto;
  padding: 0 16px 24px;
}


/* HEADERS */
.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 16px;
  margin: 16px 0 10px;
}
.head-actions{ display:flex; gap:10px; flex-wrap:wrap; }

h1{ margin:0; font-size: 30px; letter-spacing: -0.8px; }
h3{ margin:0; font-size: 18px; letter-spacing: -0.3px; }

.subtext{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

/* CARDS */
.card{
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
}
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 12px;
  margin-bottom: 10px;
}
.divider{
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* FORMS */
label{
  display:block;
  font-weight: 800;
  font-size: 13px;
  color: #1f2a44;
  margin-bottom: 10px;
}
input, textarea, select{
  width:100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 8px;
  background: #fff;
  outline: none;
  transition: 0.15s ease;
}
input:focus, textarea:focus, select:focus{
  border-color: rgba(32,32,128,0.35);
  box-shadow: 0 0 0 4px rgba(32,32,128,0.12);
}
textarea{ resize: vertical; }

.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 820px){
  .page-head{ flex-direction: column; align-items:flex-start; }
  .grid2, .grid3{ grid-template-columns: 1fr; }
}

/* BUTTONS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor:pointer;
  text-decoration:none;
  font-weight: 900;
  transition: 0.15s ease;
}
.btn-primary{
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(32,32,128,0.18);
}
.btn-primary:hover{ background: var(--primary-600); }
.btn-ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover{ background: rgba(15,23,42,0.04); }

.actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* TABLE */
.table{ width:100%; border-collapse: collapse; overflow:hidden; border-radius: 14px; }
.table th{
  text-align:left;
  font-size: 12px;
  color: #334155;
  background: #f2f5fb;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.table td{
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table tr:hover td{ background: rgba(32,32,128,0.03); }

/* Filtros de busca (dashboard) */
.filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  max-width: 760px;
}
.input{ min-width: 260px; }
.table-wrap{ width:100%; overflow:auto; }

/* Tabela -> "cards" em telas pequenas */
@media (max-width: 820px){
  .filters{ justify-content:flex-start; }
  .input{ min-width: 100%; }
  .table thead{ display:none; }
  .table, .table tbody, .table tr, .table td{ display:block; width:100%; }
  .table tr{
    border:1px solid rgba(0,0,0,.06);
    border-radius:14px;
    padding:12px;
    margin-bottom:12px;
    background:#fff;
  }
  .table td{
    border:none !important;
    padding:8px 0;
    display:flex;
    justify-content:space-between;
    gap:12px;
  }
  .table td::before{
    content: attr(data-label);
    color: rgba(0,0,0,.55);
    font-weight:600;
    flex: 0 0 92px;
  }
  .sep{ display:none; }
}

.link{ color: var(--primary); font-weight: 900; text-decoration:none; }
.link:hover{ text-decoration: underline; }
.sep{ color: #cbd5e1; margin: 0 6px; }

/* STATUS PILL */
.pill{
  display:inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #334155;
  margin-left: 8px;
}
.pill--rascunho{ background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
.pill--pronto{ background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
.pill--enviado{ background:#ecfdf5; border-color:#bbf7d0; color:#047857; }

/* MENSAGENS FLASH */
.flash-wrap{ margin: 12px 0; }
.flash{
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  padding: 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
}

/* CHECKLIST */
.checklist{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 8px 0 6px;
}
@media (max-width: 820px){ .checklist{ grid-template-columns: 1fr; } }

.chk{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}
.chk input{
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* DIAS */
.days-header{
  display:grid;
  grid-template-columns: 1.1fr .9fr .9fr .9fr .9fr 44px;
  gap: 10px;
  padding: 8px 4px;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}
.dayrow{
  display:grid;
  grid-template-columns: 1.1fr .9fr .9fr .9fr .9fr 44px;
  gap: 10px;
  margin: 10px 0;
  align-items:center;
}

/* MATERIAIS */
.matrow{
  display:grid;
  grid-template-columns: 2fr 110px 90px 2fr 44px;
  gap: 10px;
  margin: 10px 0;
  align-items:center;
}

.btn-mini{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  cursor:pointer;
  background: rgba(112,0,0,0.10);
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
}
.btn-mini:hover{ background: rgba(112,0,0,0.16); }

/* ASSINATURA */
.sigbox{
  border: 1px dashed rgba(32,32,128,0.35);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(32,32,128,0.03);
}
#sigCanvas{
  width: 100%;
  max-width: 760px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.sigactions{
  display:flex;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
  flex-wrap:wrap;
}
.muted{ color: var(--muted); font-weight: 800; }

/* MOBILE IMPROVEMENTS */
@media (max-width: 820px){
  .container{ padding: 0 12px 28px; }

  h1{ font-size: 24px; }
  h3{ font-size: 16px; }

  .card{
    padding: 14px;
    border-radius: 14px;
  }

  input, textarea, select{
    padding: 13px 12px;
    border-radius: 14px;
    font-size: 16px; /* evita zoom no iPhone */
  }
  label{ font-size: 12px; }

  .chk{
    padding: 12px 12px;
    gap: 12px;
  }
  .chk input{
    width: 20px;
    height: 20px;
  }

  .days-header{ display:none; }

  .dayrow{
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .matrow{
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .dayrow .btn-mini,
  .matrow .btn-mini{
    width: 100%;
    height: 44px;
  }

  #sigCanvas{ height: 160px; }

  .actions .btn{
    width: 100%;
    padding: 12px 14px;
  }
}
/* ====== CHECKBOXES MODERNOS (pill) ====== */
.check-row{
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center; /* ✅ centraliza no card */
  flex-wrap: wrap;
}

.check-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

.check-pill:hover{
  border-color: rgba(0,0,0,.14);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
}

.check-pill input{
  /* escondemos o checkbox padrão */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-ui{
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid rgba(0,0,0,.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  background: #fff;
}

.check-text{
  font-weight: 600;
  font-size: 14px;
}

/* Estado marcado */
.check-pill input:checked + .check-ui{
  border-color: #0ea5e9;
  background: #0ea5e9;
  box-shadow: 0 6px 18px rgba(14,165,233,.25);
}

.check-pill input:checked + .check-ui::after{
  content: "";
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 3px;
}

/* Mobile */
@media (max-width: 520px){
  .check-row{
    justify-content: stretch;
  }
  .check-pill{
    width: 100%;
    justify-content: center; /* fica central dentro */
  }
}
/* ===== Card de senha temporária ===== */
.temp-card{
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  padding: 14px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  margin: 12px 0 18px;
}

.temp-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.temp-card__title{
  font-weight: 800;
  font-size: 14px;
}

.temp-card__body{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}

.temp-pass{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 18px;
  letter-spacing: 1px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,.18);
  background: rgba(0,0,0,.03);
  min-width: 220px;
  text-align: center;
}

.temp-card__foot{
  margin-top: 8px;
  font-size: 13px;
}

/* Ajustes pequenos */
.row-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
}
.btn-sm{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}
/* ========= Ajustes gerais dessas telas ========= */
.form-card{ max-width: 760px; }
.actions{ margin-top: 18px; display:flex; gap:10px; flex-wrap:wrap; }
.small{ font-size: 13px; }

/* ========= CHECKBOXES / PILLS (centralizados) ========= */
.check-row{
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.check-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.05);
}

.check-pill:hover{
  border-color: rgba(0,0,0,.14);
  box-shadow: 0 14px 34px rgba(0,0,0,.07);
}

.check-pill input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-ui{
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid rgba(0,0,0,.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  background: #fff;
}

.check-text{
  font-weight: 700;
  font-size: 14px;
}

.check-pill input:checked + .check-ui{
  border-color: #0ea5e9;
  background: #0ea5e9;
  box-shadow: 0 10px 26px rgba(14,165,233,.25);
}

.check-pill input:checked + .check-ui::after{
  content: "";
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 3px;
}

@media (max-width: 520px){
  .check-row{ justify-content: stretch; }
  .check-pill{ width: 100%; justify-content: center; }
}

/* ========= CARD de senha temporária ========= */
.temp-card{
  margin: 12px 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  box-shadow: 0 16px 44px rgba(0,0,0,.08);
}

.temp-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.temp-card__title{
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2px;
}

.temp-card__body{
  margin-top: 12px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}

.temp-pass{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 18px;
  letter-spacing: 1px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,.18);
  background: rgba(0,0,0,.03);
  min-width: 240px;
  text-align: center;
}

.temp-card__foot{
  margin-top: 10px;
  font-size: 13px;
}

/* ========= Ações da tabela ========= */
.row-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.btn-sm{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}
/* =========================
   HEADER SaaS - LR Machine
   ========================= */

.saas-topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #0b1220, #070c16);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}

.saas-inner{
  max-width: 1150px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.saas-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  min-width: 220px;
}

.saas-brand img{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  padding: 4px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
}

.saas-brand__title{
  font-weight: 900;
  letter-spacing: .3px;
  line-height: 1.05;
}

.saas-brand__sub{
  font-size: 12px;
  color: rgba(255,255,255,.70);
  margin-top: 2px;
}

.saas-nav{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.saas-link{
  color: rgba(255,255,255,.84);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
  padding: 10px 10px;
  border-radius: 12px;
  transition: all .15s ease;
}

.saas-link:hover{
  color: #fff;
  background: rgba(255,255,255,.06);
}

/* User dropdown */
.saas-user{
  position: relative;
  display: flex;
  align-items: center;
}

.saas-userbtn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
  transition: all .15s ease;
}

.saas-userbtn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.14);
}

.saas-avatar{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #0b1220;
  background: linear-gradient(180deg, #ffffff, rgba(255,255,255,.88));
}

.saas-username{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  gap: 2px;
  font-weight: 750;
  font-size: 13px;
}

.saas-role{
  font-size: 11px;
  font-weight: 650;
  color: rgba(255,255,255,.70);
}

.saas-caret{
  opacity: .75;
  font-size: 12px;
  margin-left: 2px;
}

/* Dropdown content */
.saas-dropdown{
  position: absolute;
  right: 0;
  top: 52px;
  min-width: 190px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.20);
  padding: 8px;
  display: none;
}

.saas-dropdown.open{ display: block; }

.saas-dditem{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: #111;
  font-weight: 650;
  font-size: 14px;
}

.saas-dditem:hover{
  background: rgba(0,0,0,.05);
}

.saas-dditem.danger{
  color: #b42318;
}

.saas-ddsep{
  height: 1px;
  background: rgba(0,0,0,.08);
  margin: 6px 0;
}

/* Burger (mobile) */
.saas-burger{
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
}

.saas-burger span{
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 99px;
}

/* Mobile behavior */
@media (max-width: 860px){
  .saas-brand{ min-width: auto; }
  .saas-nav{
    display: none;
    width: 100%;
    margin-left: 0;
    padding: 10px 0 2px;
    border-top: 1px solid rgba(255,255,255,.08);
    gap: 8px;
    flex-wrap: wrap;
  }
  .saas-nav.open{ display: flex; }
  .saas-burger{ display: inline-flex; }
  .saas-inner{
    flex-wrap: wrap;
  }
  .saas-user{
    margin-left: auto;
  }
}

/* =========================
   LOGIN
   ========================= */
.auth-wrap{
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.auth-card{
  width: 100%;
  max-width: 380px;
}
.stack{ display: flex; flex-direction: column; gap: 2px; }

/* =========================
   BADGES (papel / status de usuário)
   ========================= */
.badge{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: rgba(32,32,128,0.08);
  color: var(--primary);
}
.badge-soft{ background: #f1f5f9; color: #475569; border-color: var(--border); }
.badge-ok{ background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.badge-bad{ background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-warn{ background: #fff7ed; color: #9a3412; border-color: #fed7aa; }

/* =========================
   TELA DE USUÁRIOS
   ========================= */
.users-table-card{ overflow: auto; }

.temp-pass{
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(32,32,128,0.06);
  border: 1px solid var(--border);
}

.field-hint{ display: flex; align-items: flex-end; }

/* =========================
   UTILITÁRIOS
   ========================= */
.mt8{ margin-top: 8px; }
.span2{ grid-column: span 2; }
@media (max-width: 820px){
  .span2{ grid-column: span 1; }
}

/* Bloco "finalizar sem assinatura" (report_edit.html) */
.chk-compact{
  margin-top: 12px;
  padding: 10px 12px;
}
.noSigBlock{
  display: none;
  margin-top: 12px;
}
.noSigBlock.show{ display: block; }
