:root {
  --bg: #f2f5fd;
  --sidebar: #ffffff;
  --card: #ffffff;
  --text: #253261;
  --muted: #9aa5bd;
  --light: #eef2fa;
  --line: #e8edf6;
  --purple: #4a19ff;
  --purple-2: #6e59ff;
  --blue: #2678ff;
  --cyan: #28bfd2;
  --green: #16c99a;
  --orange: #f69c3d;
  --red: #ff5263;
  --yellow: #f5cd39;
  --shadow: 0 18px 38px rgba(50, 60, 110, 0.08);
  --soft-shadow: 0 8px 22px rgba(42, 55, 102, 0.06);
  --radius: 18px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family:
    "DM Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
svg {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}
.app-shell {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 194px;
  background: var(--sidebar);
  border-right: 1px solid #edf1f8;
  display: flex;
  flex-direction: column;
  z-index: 20;
  box-shadow: 10px 0 22px rgba(42, 55, 102, 0.02);
}
.brand {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #edf1f8;
  padding: 0 21px;
}
.brand img {
  width: 138px;
  max-height: 52px;
  object-fit: contain;
}
.nav-menu {
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 22px;
  height: 28px;
  color: #a6afc2;
  font-size: 15px;
  font-weight: 700;
  transition: 0.2s;
}
.nav-link svg {
  width: 18px;
  height: 18px;
}
.nav-link.active,
.nav-link:hover {
  color: #253261;
}
.nav-link.active svg {
  color: var(--purple);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  right: 0;
  width: 4px;
  height: 30px;
  border-radius: 999px 0 0 999px;
  background: var(--purple);
}
.logout {
  margin-top: auto;
  margin-bottom: 31px;
}
.page-area {
  flex: 1;
  margin-left: 194px;
  min-width: 0;
}
.page-content {
  position: relative;
  padding: 63px 55px 35px;
  margin: 0 auto;
}
.topbar {
  position: fixed;
  right: 130px;
  top: 47px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
}
.searchbox {
  width: 250px;
  height: 39px;
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  color: #9aa5bd;
}
.searchbox svg {
  width: 14px;
  height: 14px;
}
.searchbox input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 11px;
  background: transparent;
}
.searchbox input::placeholder {
  color: #b8c0d0;
}
.top-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #a4aec2;
}
.top-icon svg {
  width: 17px;
  height: 17px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 35%,
    #d5c4ff 0 24%,
    #1e285a 25% 38%,
    #9d7bff 39% 58%,
    #f2d5b8 59% 73%,
    #213067 74%
  );
  border: 4px solid #ecf1ff;
  box-shadow: 0 8px 20px rgba(26, 35, 82, 0.14);
}
.page-title {
  font-size: 30px;
  line-height: 1;
  margin: 0 0 54px;
  font-weight: 800;
  letter-spacing: -1.3px;
}
.mobile-menu,
.mobile-logo,
.mobile-backdrop {
  display: none;
}
.action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.dashboard-actions {
  margin-top: -3px;
  margin-bottom: 36px;
}
.btn {
  height: 38px;
  border-radius: 12px;
  padding: 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  transition: 0.2s;
  white-space: nowrap;
}
.btn.primary {
  background: var(--purple);
  color: #fff;
  min-width: 218px;
  box-shadow: 0 14px 28px rgba(74, 25, 255, 0.22);
}
.btn.ghost {
  background: transparent;
  color: var(--purple);
  border: 1.5px solid var(--purple);
  min-width: 218px;
}
.btn.save {
  height: 43px;
  background: #0088ff;
  color: #fff;
  border-radius: 4px;
  padding: 0 23px;
  box-shadow: 0 12px 22px rgba(0, 136, 255, 0.16);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.stat-card {
  width: 250px;
  height: 82px;
  background: #fff;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  box-shadow: var(--soft-shadow);
}
.stat-icon {
  width: 33px;
  height: 33px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: #f6f4ff;
  box-shadow: 0 7px 16px rgba(74, 25, 255, 0.09);
}
.stat-icon svg {
  width: 23px;
  height: 23px;
}
.stat-card span {
  display: block;
  color: #a2acbf;
  font-size: 11px;
  margin-bottom: 5px;
}
.stat-card strong {
  font-size: 23px;
  line-height: 1;
  font-weight: 800;
}
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.lane-card {
  background: #fff;
  border-radius: 15px;
  padding: 21px 13px 15px;
  min-height: 545px;
  box-shadow: var(--shadow);
}
.lane-card h2 {
  font-size: 18px;
  margin: 0 0 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.piece-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 11px 12px;
  margin-bottom: 12px;
  box-shadow: 0 15px 32px rgba(70, 78, 120, 0.08);
}
.piece-card h3 {
  font-size: 15px;
  margin: 0 0 21px;
  font-weight: 800;
}
.piece-card p {
  font-size: 12px;
  color: #adb6c8;
  margin: 0 0 8px;
}
.piece-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: 23px;
}
.piece-footer span {
  font-size: 11px;
  color: #fff;
}
.piece-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tiny-btn {
  height: 24px;
  padding: 0 15px;
  border-radius: 6px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tiny-btn svg {
  width: 10px;
  height: 10px;
}
.tiny-btn.blue {
  background: #2b6cff;
}
.tiny-btn.orange {
  background: var(--orange);
}
.tiny-btn.green {
  background: var(--green);
}
.square-btn {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
}
.square-btn svg {
  width: 14px;
  height: 14px;
}
.square-btn.red {
  background: var(--red);
}
.square-btn.yellow {
  background: var(--yellow);
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5f8ff 0%, #eef3fd 55%, #fff 100%);
  padding: 25px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 26px;
  padding: 39px 42px 36px;
  box-shadow: 0 30px 75px rgba(37, 50, 97, 0.12);
  border: 1px solid rgba(232, 237, 246, 0.9);
}
.login-logo {
  width: 205px;
  display: block;
  margin: 0 auto 35px;
}
.login-card h1 {
  font-size: 34px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -1px;
}
.login-card p {
  font-size: 15px;
  color: #8792aa;
  margin: 0 0 32px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.input-group,
.form-grid label,
.full-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  color: #222b49;
}
.input-group span,
.form-grid span,
.full-field span {
  font-size: 13px;
}
.input-group input,
.form-grid input,
.form-grid select,
.full-field select,
.side-content select {
  height: 48px;
  border: 0;
  border-bottom: 1px solid #e3e8f1;
  outline: 0;
  font-size: 16px;
  color: #6e768c;
  background: transparent;
  padding: 0 4px;
}
.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #747f99;
}
.login-row a {
  color: var(--purple);
  font-weight: 700;
}
.remember {
  display: flex;
  align-items: center;
  gap: 7px;
}
.login-btn {
  height: 48px;
  border-radius: 12px;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 18px 30px rgba(74, 25, 255, 0.24);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.modal.open {
  display: block;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 41, 0.22);
  backdrop-filter: blur(2px);
}
.modal-dialog {
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: min(915px, calc(100vw - 32px));
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(22, 28, 58, 0.16);
  padding: 27px 22px 0;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 29px;
}
.modal-head h2 {
  font-size: 16px;
  margin: 0 0 6px;
  font-weight: 800;
}
.modal-head p {
  font-size: 10px;
  color: #8d96aa;
  margin: 0;
}
.close-modal {
  font-size: 30px;
  line-height: 1;
  color: #9ca7bb;
}
.full-field {
  margin-bottom: 30px;
}
.form-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 58px;
}
.modal-actions {
  height: 80px;
  border-top: 1px solid #e2e7f1;
  margin: 27px -22px 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 41px;
}
.floating-actions {
  position: absolute;
  top: 95px;
  right: 252px;
  display: flex;
  gap: 9px;
  z-index: 5;
}
.floating-actions button {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #738096;
  box-shadow: 0 6px 16px rgba(37, 50, 97, 0.08);
}
.floating-actions .dark {
  background: #202c4a;
  color: #fff;
}
.model-builder {
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
}
.model-team {
  font-size: 25px;
  font-weight: 800;
  margin: 0 0 22px;
  letter-spacing: -0.8px;
}
.model-name-row {
  height: 48px;
  background: #fff;
  border: 1px solid #dce2ed;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  margin-bottom: 23px;
  box-shadow: 0 7px 18px rgba(37, 50, 97, 0.06);
  font-size: 19px;
  font-weight: 800;
}
.model-name-row svg {
  width: 20px;
  color: #9ca7bb;
}
.editor-frame {
  background: #fff;
  border: 1px solid #dce2ed;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(42, 55, 102, 0.05);
}
.editor-add {
  height: 49px;
  border-bottom: 1px solid #e6ebf4;
  display: flex;
  align-items: center;
  padding: 0 13px;
}
.editor-add button {
  height: 28px;
  border: 1px solid #e6ebf4;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #40506f;
  font-weight: 700;
  font-size: 11px;
}
.editor-add svg {
  width: 14px;
  height: 14px;
}
.editor-toolbar {
  height: 42px;
  border-bottom: 1px solid #e6ebf4;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 12px;
  color: #53617a;
  font-size: 13px;
}
.editor-toolbar svg {
  width: 16px;
  height: 16px;
}
.editor-paper {
  height: 540px;
  overflow: auto;
  padding: 23px 23px 35px;
  background: #fff;
  color: #2d354f;
}
.editor-paper h2 {
  text-align: center;
  font-size: 21px;
  letter-spacing: -0.5px;
  margin: 0 0 28px;
  font-weight: 800;
}
.editor-paper p {
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 24px;
}
.word-count {
  border-top: 1px solid #edf1f7;
  color: #5a6479;
  padding: 11px 14px;
  font-size: 12px;
}
.model-side {
  display: flex;
  flex-direction: column;
  gap: 19px;
}
.side-box {
  background: #fff;
  border: 1px solid #dce2ed;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(42, 55, 102, 0.05);
}
.side-box h3 {
  font-size: 14px;
  margin: 0;
  padding: 17px 14px;
  border-bottom: 1px solid #e6ebf4;
  font-weight: 800;
}
.side-content {
  padding: 15px 13px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #41516e;
  font-size: 13px;
  font-weight: 700;
}
.side-item svg {
  width: 17px;
  height: 17px;
  color: #8290a7;
}
.side-actions {
  border-top: 1px solid #e6ebf4;
  padding: 12px 11px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.side-actions button {
  height: 33px;
  border-radius: 19px;
  border: 1px solid #e4e9f3;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 800;
}
.side-actions .purple {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}
.radios .side-item {
  justify-content: space-between;
}
.radios input {
  accent-color: #6d5cff;
}
.config-box label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #2b354f;
}
.config-box select {
  height: 34px;
  border: 1px solid #e4e9f3;
  border-radius: 18px;
  padding: 0 10px;
  font-size: 11px;
}
.models-page {
  margin: 0 auto;
}
.models-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 17px;
}
.models-head h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 800;
}
.view-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--purple);
}
.view-icons svg {
  width: 15px;
  height: 15px;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 23px;
}
.folder-card {
  height: 81px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 0 16px;
}
.folder-card span {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: #f7f4ff;
  color: var(--purple);
  display: grid;
  place-items: center;
}
.folder-card svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke-width: 0;
}
.folder-card strong {
  font-size: 13px;
  font-weight: 800;
}
.files-head {
  margin-top: 0;
}
.table-shell {
  background: #fff;
  border-radius: 5px;
  box-shadow: var(--soft-shadow);
  overflow: auto;
}
.models-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 810px;
}
.models-table th {
  height: 47px;
  text-align: left;
  color: #48546f;
  font-size: 11px;
  font-weight: 800;
  border-bottom: 1px solid #dde4ef;
  padding: 0 15px;
}
.models-table td {
  height: 50px;
  border-bottom: 1px solid #eef2f7;
  padding: 0 15px;
  font-size: 12px;
  color: #3e4a64;
}
.models-table tr:nth-child(4) {
  box-shadow:
    0 -1px 0 #d7deeb,
    0 1px 0 #d7deeb;
}
.file-cell {
  display: flex;
  align-items: center;
  gap: 13px;
}
.file-cell > svg {
  color: #7a5cff;
  width: 18px;
}
.file-cell strong {
  display: block;
  font-size: 12px;
}
.file-cell span {
  display: block;
  color: #9da8ba;
  font-size: 11px;
  margin-top: 2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ativo {
  background: #eaffe8;
  color: #13aa72;
}
.badge.desatualizado {
  background: #eceef3;
  color: #585f6f;
}
.badge.em-analise {
  background: #fff0d7;
  color: #ef9f31;
}
.row-actions {
  white-space: nowrap;
  text-align: right;
}
.row-actions button {
  margin-left: 18px;
}
.row-actions button:nth-child(1) {
  color: #11c69b;
}
.row-actions button:nth-child(2) {
  color: var(--purple);
}
.row-actions button:nth-child(3) {
  color: var(--red);
}
.row-actions svg {
  width: 18px;
  height: 18px;
}
.pagination {
  height: 30px;
  background: #fff;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  color: #68738c;
  font-size: 12px;
}
.pagination .active {
  border: 1px solid #e1e7f1;
  border-radius: 5px;
  padding: 6px 7px;
}
.calendar-page {
  display: grid;
  grid-template-columns: 209px minmax(0, 1fr);
  gap: 29px;
  align-items: start;
}
.calendar-sidebar {
  background: var(--purple);
  color: #fff;
  width: 209px;
  min-height: 720px;
  padding: 30px 17px 22px;
  box-shadow: var(--soft-shadow);
  border-radius: 16px;
}
.mini-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 21px;
  margin-bottom: 25px;
}
.mini-calendar-head span {
  font-size: 27px;
  letter-spacing: 8px;
}
.mini-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 8px;
  text-align: center;
  margin-bottom: 12px;
}
.mini-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 9px;
  font-size: 9px;
  text-align: center;
}
.mini-days span {
  height: 17px;
  display: grid;
  place-items: center;
}
.mini-days .selected {
  background: #77e1a9;
  color: #1c2347;
  border-radius: 50%;
  font-weight: 800;
}
.today-block {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 36px;
  padding-top: 22px;
}
.today-block h3 {
  font-size: 12px;
  margin: 0 0 22px;
}
.today-block h3 span {
  margin-left: 7px;
  font-weight: 500;
}
.agenda-item {
  position: relative;
  padding-left: 18px;
  margin-bottom: 23px;
}
.agenda-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #70f0c8;
}
.agenda-item.event-blue::before {
  background: #51c6ff;
}
.agenda-item.event-pink::before {
  background: #ff7896;
}
.agenda-item span {
  font-size: 10px;
  display: block;
  margin-bottom: 5px;
}
.agenda-item strong {
  font-size: 11px;
  display: block;
}
.agenda-item small {
  display: block;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.64);
}
.calendar-main {
  background: #fff;
  min-height: 720px;
  border: 1px solid #e6ebf3;
  overflow: hidden;
  border-radius: 16px;
}
.calendar-top {
  height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid #e1e7f0;
}
.calendar-top h2 {
  font-size: 18px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}
.calendar-top svg {
  width: 20px;
  color: #6d5cff;
}
.calendar-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}
.calendar-tabs a {
  height: 28px;
  padding: 0 13px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.calendar-tabs a.active {
  background: #846cff;
  color: #fff;
}
.month-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.month-label {
  height: 31px;
  background: #fafafa;
  border-right: 1px solid #e5e9f0;
  border-bottom: 1px solid #e5e9f0;
  padding: 9px 10px;
  color: #757d90;
  font-size: 10px;
  font-weight: 800;
}
.month-cell {
  height: 111px;
  border-right: 1px solid #e5e9f0;
  border-bottom: 1px solid #e5e9f0;
  padding: 11px 9px;
  position: relative;
  background: #fff;
}
.month-cell.focus {
  background: #f0efff;
}
.day-number {
  font-size: 14px;
  color: #9299a9;
}
.day-number.round {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #6d5cff;
  color: #fff;
  font-weight: 800;
}
.calendar-event {
  font-size: 10px;
  margin-top: 10px;
  border-left: 3px solid #48cdbd;
  background: #eefcf8;
  color: #2e9388;
  padding: 7px 8px;
}
.calendar-event.event-blue {
  border-color: #55bfff;
  background: #eff9ff;
  color: #3488c4;
}
.calendar-event.event-pink {
  border-color: #ff6287;
  background: #fff0f2;
  color: #d74d70;
}
.calendar-event.event-purple {
  border-color: #9a85ff;
  background: #f2efff;
  color: #715bda;
}
.week-calendar {
  display: grid;
  grid-template-columns: 49px repeat(7, 1fr);
}
.week-header {
  height: 73px;
  border-right: 1px solid #e5e9f0;
  border-bottom: 1px solid #e5e9f0;
  padding: 11px 9px;
  background: #fff;
}
.week-header span {
  display: block;
  color: #8e96a8;
  font-size: 11px;
  margin-bottom: 6px;
}
.week-header strong {
  font-size: 19px;
}
.week-header.selected {
  background: #e7e4ff;
  text-align: center;
}
.week-header.selected strong {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6d5cff;
  color: #fff;
}
.hour-col {
  height: 64px;
  border-right: 1px solid #e5e9f0;
  border-bottom: 1px solid #e5e9f0;
  color: #8e96a8;
  font-size: 10px;
  padding: 12px 7px;
}
.hour-col.spacer {
  height: 73px;
}
.week-slot {
  height: 64px;
  border-right: 1px solid #e5e9f0;
  border-bottom: 1px solid #e5e9f0;
  position: relative;
  background: #fff;
}
.week-slot.selected-col {
  background: #f0efff;
}
.calendar-event.tall {
  position: absolute;
  inset: 4px 8px auto;
  height: 56px;
  overflow: hidden;
}
.calendar-event.tall span {
  display: block;
  font-size: 8px;
}
.day-calendar {
  position: relative;
}
.day-title {
  height: 68px;
  background: #e8e4ff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-left: 40px;
}
.day-title span {
  font-size: 11px;
  color: #69738b;
}
.day-title strong {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6d5cff;
  color: #fff;
  font-size: 17px;
}
.day-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  min-height: 66px;
  border-bottom: 1px solid #e7ebf1;
}
.day-hour {
  border-right: 1px solid #e7ebf1;
  color: #8f98aa;
  font-size: 10px;
  padding: 11px 8px;
}
.day-events {
  position: relative;
}
.calendar-event.day {
  margin: 0;
  height: 53px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.calendar-event.day strong {
  font-size: 10px;
}
.calendar-event.day span {
  font-size: 11px;
}
.calendar-event.day small {
  font-size: 9px;
}
.card-panel {
  background: #fff;
  border: 1px solid #dfe5f0;
  box-shadow: var(--soft-shadow);
  border-radius: 6px;
}
.form-page {
  width: min(920px, 100%);
  margin: 0 auto;
}
.user-form {
  padding: 34px 23px 22px;
}
.user-form h2,
.settings-panel h2 {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 800;
}
.user-form p,
.settings-panel p {
  color: #929db1;
  font-size: 13px;
  margin: 0 0 25px;
}
.compact-fields {
  gap: 27px 46px;
  margin-bottom: 31px;
}
.functions-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.functions-line span {
  font-size: 16px;
  font-weight: 800;
}
.functions-line button,
.functions-add {
  color: #0088ff;
  font-weight: 800;
  font-size: 13px;
}
.muted {
  font-size: 12px !important;
  color: #9aa4b6 !important;
  margin: 4px 0 26px !important;
}
.permission-list {
  display: flex;
  flex-direction: column;
}
.permission-row {
  height: 58px;
  border-bottom: 1px solid #e4e9f2;
  display: grid;
  grid-template-columns: 1fr 180px;
  align-items: center;
  color: #2c364d;
}
.permission-row span {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 700;
}
.permission-row svg {
  color: #8c96a9;
}
.permission-row strong {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;
}
.settings-page {
  width: min(920px, 100%);
  margin: 0 auto;
}
.settings-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin-bottom: 35px;
}
.setting-card {
  height: 87px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  box-shadow: var(--soft-shadow);
  border: 1px solid transparent;
}
.setting-card.active {
  border-color: var(--purple);
}
.gradient-icon {
  width: 45px;
  height: 45px;
  border-radius: 9px;
  background: linear-gradient(135deg, #fc865c 0%, #8225ff 48%, #3b14d8 100%);
  box-shadow: 0 10px 19px rgba(74, 25, 255, 0.16);
}
.setting-card strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.setting-card span {
  display: block;
  font-size: 11px;
  color: #a1abc0;
  margin-top: 3px;
}
.settings-panel {
  min-height: 271px;
  padding: 28px 21px;
  position: relative;
}
.functions-add {
  position: absolute;
  top: 94px;
  right: 35px;
}
.permission-list.wide {
  margin-top: 72px;
}
.not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.not-found h1 {
  font-size: 90px;
  margin: 0;
}
.not-found a {
  color: var(--purple);
  font-weight: 800;
}
@media (max-width: 1180px) {
  .page-content {
    padding: 80px 28px 35px;
  }
  .topbar {
    right: 65px;
  }
  .stat-grid {
    gap: 18px;
  }
  .kanban-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .folder-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .settings-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .calendar-page {
    grid-template-columns: 1fr;
  }
  .calendar-sidebar {
    width: 100%;
    min-height: auto;
  }
  .mini-days {
    max-width: 360px;
  }
  .floating-actions {
    right: 40px;
  }
  .model-builder {
    grid-template-columns: 1fr;
  }
  .model-side {
    grid-template-columns: repeat(3, 1fr);
    display: grid;
  }
  .side-box {
    min-width: 0;
  }
}
@media (max-width: 760px) {
  body {
    font-size: 13px;
  }
  .mobile-menu {
    display: grid;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10;
    width: 43px;
    height: 43px;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--soft-shadow);
    place-items: center;
  }
  .mobile-logo {
    display: block;
    position: fixed;
    top: 25px;
    left: 72px;
    z-index: 38;
    font-weight: 800;
    color: #253261;
  }
  .sidebar {
    transform: translateX(-105%);
    transition: 0.25s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24, 30, 56, 0.28);
    z-index: 19;
  }
  .mobile-backdrop.show {
    display: block;
  }
  .page-area {
    margin-left: 0;
  }
  .page-content {
    padding: 86px 16px 25px;
  }
  .topbar {
    top: 14px;
    right: 14px;
    gap: 7px;
  }
  .searchbox {
    display: none;
  }
  .top-icon {
    display: none;
  }
  .avatar {
    width: 38px;
    height: 38px;
  }
  .page-title {
    font-size: 26px;
    margin-bottom: 30px;
  }
  .dashboard-actions {
    justify-content: stretch;
    flex-direction: column;
    margin-top: 0;
  }
  .btn,
  .btn.primary,
  .btn.ghost {
    width: 100%;
    min-width: 0;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card {
    height: 76px;
    padding: 0 15px;
    gap: 13px;
  }
  .kanban-grid {
    grid-template-columns: 1fr;
  }
  .lane-card {
    min-height: auto;
  }
  .modal-dialog {
    top: 70px;
    border-radius: 20px;
    width: calc(100vw - 18px);
  }
  .form-grid.two {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .modal-actions {
    padding: 0 20px;
  }
  .model-builder {
    width: 100%;
  }
  .model-side {
    display: flex;
  }
  .editor-paper {
    height: 420px;
    padding: 20px 16px;
  }
  .editor-toolbar {
    overflow: auto;
    gap: 12px;
  }
  .floating-actions {
    position: static;
    margin: -10px 0 18px;
    justify-content: flex-end;
  }
  .folder-grid {
    grid-template-columns: 1fr;
  }
  .models-page,
  .settings-page,
  .form-page {
    width: 100%;
  }
  .calendar-main {
    overflow: auto;
  }
  .month-calendar {
    min-width: 720px;
  }
  .week-calendar {
    min-width: 850px;
  }
  .day-calendar {
    min-width: 650px;
  }
  .calendar-sidebar {
    padding: 24px 17px;
    min-height: 0;
  }
  .settings-cards {
    grid-template-columns: 1fr;
  }
  .permission-row {
    grid-template-columns: 1fr 80px;
  }
  .login-card {
    padding: 30px 24px;
    border-radius: 22px;
  }
  .login-logo {
    width: 180px;
  }
  .login-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .model-name-row {
    font-size: 17px;
  }
  .calendar-top {
    min-width: 650px;
  }
  .table-shell {
    border-radius: 12px;
  }
  .topbar .avatar {
    display: block;
  }
}

/* Login v2 - referência visual enviada */
.login-screen-v2 {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #eef4fd;
  overflow: hidden;
}
.login-wrapper-v2 {
  width: min(940px, calc(100vw - 56px));
  min-height: 543px;
  display: grid;
  grid-template-columns: 530px 1fr;
  background: #fff;
  border-radius: 34px;
  box-shadow: 0 24px 80px rgba(29, 43, 88, 0.1);
  overflow: hidden;
}
.login-hero-v2 {
  position: relative;
  min-height: 543px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #172554 0%, #6D28D9 48%, #172554 100%);
  overflow: hidden;
}
.login-hero-v2::after {
  content: "";
  position: absolute;
  inset: auto -72px -122px auto;
  width: 365px;
  height: 365px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.hero-shape {
  position: absolute;
  display: block;
  border-radius: 50%;
  pointer-events: none;
}
.hero-shape-top {
  width: 432px;
  height: 432px;
  right: -118px;
  top: -204px;
  background: rgba(255, 255, 255, 0.13);
}
.hero-shape-bottom {
  width: 326px;
  height: 326px;
  left: -76px;
  bottom: -116px;
  background: rgba(255, 255, 255, 0.08);
}
.hero-brand-v2 {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}
.hero-logo-v2 {
  width: 304px;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.hero-brand-v2 p {
  margin: 22px 0 0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3.2px;
  opacity: 0.96;
}
.login-form-panel-v2 {
  background: #fff;
  padding: 54px 48px 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.login-form-logo-v2 {
  width: 176px;
  height: auto;
  display: block;
  margin: 0 0 0 0px;
}

.login-logo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-copy-v2 h1 {
  margin: 0 0 7px;
  color: #081a55;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.9px;
}
.login-copy-v2 p {
  margin: 0 0 28px;
  color: #97a1b8;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}
.login-form-v2 {
  width: 100%;
  max-width: 314px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-field-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-field-v2 span {
  color: #081a55;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}
.login-field-v2 input {
  width: 100%;
  height: 42px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #fff;
  color: #081a55;
  outline: 0;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.login-field-v2 input:focus {
  border-color: #4d26ff;
  box-shadow: 0 0 0 3px rgba(77, 38, 255, 0.1);
}
.login-options-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 5px 0 9px;
  color: #8c97af;
  font-size: 12px;
  line-height: 1;
}
.remember-v2 {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
}
.remember-v2 input {
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid #9ba4b4;
  accent-color: #4b22ff;
}
.login-options-v2 a {
  color: #3f19ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.login-submit-v2 {
  width: 100%;
  height: 43px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(90deg, #172554 0%, #6D28D9 100%);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 16px 27px rgba(66, 34, 255, 0.24);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.login-submit-v2:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 31px rgba(66, 34, 255, 0.3);
}
@media (max-width: 980px) {
  .login-screen-v2 {
    padding: 22px;
    background: #eef4fd;
  }
  .login-wrapper-v2 {
    width: min(720px, calc(100vw - 44px));
    grid-template-columns: 1fr;
  }
  .login-hero-v2 {
    min-height: 220px;
    border-radius: 0;
  }
  .hero-logo-v2 {
    width: 295px;
  }
  .hero-brand-v2 p {
    margin-top: 14px;
    font-size: 10px;
    letter-spacing: 2.7px;
  }
  .login-form-panel-v2 {
    align-items: center;
    padding: 38px 34px 42px;
  }
  .login-form-logo-v2 {
    margin-bottom: 34px;
  }
  .login-copy-v2 {
    text-align: left;
    width: 100%;
    max-width: 360px;
  }
  .login-form-v2 {
    max-width: 360px;
  }
}
@media (max-width: 560px) {
  .login-screen-v2 {
    padding: 14px;
    align-items: flex-start;
  }
  .login-wrapper-v2 {
    width: 100%;
    min-height: auto;
    border-radius: 24px;
  }
  .login-hero-v2 {
    min-height: 178px;
  }
  .hero-logo-v2 {
    width: 236px;
  }
  .hero-shape-top {
    width: 300px;
    height: 300px;
    right: -120px;
    top: -158px;
  }
  .hero-shape-bottom {
    width: 240px;
    height: 240px;
    left: -88px;
    bottom: -122px;
  }
  .login-form-panel-v2 {
    padding: 30px 22px 34px;
  }
  .login-form-logo-v2 {
    width: 154px;
    margin-bottom: 30px;
  }
  .login-copy-v2 h1 {
    font-size: 26px;
  }
  .login-options-v2 {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-top: 2px;
  }
  .login-form-v2 {
    max-width: none;
  }
}

/* Tema e idioma */
.brand-logo-dark,
.login-logo-dark,
.theme-icon-sun {
  display: none;
}
html[data-theme="dark"] .brand-logo-light,
html[data-theme="dark"] .login-logo-light,
html[data-theme="dark"] .theme-icon-moon {
  display: none;
}
html[data-theme="dark"] .brand-logo-dark,
html[data-theme="dark"] .login-logo-dark,
html[data-theme="dark"] .theme-icon-sun {
  display: block;
}
.language-control {
  height: 30px;
  min-width: 70px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  color: #a4aec2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}
.language-control svg {
  width: 15px;
  height: 15px;
}
.language-control select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.login-tools {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -24px 0 18px;
}
.login-tool-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: #a4aec2;
  display: grid;
  place-items: center;
  box-shadow: var(--soft-shadow);
}
.login-tool-btn svg {
  width: 16px;
  height: 16px;
}
.login-language {
  box-shadow: var(--soft-shadow);
}

html[data-theme="dark"] {
  --bg: #0b1222;
  --sidebar: #101a32;
  --card: #121f3a;
  --text: #edf3ff;
  --muted: #a8b4cf;
  --light: #17243f;
  --line: #263657;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .lane-card,
html[data-theme="dark"] .piece-card,
html[data-theme="dark"] .searchbox,
html[data-theme="dark"] .language-control,
html[data-theme="dark"] .folder-card,
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] .pagination,
html[data-theme="dark"] .calendar-main,
html[data-theme="dark"] .month-cell,
html[data-theme="dark"] .week-header,
html[data-theme="dark"] .week-slot,
html[data-theme="dark"] .editor-frame,
html[data-theme="dark"] .editor-paper,
html[data-theme="dark"] .model-name-row,
html[data-theme="dark"] .side-box,
html[data-theme="dark"] .card-panel,
html[data-theme="dark"] .setting-card,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .floating-actions button,
html[data-theme="dark"] .login-form-panel-v2,
html[data-theme="dark"] .login-wrapper-v2 {
  background: var(--card);
  color: var(--text);
}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .brand,
html[data-theme="dark"] .model-name-row,
html[data-theme="dark"] .editor-frame,
html[data-theme="dark"] .editor-add,
html[data-theme="dark"] .editor-toolbar,
html[data-theme="dark"] .word-count,
html[data-theme="dark"] .side-box,
html[data-theme="dark"] .side-box h3,
html[data-theme="dark"] .side-actions,
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] .models-table th,
html[data-theme="dark"] .models-table td,
html[data-theme="dark"] .calendar-main,
html[data-theme="dark"] .calendar-top,
html[data-theme="dark"] .month-label,
html[data-theme="dark"] .month-cell,
html[data-theme="dark"] .week-header,
html[data-theme="dark"] .week-slot,
html[data-theme="dark"] .hour-col,
html[data-theme="dark"] .day-row,
html[data-theme="dark"] .day-hour,
html[data-theme="dark"] .card-panel,
html[data-theme="dark"] .permission-row,
html[data-theme="dark"] .modal-actions {
  border-color: var(--line);
}
html[data-theme="dark"] .top-icon,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .searchbox,
html[data-theme="dark"] .searchbox input,
html[data-theme="dark"] .language-control select,
html[data-theme="dark"] .piece-card p,
html[data-theme="dark"] .piece-footer span,
html[data-theme="dark"] .models-table td,
html[data-theme="dark"] .file-cell span,
html[data-theme="dark"] .month-label,
html[data-theme="dark"] .day-number,
html[data-theme="dark"] .hour-col,
html[data-theme="dark"] .day-hour,
html[data-theme="dark"] .week-header span,
html[data-theme="dark"] .user-form p,
html[data-theme="dark"] .settings-panel p,
html[data-theme="dark"] .setting-card span,
html[data-theme="dark"] .modal-head p,
html[data-theme="dark"] .side-item,
html[data-theme="dark"] .word-count {
  color: #fff;
}
html[data-theme="dark"] .nav-link.active,
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .piece-card h3,
html[data-theme="dark"] .lane-card h2,
html[data-theme="dark"] .models-head h2,
html[data-theme="dark"] .folder-card strong,
html[data-theme="dark"] .models-table th,
html[data-theme="dark"] .file-cell strong,
html[data-theme="dark"] .calendar-top h2,
html[data-theme="dark"] .model-team,
html[data-theme="dark"] .model-name-row,
html[data-theme="dark"] .editor-paper,
html[data-theme="dark"] .side-box h3,
html[data-theme="dark"] .config-box label,
html[data-theme="dark"] .permission-row,
html[data-theme="dark"] .setting-card strong,
html[data-theme="dark"] .user-form h2,
html[data-theme="dark"] .settings-panel h2,
html[data-theme="dark"] .modal-head h2,
html[data-theme="dark"] .input-group,
html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] .full-field {
  color: var(--text);
}
html[data-theme="dark"] .month-label,
html[data-theme="dark"] .week-header.selected,
html[data-theme="dark"] .week-slot.selected-col,
html[data-theme="dark"] .month-cell.focus,
html[data-theme="dark"] .day-title {
  background: #17243f;
}
html[data-theme="dark"] .stat-icon,
html[data-theme="dark"] .folder-card span {
  background: #1d2b4a;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input-group input,
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .full-field select,
html[data-theme="dark"] .side-content select,
html[data-theme="dark"] .login-field-v2 input {
  color: var(--text);
  background: #0e1830;
  border-color: var(--line);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] .searchbox input::placeholder {
  color: #6f7c99;
}
html[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.58);
}
html[data-theme="dark"] .calendar-event {
  background: rgba(72, 205, 189, 0.14);
}
html[data-theme="dark"] .calendar-event.event-blue {
  background: rgba(85, 191, 255, 0.14);
}
html[data-theme="dark"] .calendar-event.event-pink {
  background: rgba(255, 98, 135, 0.14);
}
html[data-theme="dark"] .calendar-event.event-purple {
  background: rgba(154, 133, 255, 0.14);
}
html[data-theme="dark"] .login-screen-v2 {
  background: #0b1222;
}
html[data-theme="dark"] .login-copy-v2 h1,
html[data-theme="dark"] .login-field-v2 span {
  color: var(--text);
}
html[data-theme="dark"] .login-copy-v2 p,
html[data-theme="dark"] .login-options-v2 {
  color: var(--muted);
}
html[data-theme="dark"] .login-tool-btn,
html[data-theme="dark"] .login-language {
  background: #0e1830;
  color: var(--muted);
}
html[data-theme="dark"] .mobile-menu {
  background: var(--card);
  color: var(--text);
}
@media (max-width: 760px) {
  .language-control {
    min-width: 64px;
  }
  .login-tools {
    margin-top: -14px;
  }
}
@media (max-width: 760px) {
  .top-icon.theme-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--soft-shadow);
  }
  html[data-theme="dark"] .top-icon.theme-toggle {
    background: var(--card);
  }
}

/* Novo Modelo funcional */
.model-builder-v2 {
  grid-template-columns: minmax(0, 1fr) 280px;
}
.model-meta-form {
  display: grid;
  grid-template-columns: 170px minmax(260px, 1fr) 160px;
  gap: 14px;
  margin-bottom: 18px;
}
.model-meta-form label,
.variable-create-form label,
.generated-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #2b354f;
}
.model-meta-form input,
.model-meta-form select,
.variable-create-form input,
.variable-create-form select,
.generated-field input,
.generated-field textarea,
.generated-field select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #dce2ed;
  border-radius: 12px;
  background: #fff;
  color: #2d354f;
  outline: none;
  padding: 0 13px;
  font-size: 13px;
  box-shadow: 0 7px 18px rgba(37, 50, 97, 0.04);
}
.model-meta-form input:focus,
.model-meta-form select:focus,
.variable-create-form input:focus,
.variable-create-form select:focus,
.generated-field input:focus,
.generated-field textarea:focus,
.generated-field select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(74, 25, 255, 0.08);
}
.editor-actions-v2 {
  gap: 9px;
  flex-wrap: wrap;
  height: auto;
  min-height: 49px;
  padding: 10px 13px;
}
.editor-toolbar button {
  border: 1px solid #e6ebf4;
  min-width: 28px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #53617a;
}
.editor-toolbar button:hover,
.editor-actions-v2 button:hover,
.variable-chip:hover,
.side-submit:hover,
.test-actions button:hover {
  transform: translateY(-1px);
}
.editor-paper code,
.generated-preview code,
.test-form-panel code {
  background: #f4f2ff;
  color: var(--purple);
  border-radius: 6px;
  padding: 2px 5px;
  font-weight: 800;
}
.model-side-v2 {
  gap: 15px;
}
.variable-chip {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px;
  justify-content: flex-start;
  text-align: left;
  transition: 0.2s;
}
.variable-chip small {
  margin-left: auto;
  color: #8d98ad;
  font-size: 10px;
  font-weight: 800;
}
.variable-chip:hover {
  border-color: #ddd6ff;
  background: #f8f6ff;
  color: var(--purple);
}
.variable-create-form {
  padding: 14px 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.variable-create-form input,
.variable-create-form select,
.variable-options-list input {
  min-height: 38px;
  border-radius: 10px;
  font-size: 12px;
}
.variable-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.variable-create-form small {
  color: #7b879d;
  line-height: 1.35;
  font-weight: 700;
}
.generated-field select {
  appearance: auto;
}
.divside-submit {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.side-submit {
  height: 38px;
  border-radius: 12px;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(74, 25, 255, 0.17);
  margin: 10px;
}
.model-help-box p {
  margin: 0;
  color: #647089;
  line-height: 1.45;
  font-size: 12px;
}
.test-form-panel {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #dce2ed;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(42, 55, 102, 0.05);
  padding: 20px;
}
.test-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f4f2ff;
  color: var(--purple);
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.test-panel-head h2 {
  margin: 10px 0 7px;
  font-size: 20px;
  letter-spacing: -0.6px;
}
.test-panel-head p {
  margin: 0;
  color: #748098;
  max-width: 620px;
  line-height: 1.5;
}
.test-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn.small {
  height: 36px;
  min-width: auto;
  padding: 0 16px;
  border-radius: 10px;
}
.generated-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 18px;
}
.generated-field textarea {
  padding-top: 12px;
  min-height: 92px;
  resize: vertical;
}
.generated-field small {
  color: #8d98ad;
  font-weight: 700;
}
.generated-fields-empty {
  grid-column: 1 / -1;
  border: 1px dashed #cfd7e7;
  border-radius: 14px;
  padding: 18px;
  color: #748098;
  background: #fbfcff;
}
.generated-preview-wrap {
  margin-top: 20px;
  border: 1px solid #e4e9f3;
  border-radius: 15px;
  overflow: hidden;
}
.preview-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid #e4e9f3;
  background: #fbfcff;
}
.preview-head span {
  color: #7d879b;
  font-size: 12px;
}
.generated-preview {
  min-height: 180px;
  padding: 23px;
  background: #fff;
  color: #2d354f;
  line-height: 1.65;
  overflow: auto;
}
.generated-preview.empty {
  color: #8d98ad;
}
.generated-preview h2 {
  text-align: center;
  margin-top: 0;
}
.generated-preview mark {
  background: #fff1b8;
  color: #2d354f;
  padding: 1px 3px;
  border-radius: 4px;
}
.model-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  background: #202c4a;
  color: #fff;
  border-radius: 14px;
  padding: 12px 15px;
  box-shadow: 0 16px 34px rgba(32, 44, 74, 0.25);
  font-size: 12px;
  font-weight: 800;
}
html[data-theme="dark"] .model-meta-form input,
html[data-theme="dark"] .model-meta-form select,
html[data-theme="dark"] .variable-create-form input,
html[data-theme="dark"] .variable-create-form select,
html[data-theme="dark"] .generated-field input,
html[data-theme="dark"] .generated-field textarea,
html[data-theme="dark"] .generated-field select,
html[data-theme="dark"] .test-form-panel,
html[data-theme="dark"] .generated-preview,
html[data-theme="dark"] .generated-preview-wrap,
html[data-theme="dark"] .preview-head,
html[data-theme="dark"] .generated-fields-empty {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] .model-meta-form label,
html[data-theme="dark"] .variable-create-form label,
html[data-theme="dark"] .generated-field,
html[data-theme="dark"] .test-panel-head h2,
html[data-theme="dark"] .preview-head strong {
  color: var(--text);
}
html[data-theme="dark"] .test-panel-head p,
html[data-theme="dark"] .model-help-box p,
html[data-theme="dark"] .preview-head span,
html[data-theme="dark"] .generated-field small {
  color: var(--muted);
}
html[data-theme="dark"] .variable-chip:hover,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .editor-paper code,
html[data-theme="dark"] .generated-preview code,
html[data-theme="dark"] .test-form-panel code {
  background: #201a4d;
}
@media (max-width: 1180px) {
  .model-builder-v2 {
    grid-template-columns: 1fr;
  }
  .model-side-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .model-meta-form,
  .generated-fields {
    grid-template-columns: 1fr;
  }
  .test-panel-head {
    flex-direction: column;
  }
  .test-actions,
  .test-actions .btn {
    width: 100%;
  }
}
@media (max-width: 760px) {
  .model-side-v2 {
    display: flex;
  }
  .test-form-panel {
    padding: 16px;
  }
  .preview-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }
}

/* Condicionais funcionais - Novo Modelo */
.conditional-box {
  overflow: visible;
}
.conditional-create-form {
  padding: 14px 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.conditional-create-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  color: #2b354f;
}
.conditional-create-form input,
.conditional-create-form select,
.conditional-create-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dce2ed;
  border-radius: 10px;
  background: #fff;
  color: #2d354f;
  outline: none;
  padding: 0 12px;
  font-size: 12px;
  box-shadow: 0 7px 18px rgba(37, 50, 97, 0.04);
}
.conditional-create-form textarea {
  min-height: 78px;
  padding-top: 10px;
  resize: vertical;
  line-height: 1.45;
}
.conditional-create-form input:focus,
.conditional-create-form select:focus,
.conditional-create-form textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(74, 25, 255, 0.08);
}
.conditional-list {
  padding: 0 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.conditional-empty {
  border: 1px dashed #cfd7e7;
  border-radius: 12px;
  padding: 12px;
  color: #748098;
  font-size: 12px;
  line-height: 1.4;
  background: #fbfcff;
}
.conditional-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e4e9f3;
  border-radius: 12px;
  padding: 9px 10px;
  background: #fbfcff;
}
.conditional-list-item span {
  color: #2b354f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}
.conditional-list-item button {
  border-radius: 999px;
  min-height: 25px;
  padding: 0 10px;
  background: #fff0f0;
  color: #c0392b;
  font-size: 10px;
  font-weight: 900;
}
.conditional-template-block {
  margin: 16px 0;
  border: 1px solid #d9def0;
  border-radius: 16px;
  overflow: hidden;
  background: #fbfcff;
  box-shadow: 0 9px 18px rgba(42, 55, 102, 0.05);
}
.conditional-template-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid #e4e9f3;
  background: #f4f2ff;
}
.conditional-template-head strong {
  color: var(--purple);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.conditional-template-head span {
  color: #2d354f;
  font-size: 13px;
  font-weight: 900;
}
.conditional-template-branch {
  padding: 12px 14px;
}
.conditional-template-branch + .conditional-template-branch {
  border-top: 1px dashed #dce2ed;
}
.conditional-template-branch small {
  display: inline-flex;
  margin-bottom: 7px;
  color: #748098;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.conditional-template-branch.true {
  background: #ffffff;
}
.conditional-template-branch.false {
  background: #fffaf0;
}
.conditional-template-branch p {
  margin: 0 0 8px;
}
.conditional-template-branch p:last-child {
  margin-bottom: 0;
}
html[data-theme="dark"] .conditional-create-form input,
html[data-theme="dark"] .conditional-create-form select,
html[data-theme="dark"] .conditional-create-form textarea,
html[data-theme="dark"] .conditional-empty,
html[data-theme="dark"] .conditional-list-item,
html[data-theme="dark"] .conditional-template-block,
html[data-theme="dark"] .conditional-template-branch.true {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] .conditional-create-form label,
html[data-theme="dark"] .conditional-list-item span,
html[data-theme="dark"] .conditional-template-head span {
  color: var(--text);
}
html[data-theme="dark"] .conditional-template-head,
html[data-theme="dark"] .conditional-template-branch.false {
  background: #201a4d;
}
html[data-theme="dark"] .conditional-empty,
html[data-theme="dark"] .conditional-template-branch small {
  color: var(--muted);
}

/* Condicionais inline/editáveis */
.side-submit.secondary {
  background: #f6f8fc;
  color: #2b354f;
  border: 1px solid #dce2ed;
  box-shadow: none;
}
.side-submit.secondary:hover {
  background: #eef2fb;
}
.conditional-list-item.selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(74, 25, 255, 0.08);
}
.conditional-list-main {
  flex: 1;
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border-radius: 8px;
  background: transparent !important;
  color: #2b354f !important;
  text-align: left;
}
.conditional-list-main small {
  flex: 0 0 auto;
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.35;
}
.conditional-list-main span {
  display: block;
}
.conditional-remove {
  flex: 0 0 auto;
  border-radius: 999px;
  min-height: 25px;
  padding: 0 10px;
  background: #fff0f0 !important;
  color: #c0392b !important;
  font-size: 10px;
  font-weight: 900;
}
.conditional-template-block.selected {
  border-color: var(--purple);
  box-shadow:
    0 0 0 4px rgba(74, 25, 255, 0.08),
    0 9px 18px rgba(42, 55, 102, 0.05);
}
html[data-theme="dark"] .side-submit.secondary,
html[data-theme="dark"] .conditional-list-main {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--line);
}

/* Condicional digitada por marcador: {{#nome_variavel}} */
.conditional-selected-title {
  display: flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid #e4e9f3;
  border-radius: 12px;
  background: #f4f2ff;
  color: var(--purple);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}
.conditional-list-main {
  flex-direction: column;
  gap: 2px;
}
.conditional-list-main > span {
  font-size: 13px;
  color: var(--purple);
}
.conditional-list-main > small {
  color: #748098;
  font-size: 10px;
  font-weight: 800;
}
html[data-theme="dark"] .conditional-selected-title {
  background: #201a4d;
  border-color: var(--line);
  color: var(--text);
}

/* Estado inicial: configuração de condicional aparece só após clique na lista */
.conditional-create-form[hidden],
[data-new-conditional-form][hidden] {
  display: none !important;
}
.conditional-create-form {
  border-top: 1px solid #eef2fb;
  margin-top: 4px;
}

/* Ajustes Novo Modelo: formatação, visibilidade de variáveis e seções recolhíveis */
.editor-toolbar {
  gap: 7px;
  flex-wrap: wrap;
  height: auto;
  min-height: 46px;
  padding: 9px 13px;
}
.editor-toolbar select {
  min-height: 28px;
  border: 1px solid #e6ebf4;
  border-radius: 8px;
  background: #fff;
  color: #53617a;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}
.editor-toolbar button {
  padding: 0 9px;
  width: auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}
.editor-toolbar button[title="Limpar formatação"] {
  min-width: 56px;
}
.editor-paper blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--purple);
  background: #f8f6ff;
  border-radius: 10px;
}
.generated-field-output {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 2px;
  padding: 9px 10px;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #fbfcff;
  color: #647089;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
}
.generated-field-output input {
  width: 15px;
  min-height: auto;
  height: 15px;
  margin: 1px 0 0;
  padding: 0;
  box-shadow: none;
  accent-color: var(--purple);
}
.generated-field-output span {
  display: block;
  color: inherit;
}
.side-box-toggle {
  width: 100%;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  background: transparent;
  color: #2d354f;
  border-bottom: 1px solid #f0f3f8;
  text-align: left;
}
.side-box-toggle span {
  font-size: 13px;
  font-weight: 900;
}
.side-box-toggle small {
  min-width: 58px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #f4f2ff;
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
}
.collapsible-side-box.collapsed .side-box-toggle {
  border-bottom-color: transparent;
}
.side-collapse-content[hidden] {
  display: none !important;
}
html[data-theme="dark"] .editor-toolbar select,
html[data-theme="dark"] .generated-field-output,
html[data-theme="dark"] .side-box-toggle {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] .side-box-toggle small,
html[data-theme="dark"] .editor-paper blockquote {
  background: #201a4d;
}
@media (max-width: 760px) {
  .editor-toolbar button {
    flex: 1 1 auto;
  }
  .editor-toolbar select {
    width: 100%;
  }
}

/* Editor avançado do Novo Modelo */
.editor-actions-compact {
  justify-content: flex-end;
}
.editor-toolbar-advanced {
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
}
.editor-toolbar-advanced .toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid #edf1f7;
  border-radius: 12px;
  background: #fbfcff;
}
.editor-toolbar-advanced select,
.editor-toolbar-advanced button,
.editor-toolbar-advanced .toolbar-color {
  min-height: 31px;
}
.editor-toolbar-advanced select {
  max-width: 165px;
}
.editor-toolbar-advanced button {
  border-radius: 9px;
  border: 1px solid #e6ebf4;
  background: #fff;
  color: #38445f;
  min-width: 32px;
}
.editor-toolbar-advanced button:hover {
  border-color: var(--purple);
  color: var(--purple);
  transform: translateY(-1px);
}
.toolbar-color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid #e6ebf4;
  border-radius: 9px;
  background: #fff;
  color: #38445f;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.toolbar-color input[type="color"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.editor-paper pre {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f6fb;
  color: #27324a;
  white-space: pre-wrap;
  font-family: "Courier New", monospace;
}
.editor-paper h1,
.editor-paper h2,
.editor-paper h3,
.editor-paper h4 {
  color: #1f2a44;
}
html[data-theme="dark"] .editor-toolbar-advanced .toolbar-group,
html[data-theme="dark"] .editor-toolbar-advanced button,
html[data-theme="dark"] .toolbar-color,
html[data-theme="dark"] .editor-paper pre {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="dark"] .editor-paper h1,
html[data-theme="dark"] .editor-paper h2,
html[data-theme="dark"] .editor-paper h3,
html[data-theme="dark"] .editor-paper h4 {
  color: var(--text);
}
@media (max-width: 760px) {
  .editor-toolbar-advanced .toolbar-group,
  .editor-toolbar-advanced select,
  .editor-toolbar-advanced button,
  .editor-toolbar-advanced .toolbar-color {
    width: 100%;
  }
  .editor-toolbar-advanced .toolbar-color {
    justify-content: space-between;
  }
}

/* Prazos funcionais */
.deadline-page {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.deadline-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f1ff 100%);
  border: 1px solid #e4e8f3;
  box-shadow: var(--soft-shadow);
  border-radius: 24px;
  padding: 24px;
}
.deadline-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(109, 92, 255, 0.12);
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}
.deadline-hero h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: #202948;
}
.deadline-hero p {
  margin: 7px 0 0;
  color: #717b92;
  font-size: 14px;
}
.deadline-primary,
.deadline-secondary,
.deadline-danger {
  min-height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 850;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.deadline-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 15px 30px rgba(109, 92, 255, 0.25);
}
.deadline-secondary {
  background: #f5f7fb;
  color: #4e5870;
  border: 1px solid #e2e8f2;
}
.deadline-danger {
  background: #fff0f2;
  color: #d14f61;
  border: 1px solid #ffd7dd;
}
.deadline-primary:hover,
.deadline-secondary:hover,
.deadline-danger:hover {
  transform: translateY(-1px);
}
.deadline-primary svg {
  width: 18px;
  height: 18px;
}
.deadline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}
.deadline-calendar-card,
.deadline-day-panel {
  background: #fff;
  border: 1px solid #e3e8f2;
  box-shadow: var(--soft-shadow);
  border-radius: 24px;
  overflow: hidden;
}
.deadline-toolbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #e7ebf3;
}
.deadline-month-control {
  display: flex;
  align-items: center;
  gap: 13px;
}
.deadline-month-control strong {
  min-width: 190px;
  text-align: center;
  color: #202948;
  font-size: 20px;
  font-weight: 900;
  text-transform: capitalize;
}
.deadline-month-control button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f5f7fb;
  color: var(--purple);
}
.deadline-month-control svg {
  width: 18px;
  height: 18px;
}
.deadline-actions-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-only {
  display: none;
}
.deadline-weekdays,
.deadline-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.deadline-weekdays span {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #fbfcfe;
  border-right: 1px solid #e8edf4;
  border-bottom: 1px solid #e8edf4;
  color: #7f889b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.deadline-day-cell {
  min-height: 124px;
  padding: 10px;
  border-right: 1px solid #e8edf4;
  border-bottom: 1px solid #e8edf4;
  background: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #27314f;
}
.deadline-day-cell.is-muted {
  background: #fbfcfe;
  color: #adb4c2;
}
.deadline-day-cell.is-today {
  background: #f5f3ff;
}
.deadline-day-cell.is-selected {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
  background: #f1efff;
}
.deadline-day-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}
.deadline-day-cell.is-today .deadline-day-number {
  background: var(--purple);
  color: #fff;
}
.deadline-event-chip {
  width: 100%;
  border-radius: 9px;
  padding: 6px 7px;
  color: #25304d;
  background: #f3f6fb;
  font-size: 10px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.deadline-event-chip::before,
.deadline-dot {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #6d5cff;
}
.deadline-event-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deadline-more {
  font-size: 10px;
  color: #707a91;
  font-weight: 800;
  padding-left: 6px;
}
.deadline-day-panel {
  padding: 20px;
  position: sticky;
  top: 92px;
}
.deadline-day-head {
  border-bottom: 1px solid #e8edf4;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.deadline-day-head span {
  display: block;
  color: #7f889b;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: capitalize;
}
.deadline-day-head strong {
  display: block;
  color: #202948;
  font-size: 22px;
  font-weight: 900;
}
.deadline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}
.deadline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f7f9fd;
  color: #5f697d;
  font-size: 11px;
  font-weight: 800;
}
.deadline-day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deadline-empty {
  border: 1px dashed #ccd5e5;
  border-radius: 16px;
  padding: 18px;
  color: #7f889b;
  font-size: 13px;
  text-align: center;
  background: #fbfcfe;
}
.deadline-agenda-card {
  border: 1px solid #e7ebf3;
  border-left: 5px solid #6d5cff;
  border-radius: 16px;
  padding: 13px;
  background: #fff;
}
.deadline-agenda-card h4 {
  margin: 4px 0 7px;
  color: #202948;
  font-size: 14px;
  font-weight: 900;
}
.deadline-agenda-card,
.deadline-event-chip {
  --deadline-event-color: #6d5cff;
}

/* Cores */
.deadline-agenda-card.color-red,
.deadline-event-chip.color-red {
  --deadline-event-color: #ff5a6b;
}

.deadline-agenda-card.color-purple,
.deadline-event-chip.color-purple {
  --deadline-event-color: #8068ff;
}

.deadline-agenda-card.color-blue,
.deadline-event-chip.color-blue {
  --deadline-event-color: #3bb5ff;
}

.deadline-agenda-card.color-orange,
.deadline-event-chip.color-orange {
  --deadline-event-color: #ffae42;
}

.deadline-agenda-card.color-green,
.deadline-event-chip.color-green {
  --deadline-event-color: #20c997;
}

.deadline-agenda-card.color-pink,
.deadline-event-chip.color-pink {
  --deadline-event-color: #ff74aa;
}
.deadline-agenda-card {
  position: relative;
  overflow: hidden;
  padding-left: 1.25rem;
  border-left: none;
}

.deadline-agenda-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--deadline-event-color);
}
.deadline-event-chip {
  position: relative;
  overflow: hidden;
  padding-left: 12px;
}

.deadline-event-chip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  border-radius: 999px;
  background: var(--deadline-event-color);
}
.color-red,
.deadline-event-chip.color-red::before {
  background: #ff5a6b;
}
.deadline-agenda-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #7a8497;
  font-size: 11px;
  font-weight: 750;
}
.deadline-agenda-description {
  margin: 9px 0 0;
  color: #69738a;
  font-size: 12px;
  line-height: 1.45;
}
.deadline-agenda-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.deadline-agenda-actions button {
  min-height: 30px;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 850;
  background: #f5f7fb;
  color: #4e5870;
}
.color-red,
.deadline-event-chip.color-red::before {
  background: #ff5a6b;
}
.color-purple,
.deadline-event-chip.color-purple::before {
  background: #8068ff;
}
.color-blue,
.deadline-event-chip.color-blue::before {
  background: #3bb5ff;
}
.color-orange,
.deadline-event-chip.color-orange::before {
  background: #ffae42;
}
.color-green,
.deadline-event-chip.color-green::before {
  background: #20c997;
}
.color-pink,
.deadline-event-chip.color-pink::before {
  background: #ff74aa;
}
.deadline-agenda-card.color-red {
  border-left-color: #ff5a6b;
}
.deadline-agenda-card.color-purple {
  border-left-color: #8068ff;
}
.deadline-agenda-card.color-blue {
  border-left-color: #3bb5ff;
}
.deadline-agenda-card.color-orange {
  border-left-color: #ffae42;
}
.deadline-agenda-card.color-green {
  border-left-color: #20c997;
}
.deadline-agenda-card.color-pink {
  border-left-color: #ff74aa;
}
.deadline-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}
.deadline-modal.open {
  display: block;
}
.deadline-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 22, 43, 0.34);
  backdrop-filter: blur(3px);
}
.deadline-modal-card {
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 35px 80px rgba(19, 24, 50, 0.24);
  padding: 24px;
}
.deadline-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.deadline-modal-head h3 {
  margin: 0;
  color: #202948;
  font-size: 20px;
  font-weight: 900;
}
.deadline-modal-head p {
  margin: 5px 0 0;
  color: #7a8497;
  font-size: 13px;
}
.deadline-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #8d96a8;
  background: #f5f7fb;
  font-size: 28px;
  line-height: 1;
}
.deadline-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.deadline-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #27314f;
  font-size: 13px;
  font-weight: 850;
}
.deadline-field.full {
  margin-bottom: 16px;
}
.deadline-field input,
.deadline-field select,
.deadline-field textarea {
  width: 100%;
  border: 1px solid #dfe6f1;
  border-radius: 13px;
  background: #fbfcfe;
  color: #27314f;
  outline: 0;
  padding: 12px 13px;
  font-size: 14px;
}
.deadline-field input,
.deadline-field select {
  min-height: 45px;
}
.deadline-field textarea {
  resize: vertical;
  min-height: 96px;
}
.deadline-field input:focus,
.deadline-field select:focus,
.deadline-field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(109, 92, 255, 0.12);
}
.deadline-modal-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid #e7ebf3;
}
.deadline-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  background: #202948;
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 18px 35px rgba(18, 24, 47, 0.2);
}
html[data-theme="dark"] .deadline-hero,
html[data-theme="dark"] .deadline-calendar-card,
html[data-theme="dark"] .deadline-day-panel,
html[data-theme="dark"] .deadline-modal-card,
html[data-theme="dark"] .deadline-agenda-card {
  background: #1c2235;
  border-color: #30384f;
}
html[data-theme="dark"] .deadline-hero {
  background: linear-gradient(135deg, #1c2235 0%, #242344 100%);
}
html[data-theme="dark"] .deadline-hero h2,
html[data-theme="dark"] .deadline-month-control strong,
html[data-theme="dark"] .deadline-day-head strong,
html[data-theme="dark"] .deadline-agenda-card h4,
html[data-theme="dark"] .deadline-modal-head h3,
html[data-theme="dark"] .deadline-field,
html[data-theme="dark"] .deadline-field input,
html[data-theme="dark"] .deadline-field select,
html[data-theme="dark"] .deadline-field textarea {
  color: #eef2ff;
}
html[data-theme="dark"] .deadline-day-cell,
html[data-theme="dark"] .deadline-weekdays span,
html[data-theme="dark"] .deadline-field input,
html[data-theme="dark"] .deadline-field select,
html[data-theme="dark"] .deadline-field textarea,
html[data-theme="dark"] .deadline-secondary,
html[data-theme="dark"] .deadline-month-control button,
html[data-theme="dark"] .deadline-close,
html[data-theme="dark"] .deadline-legend span,
html[data-theme="dark"] .deadline-empty,
html[data-theme="dark"] .deadline-agenda-actions button {
  background: #151b2b;
  border-color: #30384f;
}
html[data-theme="dark"] .deadline-day-cell.is-muted {
  background: #111827;
  color: #66708a;
}
html[data-theme="dark"] .deadline-day-cell.is-today,
html[data-theme="dark"] .deadline-day-cell.is-selected {
  background: #252047;
}
html[data-theme="dark"] .deadline-toolbar,
html[data-theme="dark"] .deadline-weekdays span,
html[data-theme="dark"] .deadline-day-cell,
html[data-theme="dark"] .deadline-day-head,
html[data-theme="dark"] .deadline-modal-actions,
html[data-theme="dark"] .deadline-agenda-card {
  border-color: #30384f;
}
@media (max-width: 1180px) {
  .deadline-layout {
    grid-template-columns: 1fr;
  }
  .deadline-day-panel {
    position: static;
  }
}
@media (max-width: 760px) {
  .deadline-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }
  .deadline-hero h2 {
    font-size: 22px;
  }
  .deadline-primary,
  .deadline-secondary,
  .deadline-danger {
    width: 100%;
  }
  .deadline-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .deadline-month-control {
    justify-content: space-between;
  }
  .deadline-month-control strong {
    min-width: 0;
    font-size: 17px;
  }
  .deadline-actions-inline {
    width: 100%;
  }
  .deadline-actions-inline .deadline-secondary {
    flex: 1;
  }
  .mobile-only {
    display: inline-flex;
  }
  .deadline-weekdays,
  .deadline-calendar-grid {
    min-width: 0;
  }
  .deadline-weekdays span {
    justify-content: center;
    padding: 0;
    font-size: 10px;
  }
  .deadline-day-cell {
    min-height: 86px;
    padding: 7px;
  }
  .deadline-day-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .deadline-event-chip {
    min-height: 10px;
    padding: 4px;
  }
  .deadline-event-chip span {
    display: none;
  }
  .deadline-more {
    display: none;
  }
  .deadline-day-panel {
    padding: 16px;
  }
  .deadline-form-grid {
    grid-template-columns: 1fr;
  }
  .deadline-modal-card {
    top: 12px;
    width: calc(100vw - 18px);
    max-height: calc(100vh - 24px);
    padding: 18px;
    border-radius: 20px;
  }
  .deadline-modal-actions {
    grid-template-columns: 1fr;
  }
  .deadline-modal-actions span {
    display: none;
  }
}

/* Cadastro e Configuração administrativos preservando o visual base */
.admin-cadastro-page {
  width: min(980px, 100%);
  margin: 0 auto;
}
.admin-list-panel,
.admin-config-panel {
  overflow: hidden;
}
.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.admin-panel-head h2 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--text);
}
.admin-panel-head p {
  margin: 0;
  font-size: 12px;
  color: #98a3b8;
}
.admin-inline-add.functions-add {
  position: static;
  height: 35px;
  border-radius: 18px;
  padding: 0 16px;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(74, 25, 255, 0.18);
}
.admin-tab-panel {
  display: none;
}
.admin-tab-panel.active {
  display: block;
}
.setting-card {
  cursor: pointer;
  transition: 0.2s ease;
}
.setting-card:hover {
  transform: translateY(-2px);
}
.admin-table-shell {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #edf0f6;
  box-shadow: var(--soft-shadow);
  overflow: auto;
}
.admin-table th:last-child,
.admin-table td:last-child {
  text-align: right;
  min-width: 150px;
}
.admin-table td {
  vertical-align: middle;
}
.admin-user-cell strong,
.admin-model-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #26324b;
}
.admin-user-cell span,
.admin-model-cell span,
.admin-muted {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #9ba6bb;
}
.admin-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 14px;
  background: #f3f0ff;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
}
.admin-pill.blue {
  background: #edf7ff;
  color: #0088ff;
}
.admin-pill.green {
  background: #edfbf7;
  color: #18a987;
}
.admin-pill.orange {
  background: #fff4ea;
  color: #e7772d;
}
.admin-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
/* ================================
   PADRONIZAR CORES DOS BOTÕES
   EDITAR / EXCLUIR
================================ */

/* MODELOS - página de modelos */
.model-row-actions .admin-icon-btn:nth-child(2) {
  color: var(--purple) !important;
}

.model-row-actions .admin-icon-btn:nth-child(3) {
  color: var(--red) !important;
}

/* CADASTRO / CONFIGURAÇÕES - usuários */
.admin-icon-btn[data-admin-edit-user] {
  color: var(--purple) !important;
}

.admin-icon-btn[data-admin-delete-user] {
  color: var(--red) !important;
}

/* CONFIGURAÇÕES - equipes */
.admin-icon-btn[data-admin-edit-team] {
  color: var(--purple) !important;
}

.admin-icon-btn[data-admin-delete-team] {
  color: var(--red) !important;
}

/* CONFIGURAÇÕES - modelos */
.admin-icon-btn[data-admin-edit-model],
.admin-icon-btn[data-admin-edit-juris] {
  color: var(--purple) !important;
}

.admin-icon-btn[data-admin-delete-model],
.admin-icon-btn[data-admin-delete-juris] {
  color: var(--red) !important;
}

/* Garante que o SVG acompanhe a cor do botão */
.admin-icon-btn svg,
.admin-icon-btn svg path {
  stroke: currentColor !important;
}
/* Hover editar */
.model-row-actions .admin-icon-btn:nth-child(2):hover,
.admin-icon-btn[data-admin-edit-user]:hover,
.admin-icon-btn[data-admin-edit-team]:hover,
.admin-icon-btn[data-admin-edit-model]:hover,
.admin-icon-btn[data-admin-edit-juris]:hover {
  background: color-mix(in srgb, var(--purple) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--purple) 35%, transparent) !important;
  color: var(--purple) !important;
}

/* Hover excluir */
.model-row-actions .admin-icon-btn:nth-child(3):hover,
.admin-icon-btn[data-admin-delete-user]:hover,
.admin-icon-btn[data-admin-delete-team]:hover,
.admin-icon-btn[data-admin-delete-model]:hover,
.admin-icon-btn[data-admin-delete-juris]:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--red) 35%, transparent) !important;
  color: var(--red) !important;
}
.admin-icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  border: 1px solid #e6ebf4;
  color: #7b879d;
  display: inline-grid;
  place-items: center;
  background: #fff;
}
.admin-icon-btn svg {
  width: 15px;
  height: 15px;
}
.admin-icon-btn.danger {
  color: #ff5f73;
}
.admin-empty {
  padding: 26px;
  color: #9ba6bb;
  font-size: 12px;
  text-align: center;
}
.admin-modal-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.admin-small-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.admin-modal .form-grid label,
.admin-modal .full-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #313b55;
  font-size: 11px;
  font-weight: 800;
}
.admin-modal input,
.admin-modal select,
.admin-modal textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e1e7f1;
  border-radius: 12px;
  padding: 0 13px;
  color: #24304a;
  background: #fff;
  outline: 0;
}
.admin-modal .wide {
  grid-column: 1 / -1;
}
.admin-modal-block {
  margin-top: 24px;
}
.admin-modal-block > strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #2f3951;
  margin-bottom: 12px;
}
.admin-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-check-grid label {
  min-height: 42px;
  border: 1px solid #e7ecf5;
  border-radius: 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #3d4863;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
}
.admin-check-grid input {
  width: auto;
  min-height: auto;
  accent-color: var(--purple);
}
.admin-modal-actions .btn.ghost {
  min-width: 120px;
  height: 38px;
}
.admin-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.admin-team-card {
  min-height: 112px;
  border: 1px solid #edf0f6;
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 15px;
}
.admin-team-card strong {
  font-size: 14px;
  font-weight: 800;
  color: #27324b;
}
.admin-team-card span {
  font-size: 11px;
  color: #9ba6bb;
}
.admin-file-explorer {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}
.admin-folder-tree,
.admin-folder-window {
  background: #fff;
  border: 1px solid #e7ecf5;
  box-shadow: var(--soft-shadow);
  border-radius: 14px;
}
.admin-folder-tree {
  padding: 12px;
  min-height: 390px;
}
.admin-tree-item {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: #4a5670;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}
.admin-tree-item svg {
  width: 17px;
  height: 17px;
  color: #f4b400;
}
.admin-tree-item.active,
.admin-tree-item:hover {
  background: #f3f0ff;
  color: var(--purple);
}
.admin-folder-window {
  min-height: 390px;
  overflow: hidden;
}
.admin-folder-window-head {
  height: 52px;
  border-bottom: 1px solid #e7ecf5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
}
.admin-folder-window-head strong {
  font-size: 13px;
  font-weight: 800;
  color: #27324b;
}
.admin-folder-window-head span {
  font-size: 11px;
  color: #9ba6bb;
}
.admin-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 14px;
  padding: 18px;
}
.admin-file-card {
  min-height: 116px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #33405a;
  font-size: 11px;
  font-weight: 800;
  position: relative;
}
.admin-file-card:hover {
  background: #f8f9fd;
  border-color: #e7ecf5;
}
.admin-file-card .admin-file-icon {
  width: 48px;
  height: 42px;
  color: #f4b400;
  display: grid;
  place-items: center;
}
.admin-file-card.doc .admin-file-icon {
  color: #6d5cff;
}
.admin-file-card svg {
  width: 44px;
  height: 44px;
}
.admin-file-card small {
  font-size: 10px;
  font-weight: 700;
  color: #9ba6bb;
}
.admin-file-card .admin-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: 0.2s;
}
.admin-file-card:hover .admin-actions {
  opacity: 1;
}

html[data-theme="dark"] .admin-table-shell,
html[data-theme="dark"] .admin-team-card,
html[data-theme="dark"] .admin-folder-tree,
html[data-theme="dark"] .admin-folder-window,
html[data-theme="dark"] .admin-check-grid label,
html[data-theme="dark"] .admin-icon-btn,
html[data-theme="dark"] .admin-modal input,
html[data-theme="dark"] .admin-modal select,
html[data-theme="dark"] .admin-modal textarea {
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .admin-user-cell strong,
html[data-theme="dark"] .admin-model-cell strong,
html[data-theme="dark"] .admin-team-card strong,
html[data-theme="dark"] .admin-folder-window-head strong,
html[data-theme="dark"] .admin-modal-block > strong,
html[data-theme="dark"] .admin-modal .form-grid label,
html[data-theme="dark"] .admin-modal .full-field,
html[data-theme="dark"] .admin-check-grid label,
html[data-theme="dark"] .admin-file-card {
  color: var(--text);
}
html[data-theme="dark"] .admin-file-card:hover,
html[data-theme="dark"] .admin-tree-item.active,
html[data-theme="dark"] .admin-tree-item:hover {
  background: #17243f;
}

@media (max-width: 900px) {
  .admin-panel-head {
    flex-direction: column;
  }
  .admin-check-grid,
  .admin-team-grid,
  .admin-file-explorer {
    grid-template-columns: 1fr;
  }
  .admin-folder-tree {
    min-height: auto;
  }
  .admin-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  }
}
@media (max-width: 560px) {
  .admin-modal-dialog,
  .admin-small-modal {
    top: 12px;
    width: calc(100vw - 22px);
    padding: 22px 16px 0;
    border-radius: 18px;
  }
  .admin-modal .form-grid.two {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .admin-modal-actions {
    padding: 14px 16px;
    height: auto;
    flex-direction: column-reverse;
  }
  .admin-modal-actions .btn,
  .admin-modal-actions .btn.ghost {
    width: 100%;
    min-width: 0;
  }
  .admin-table th:last-child,
  .admin-table td:last-child {
    min-width: 120px;
  }
}

/* =========================================================
   Sistema visual padronizado CIADOCS
   Mantém a estrutura atual e uniformiza espaçamentos,
   botões, cards, formulários, modais e responsividade.
   ========================================================= */
:root {
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --surface-muted: #f5f7fb;
  --border-soft: #e6ebf4;
  --border-strong: #dfe6f1;
  --text-strong: #202948;
  --text-default: #253261;
  --text-soft: #7b879d;
  --text-muted: #98a3b8;
  --primary: var(--purple);
  --primary-hover: #3711d8;
  --primary-soft: #f3f0ff;
  --success: #16c99a;
  --danger: #ff5263;
  --warning: #f69c3d;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --control-height: 44px;
  --modal-width: 780px;
  --modal-small-width: 560px;
  --ease: 0.18s ease;
  --focus-ring: 0 0 0 4px rgba(74, 25, 255, 0.12);
  --admin-page-width: 1040px;
}

/* Base de interação */
button,
.btn,
.deadline-primary,
.deadline-secondary,
.deadline-danger,
.functions-add,
.admin-icon-btn,
.deadline-close,
.close-modal,
.setting-card,
.admin-tree-item,
.admin-file-card,
.deadline-day-cell {
  transition:
    transform var(--ease),
    box-shadow var(--ease),
    background var(--ease),
    border-color var(--ease),
    color var(--ease),
    opacity var(--ease);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable="true"]:focus-visible,
.setting-card:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

/* Botões padronizados */
.btn,
.btn.primary,
.btn.ghost,
.btn.save,
.deadline-primary,
.deadline-secondary,
.deadline-danger,
.admin-inline-add.functions-add,
.functions-line button,
.functions-add {
  min-height: 40px;
  height: auto;
  border-radius: var(--radius-md);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.btn.primary,
.btn.save,
.deadline-primary,
.admin-inline-add.functions-add {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  box-shadow: 0 14px 28px rgba(74, 25, 255, 0.18);
}

.btn.primary:hover,
.btn.save:hover,
.deadline-primary:hover,
.admin-inline-add.functions-add:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 17px 32px rgba(74, 25, 255, 0.22);
}

.btn.ghost,
.deadline-secondary,
.admin-modal-actions .btn.ghost {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid #dcd7ff;
  box-shadow: none;
}

.btn.ghost:hover,
.deadline-secondary:hover,
.admin-modal-actions .btn.ghost:hover {
  background: var(--primary-soft);
  border-color: #c8bfff;
  transform: translateY(-1px);
}

.deadline-danger {
  background: #fff0f2;
  color: #d94f61;
  border: 1px solid #ffd4db;
}

.deadline-danger:hover {
  background: #ffe7eb;
  transform: translateY(-1px);
}

.btn.small,
.test-actions .btn,
.deadline-agenda-actions button {
  min-height: 36px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 11px;
}

/* Cards e painéis */
.card-panel,
.settings-panel,
.admin-table-shell,
.admin-team-card,
.admin-folder-tree,
.admin-folder-window,
.deadline-calendar-card,
.deadline-day-panel,
.deadline-agenda-card,
.test-form-panel,
.model-editor-card,
.side-box,
.setting-card,
.table-shell {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.card-panel,
.settings-panel {
  padding: 26px;
}

.admin-config-panel {
  padding: 26px;
  overflow: visible;
}

.admin-list-panel {
  padding: 28px;
}

.setting-card {
  cursor: pointer;
}

.setting-card:hover,
.setting-card.active {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(42, 55, 102, 0.09);
}

.setting-card.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #fff 0%, #fbfaff 100%);
}

/* Cabeçalhos internos */
.admin-panel-head,
.test-panel-head,
.deadline-toolbar {
  gap: 16px;
}

.admin-panel-head h2,
.settings-panel h2,
.user-form h2,
.test-panel-head h2,
.deadline-hero h2,
.deadline-modal-head h3,
.modal-head h2 {
  color: var(--text-strong);
  letter-spacing: -0.03em;
}

.admin-panel-head p,
.settings-panel p,
.user-form p,
.test-panel-head p,
.deadline-hero p,
.deadline-modal-head p,
.modal-head p {
  color: var(--text-muted);
  line-height: 1.45;
}

/* Campos padronizados */
.admin-modal input,
.admin-modal select,
.admin-modal textarea,
.deadline-field input,
.deadline-field select,
.deadline-field textarea,
.model-meta-form input,
.model-meta-form select,
.variable-create-form input,
.variable-create-form select,
.variable-create-form textarea,
.conditional-create-form input,
.conditional-create-form select,
.conditional-create-form textarea,
.generated-field input,
.generated-field select,
.generated-field textarea,
.searchbox input {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text-strong);
  min-height: var(--control-height);
  font-size: 13px;
}

.admin-modal input:focus,
.admin-modal select:focus,
.admin-modal textarea:focus,
.deadline-field input:focus,
.deadline-field select:focus,
.deadline-field textarea:focus,
.model-meta-form input:focus,
.model-meta-form select:focus,
.variable-create-form input:focus,
.variable-create-form select:focus,
.variable-create-form textarea:focus,
.conditional-create-form input:focus,
.conditional-create-form select:focus,
.conditional-create-form textarea:focus,
.generated-field input:focus,
.generated-field select:focus,
.generated-field textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--focus-ring);
}

.admin-modal textarea,
.deadline-field textarea,
.variable-create-form textarea,
.conditional-create-form textarea,
.generated-field textarea {
  line-height: 1.45;
  resize: vertical;
}

.admin-modal .form-grid label,
.admin-modal .full-field,
.deadline-field,
.variable-create-form label,
.conditional-create-form label,
.generated-field,
.model-meta-form label {
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--text-strong);
}

/* Modais padronizados */
.modal,
.deadline-modal {
  z-index: 100;
}

.modal-backdrop,
.deadline-modal-backdrop {
  background: rgba(20, 24, 41, 0.36);
  backdrop-filter: blur(5px);
}

.modal-dialog,
.admin-modal-dialog,
.admin-small-modal,
.deadline-modal-card {
  top: 24px;
  width: min(var(--modal-width), calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: 0 34px 90px rgba(19, 24, 50, 0.25);
  padding: 24px;
}

.admin-small-modal {
  width: min(var(--modal-small-width), calc(100vw - 32px));
}

.modal-head,
.deadline-modal-head {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.close-modal,
.deadline-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: #8d96a8;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
}

.close-modal:hover,
.deadline-close:hover {
  background: #eef2ff;
  color: var(--primary);
  transform: translateY(-1px);
}

.modal-actions,
.deadline-modal-actions,
.admin-modal-actions {
  border-top: 1px solid var(--border-soft);
  margin-top: 22px;
  padding-top: 18px;
}

.modal-actions {
  height: auto;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.deadline-modal-actions {
  grid-template-columns: auto 1fr auto auto;
}

/* Tabelas */
.table-shell,
.admin-table-shell {
  overflow: auto;
}

.models-table,
.admin-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.models-table th,
.admin-table th {
  background: #fbfcff;
  color: #7f889b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.models-table th,
.models-table td,
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--border-soft);
}

.models-table tbody tr:last-child td,
.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.models-table tbody tr:hover,
.admin-table tbody tr:hover {
  background: #fbfcff;
}

.admin-icon-btn,
.row-actions button {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: #7b879d;
  display: inline-grid;
  place-items: center;
}

.admin-icon-btn:hover,
.row-actions button:hover {
  background: var(--primary-soft);
  border-color: #dcd7ff;
  color: var(--primary);
  transform: translateY(-1px);
}

.admin-icon-btn.danger:hover,
.row-actions button:last-child:hover {
  background: #fff0f2;
  border-color: #ffd4db;
  color: var(--danger);
}

/* Badges, pills e listas */
.admin-pill,
.badge,
.deadline-legend span {
  border-radius: 999px;
  font-weight: 900;
}

.admin-check-grid label {
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.admin-check-grid label:hover {
  border-color: #dcd7ff;
  background: #fff;
}

.admin-check-grid label:has(input:checked) {
  border-color: #c8bfff;
  background: var(--primary-soft);
  color: var(--primary);
}

/* Prazos */
.deadline-hero,
.deadline-calendar-card,
.deadline-day-panel {
  border-radius: var(--radius-xl);
}

.deadline-day-cell:hover {
  background: #fbfaff;
}

.deadline-agenda-card {
  border-radius: var(--radius-lg);
}

/* Configuração e cadastro */
.admin-cadastro-page,
.settings-page {
  width: min(var(--admin-page-width), 100%);
}

.admin-panel-head .btn,
.admin-panel-head .functions-add,
.admin-panel-head .admin-inline-add {
  flex: 0 0 auto;
}

.admin-team-card {
  border-radius: var(--radius-lg);
}

.admin-folder-tree,
.admin-folder-window {
  border-radius: var(--radius-lg);
}

.admin-file-card {
  border-radius: var(--radius-md);
}

.admin-file-card:hover {
  background: #fbfcff;
  transform: translateY(-1px);
}

/* Editor de texto */
.editor-toolbar,
.toolbar-group {
  gap: 8px;
}

.editor-toolbar button,
.editor-toolbar select,
.toolbar-color {
  border-radius: var(--radius-sm);
  border-color: var(--border-soft);
}

.editor-toolbar button:hover,
.toolbar-color:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.editor-paper {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Responsividade final */
@media (max-width: 1180px) {
  .admin-cadastro-page,
  .settings-page,
  .deadline-page,
  .models-page,
  .model-builder-v2 {
    width: 100%;
  }

  .settings-cards {
    gap: 14px;
  }

  .admin-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-panel-head,
  .test-panel-head,
  .deadline-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-panel-head .btn,
  .admin-panel-head .functions-add,
  .admin-panel-head .admin-inline-add,
  .deadline-actions-inline,
  .test-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-panel-head .btn,
  .admin-panel-head .functions-add,
  .admin-panel-head .admin-inline-add,
  .deadline-actions-inline button,
  .test-actions .btn {
    width: 100%;
  }

  .settings-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-file-explorer {
    grid-template-columns: 1fr;
  }

  .admin-folder-tree {
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .page-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-title {
    margin-bottom: 28px;
  }

  .card-panel,
  .settings-panel,
  .admin-config-panel,
  .admin-list-panel,
  .deadline-calendar-card,
  .deadline-day-panel,
  .test-form-panel,
  .model-editor-card,
  .side-box {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .settings-cards,
  .admin-team-grid,
  .generated-fields,
  .deadline-form-grid,
  .admin-check-grid,
  .form-grid.two {
    grid-template-columns: 1fr !important;
  }

  .setting-card {
    min-height: 82px;
    height: auto;
    padding: 16px;
  }

  .admin-folder-tree {
    grid-template-columns: 1fr;
  }

  .modal-dialog,
  .admin-modal-dialog,
  .admin-small-modal,
  .deadline-modal-card {
    top: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .modal-head,
  .deadline-modal-head {
    gap: 12px;
  }

  .modal-actions,
  .admin-modal-actions,
  .deadline-modal-actions {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
    padding-top: 16px;
  }

  .modal-actions .btn,
  .admin-modal-actions .btn,
  .deadline-modal-actions button,
  .deadline-primary,
  .deadline-secondary,
  .deadline-danger {
    width: 100%;
    min-width: 0;
  }

  .deadline-modal-actions span {
    display: none;
  }

  .admin-table-shell,
  .table-shell {
    margin-left: -4px;
    margin-right: -4px;
    border-radius: var(--radius-md);
  }

  .admin-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    padding: 12px;
  }

  .admin-file-card {
    min-height: 104px;
  }

  .deadline-day-cell {
    min-height: 82px;
  }
}

@media (max-width: 430px) {
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .settings-cards {
    gap: 10px;
  }

  .gradient-icon {
    width: 38px;
    height: 38px;
  }

  .admin-folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-theme="dark"] {
  --surface: #1c2235;
  --surface-soft: #151b2b;
  --surface-muted: #20283c;
  --border-soft: #30384f;
  --border-strong: #3a435c;
  --text-strong: #eef2ff;
  --text-default: #eef2ff;
  --text-soft: #c0c7d8;
  --text-muted: #8d96aa;
}

html[data-theme="dark"] .setting-card.active,
html[data-theme="dark"] .models-table th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .models-table tbody tr:hover,
html[data-theme="dark"] .admin-table tbody tr:hover,
html[data-theme="dark"] .deadline-day-cell:hover,
html[data-theme="dark"] .admin-file-card:hover,
html[data-theme="dark"] .admin-check-grid label:has(input:checked) {
  background: #17243f;
}

/* =========================================================
   Refinamento visual: dark mode, scrollbars e busca
   ========================================================= */
:root {
  --scrollbar-track: #eef2fa;
  --scrollbar-thumb: #c8d1e3;
  --scrollbar-thumb-hover: #aeb9cf;
  --search-bg: rgba(255, 255, 255, 0.96);
  --search-border: #dfe6f3;
  --search-text: #1f2a44;
  --search-placeholder: #7f8aa0;
  --search-icon: #5f6b84;
  --search-shadow: 0 12px 28px rgba(42, 55, 102, 0.12);
}

html[data-theme="dark"] {
  --scrollbar-track: #0b1222;
  --scrollbar-thumb: #2d3956;
  --scrollbar-thumb-hover: #425171;
  --search-bg: #151d31;
  --search-border: #46516e;
  --search-text: #f5f7ff;
  --search-placeholder: #b5bed3;
  --search-icon: #d9e0f2;
  --search-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--scrollbar-thumb),
    var(--scrollbar-thumb-hover)
  );
  border: 2px solid var(--scrollbar-track);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

/* Barra de pesquisa com mais contraste em claro e escuro */
.searchbox {
  width: min(310px, 34vw);
  height: 44px;
  border: 1px solid var(--search-border);
  border-radius: 999px;
  background: var(--search-bg);
  color: var(--search-icon);
  box-shadow: var(--search-shadow);
  padding: 0 16px;
  gap: 10px;
  backdrop-filter: blur(12px);
}

.searchbox svg {
  width: 16px;
  height: 16px;
  color: var(--search-icon);
  opacity: 0.95;
}

.searchbox input {
  min-height: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: var(--search-text);
  font-size: 13px;
  font-weight: 750;
  padding: 0;
}

.searchbox input::placeholder {
  color: var(--search-placeholder);
  opacity: 1;
  font-weight: 750;
}

.searchbox:focus-within {
  border-color: var(--primary);
  box-shadow:
    0 0 0 4px rgba(74, 25, 255, 0.13),
    var(--search-shadow);
}

html[data-theme="dark"] .searchbox:focus-within {
  box-shadow:
    0 0 0 4px rgba(129, 106, 255, 0.24),
    var(--search-shadow);
}

/* Dark mode sem bordas brancas/estouradas */
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .admin-modal-dialog,
html[data-theme="dark"] .admin-small-modal,
html[data-theme="dark"] .deadline-modal-card,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .brand,
html[data-theme="dark"] .card-panel,
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .admin-config-panel,
html[data-theme="dark"] .admin-list-panel,
html[data-theme="dark"] .admin-table-shell,
html[data-theme="dark"] .admin-team-card,
html[data-theme="dark"] .admin-folder-tree,
html[data-theme="dark"] .admin-folder-window,
html[data-theme="dark"] .deadline-calendar-card,
html[data-theme="dark"] .deadline-day-panel,
html[data-theme="dark"] .deadline-agenda-card,
html[data-theme="dark"] .test-form-panel,
html[data-theme="dark"] .model-editor-card,
html[data-theme="dark"] .side-box,
html[data-theme="dark"] .setting-card,
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] .editor-frame,
html[data-theme="dark"] .editor-paper,
html[data-theme="dark"] .editor-toolbar,
html[data-theme="dark"] .editor-toolbar-advanced .toolbar-group,
html[data-theme="dark"] .preview-head,
html[data-theme="dark"] .generated-preview-wrap,
html[data-theme="dark"] .generated-fields-empty,
html[data-theme="dark"] .conditional-empty,
html[data-theme="dark"] .conditional-list-item,
html[data-theme="dark"] .conditional-selected-title,
html[data-theme="dark"] .admin-check-grid label,
html[data-theme="dark"] .admin-icon-btn,
html[data-theme="dark"] .language-control,
html[data-theme="dark"] .login-tool-btn,
html[data-theme="dark"] .top-icon.theme-toggle {
  border-color: var(--border-soft) !important;
}

html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .admin-modal-dialog,
html[data-theme="dark"] .admin-small-modal,
html[data-theme="dark"] .deadline-modal-card {
  background: #151d31;
  border: 1px solid #303a56 !important;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .setting-card.active {
  background: linear-gradient(180deg, #18233a 0%, #151d31 100%) !important;
  border-color: #6e59ff !important;
}

html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .deadline-secondary,
html[data-theme="dark"] .side-submit.secondary,
html[data-theme="dark"] .admin-modal-actions .btn.ghost,
html[data-theme="dark"] .close-modal,
html[data-theme="dark"] .deadline-close,
html[data-theme="dark"] .deadline-agenda-actions button,
html[data-theme="dark"] .deadline-month-control button,
html[data-theme="dark"] .editor-toolbar button,
html[data-theme="dark"] .editor-toolbar select,
html[data-theme="dark"] .toolbar-color {
  background: #1a243a !important;
  border-color: #37425f !important;
  color: #eef2ff !important;
}

html[data-theme="dark"] .btn.ghost:hover,
html[data-theme="dark"] .deadline-secondary:hover,
html[data-theme="dark"] .side-submit.secondary:hover,
html[data-theme="dark"] .admin-modal-actions .btn.ghost:hover,
html[data-theme="dark"] .close-modal:hover,
html[data-theme="dark"] .deadline-close:hover,
html[data-theme="dark"] .deadline-agenda-actions button:hover,
html[data-theme="dark"] .deadline-month-control button:hover,
html[data-theme="dark"] .editor-toolbar button:hover,
html[data-theme="dark"] .toolbar-color:hover {
  background: #222f4b !important;
  border-color: #6e59ff !important;
  color: #ffffff !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .admin-modal input,
html[data-theme="dark"] .admin-modal select,
html[data-theme="dark"] .admin-modal textarea,
html[data-theme="dark"] .deadline-field input,
html[data-theme="dark"] .deadline-field select,
html[data-theme="dark"] .deadline-field textarea,
html[data-theme="dark"] .model-meta-form input,
html[data-theme="dark"] .model-meta-form select,
html[data-theme="dark"] .variable-create-form input,
html[data-theme="dark"] .variable-create-form select,
html[data-theme="dark"] .variable-create-form textarea,
html[data-theme="dark"] .conditional-create-form input,
html[data-theme="dark"] .conditional-create-form select,
html[data-theme="dark"] .conditional-create-form textarea,
html[data-theme="dark"] .generated-field input,
html[data-theme="dark"] .generated-field select,
html[data-theme="dark"] .generated-field textarea {
  background: var(--card) !important;
  border-color: #3a4561 !important;
  color: #f4f7ff !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .editor-paper:focus {
  border-color: #8068ff !important;
  box-shadow: 0 0 0 4px rgba(128, 104, 255, 0.2) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #9ca8c0 !important;
  opacity: 1;
}

html[data-theme="dark"] .models-table th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .deadline-weekdays span,
html[data-theme="dark"] .preview-head,
html[data-theme="dark"] .side-box-toggle,
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .deadline-modal-head,
html[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .deadline-modal-actions,
html[data-theme="dark"] .admin-modal-actions,
html[data-theme="dark"] .admin-folder-window-head,
html[data-theme="dark"] .deadline-toolbar,
html[data-theme="dark"] .deadline-day-head,
html[data-theme="dark"] .conditional-create-form {
  border-color: var(--border-soft) !important;
}

html[data-theme="dark"] .models-table th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .deadline-weekdays span,
html[data-theme="dark"] .preview-head,
html[data-theme="dark"] .side-box-toggle {
  background: #151d31 !important;
}

html[data-theme="dark"] .models-table td,
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .deadline-day-cell,
html[data-theme="dark"] .month-cell,
html[data-theme="dark"] .week-slot,
html[data-theme="dark"] .week-header {
  border-color: #28324b !important;
}

html[data-theme="dark"] .admin-pill,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .side-box-toggle small,
html[data-theme="dark"] .deadline-eyebrow {
  background: #201f49 !important;
  color: #d8d2ff !important;
}

html[data-theme="dark"] .avatar {
  border-color: #1f2a44;
}

@media (max-width: 760px) {
  .searchbox {
    width: min(100%, 320px);
    height: 42px;
  }

  .topbar {
    gap: 10px;
  }
}

/* Acervo: ações compactas e responsivas */
.admin-file-card {
  isolation: isolate;
  padding: 18px 12px 16px;
  overflow: visible;
}

.admin-file-card .admin-file-name {
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.admin-file-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
}

.admin-file-menu-trigger {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(214, 220, 235, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: #64708a;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 8px 20px rgba(25, 35, 68, 0.08);
  backdrop-filter: blur(8px);
}

.admin-file-menu-trigger svg {
  width: 18px;
  height: 18px;
}

.admin-file-card:hover .admin-file-menu-trigger,
.admin-file-card.menu-open .admin-file-menu-trigger,
.admin-file-menu-trigger:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-file-menu-trigger:hover,
.admin-file-card.menu-open .admin-file-menu-trigger {
  background: #f4f2ff;
  border-color: rgba(109, 92, 255, 0.35);
  color: var(--purple);
  box-shadow: 0 12px 26px rgba(76, 57, 205, 0.16);
}

.admin-file-menu {
  position: absolute;
  top: 36px;
  right: 0;
  min-width: 136px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid #e5eaf4;
  background: #ffffff;
  box-shadow: 0 20px 42px rgba(25, 35, 68, 0.18);
  display: grid;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 20;
}

.admin-file-card.menu-open .admin-file-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.admin-file-menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3f4a63;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.admin-file-menu button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.admin-file-menu button:hover,
.admin-file-menu button:focus-visible {
  background: #f4f6fb;
  color: var(--purple);
  outline: none;
}

.admin-file-menu button.danger {
  color: #d13f4a;
}

.admin-file-menu button.danger:hover,
.admin-file-menu button.danger:focus-visible {
  background: #fff1f2;
  color: #b4232f;
}

.admin-file-card.folder .admin-file-icon,
.admin-file-card.doc .admin-file-icon {
  margin-top: 4px;
}

/* Remove os botões antigos do topo do card, caso algum cache de markup antigo exista */
.admin-file-card > .admin-actions {
  display: none !important;
}

html[data-theme="dark"] .admin-file-menu-trigger {
  background: rgba(24, 33, 53, 0.94);
  border-color: #34405f;
  color: #b8c3dc;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .admin-file-menu-trigger:hover,
html[data-theme="dark"] .admin-file-card.menu-open .admin-file-menu-trigger {
  background: #202b46;
  border-color: #8068ff;
  color: #ffffff;
}

html[data-theme="dark"] .admin-file-menu {
  background: #151d31;
  border-color: #303a56;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.52);
}

html[data-theme="dark"] .admin-file-menu button {
  color: #e8edff;
}

html[data-theme="dark"] .admin-file-menu button:hover,
html[data-theme="dark"] .admin-file-menu button:focus-visible {
  background: #202b46;
  color: #ffffff;
}

html[data-theme="dark"] .admin-file-menu button.danger {
  color: #ff8f9a;
}

html[data-theme="dark"] .admin-file-menu button.danger:hover,
html[data-theme="dark"] .admin-file-menu button.danger:focus-visible {
  background: rgba(255, 111, 125, 0.13);
  color: #ffd6db;
}

@media (hover: none) {
  .admin-file-menu-trigger {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 700px) {
  .admin-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .admin-file-card {
    min-height: 126px;
    padding: 20px 12px 16px;
  }

  .admin-file-menu {
    min-width: 150px;
  }
}

@media (max-width: 430px) {
  .admin-folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .admin-file-menu {
    right: -4px;
  }
}

/* Ajustes de integração com banco sem alterar o layout original */
.ciadocs-alert {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}
.ciadocs-alert.success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.ciadocs-alert.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.row-actions form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.row-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f5f7fb;
  color: inherit;
  text-decoration: none;
}
[data-theme="dark"] .ciadocs-alert.success {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}
[data-theme="dark"] .ciadocs-alert.error {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

/* Fluxo Nova Peça + editor final */
a.tiny-btn {
  text-decoration: none;
  justify-content: center;
}
.piece-template-fields-wrap {
  grid-column: 1 / -1;
  border: 1px solid #e4e9f3;
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
  margin-top: 4px;
}
.piece-template-fields-head {
  margin: 0;
}
.piece-modal-fields {
  padding: 14px;
  margin-top: 0;
}
.piece-editor-builder {
  display: block;
  width: min(980px, 100%);
}
.piece-editor-column {
  width: 100%;
}
.piece-meta-form {
  grid-template-columns: minmax(260px, 1fr) 190px 220px;
}
.piece-paper {
  min-height: 620px;
}
.floating-actions a {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #738096;
  box-shadow: 0 6px 16px rgba(37, 50, 97, 0.08);
}
.floating-actions a svg {
  width: 15px;
  height: 15px;
}
html[data-theme="dark"] .piece-template-fields-wrap,
html[data-theme="dark"] .floating-actions a {
  background: var(--card);
  border-color: var(--border-soft);
}
@media (max-width: 900px) {
  .piece-meta-form {
    grid-template-columns: 1fr;
  }
}

/* Workflow de aprovação das peças */
.workflow-actions,
.piece-workflow-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-workflow-form,
.piece-workflow-bar form {
  margin: 0;
  display: inline-flex;
}
.status-readonly-pill {
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
  background: rgba(148, 163, 184, 0.12);
  color: var(--text, #111827);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 700;
}
.status-in_progress {
  background: rgba(59, 130, 246, 0.12);
}
.status-waiting_approval {
  background: rgba(245, 158, 11, 0.14);
}
.status-waiting_adjustment {
  background: rgba(239, 68, 68, 0.12);
}
.status-done {
  background: rgba(16, 185, 129, 0.14);
}
.piece-workflow-bar {
  margin: 12px 0 18px;
  padding: 14px;
  border-radius: 18px;
  background: var(--panel, rgba(255, 255, 255, 0.72));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
}
.workflow-btn {
  min-height: 38px;
}
.workflow-yellow,
.tiny-btn.yellow {
  background: #f59e0b;
  color: #111827;
}
.workflow-orange,
.tiny-btn.orange {
  background: #f97316;
  color: #fff;
}
.workflow-red,
.tiny-btn.red {
  background: #ef4444;
  color: #fff;
}
.workflow-green,
.tiny-btn.green {
  background: #10b981;
  color: #fff;
}
.workflow-blue,
.tiny-btn.blue {
  background: #3b82f6;
  color: #fff;
}
.workflow-alert {
  margin: 12px 0;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.12);
  display: grid;
  gap: 4px;
}
.readonly-alert {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.1);
}
.readonly-paper {
  background: rgba(148, 163, 184, 0.08);
  cursor: default;
}
.workflow-history {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel, rgba(255, 255, 255, 0.72));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
}
.workflow-history h3 {
  margin: 0 0 12px;
}
.workflow-history-item {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.workflow-history-item:first-of-type {
  border-top: 0;
}
.workflow-history-item span,
.workflow-history-item p {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

/* Ajuste visual v4: componentes do fluxo no mesmo padrão do layout original */
.piece-footer > span {
  color: #a2acbf;
  line-height: 1.35;
}
.piece-footer {
  align-items: flex-start;
}
.piece-actions.workflow-actions {
  justify-content: flex-end;
  max-width: 100%;
}
.piece-actions .inline-workflow-form {
  max-width: 100%;
}
.piece-actions .tiny-btn {
  min-width: 74px;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(42, 55, 102, 0.08);
}
.tiny-btn.yellow {
  background: var(--yellow);
  color: #253261;
}
.tiny-btn.red {
  background: var(--red);
}

.piece-template-fields-wrap {
  border-color: #edf1f8;
  border-radius: 15px;
  box-shadow: var(--soft-shadow);
}
.piece-template-fields-head {
  min-height: 48px;
  background: #fbfcff;
}
.piece-modal-fields {
  background: #fff;
}
.piece-modal-fields .generated-field,
.piece-modal-fields .generated-fields-empty {
  box-shadow: none;
}

.piece-editor-builder {
  width: min(1040px, 100%);
  margin: 0 auto;
}
.piece-editor-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.piece-meta-form {
  margin-bottom: 0;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  border: 1px solid #edf1f8;
}
.piece-meta-form label span {
  color: #8d98ad;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-readonly-pill {
  min-height: 43px;
  border: 1px solid #dce2ed;
  border-radius: 12px;
  background: #fbfcff;
  color: #2d354f;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 7px 18px rgba(37, 50, 97, 0.04);
}
.status-in_progress {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.status-waiting_approval {
  background: #fff8dc;
  color: #9a6700;
  border-color: #ffe08a;
}
.status-waiting_adjustment {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
.status-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.piece-workflow-bar {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #edf1f8;
  box-shadow: var(--soft-shadow);
  justify-content: flex-start;
}
.piece-workflow-bar .btn {
  min-width: auto;
  height: 38px;
  padding: 0 18px;
  border-radius: 12px;
}
.workflow-yellow {
  background: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: #253261 !important;
  box-shadow: 0 12px 22px rgba(245, 205, 57, 0.18);
}
.workflow-orange {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: #fff !important;
  box-shadow: 0 12px 22px rgba(246, 156, 61, 0.18);
}
.workflow-red {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
  box-shadow: 0 12px 22px rgba(255, 82, 99, 0.18);
}
.workflow-green {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
  box-shadow: 0 12px 22px rgba(22, 201, 154, 0.18);
}
.workflow-blue {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  box-shadow: 0 12px 22px rgba(38, 120, 255, 0.18);
}

.workflow-alert {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff8dc;
  color: #7c5200;
  border: 1px solid #ffe08a;
  box-shadow: var(--soft-shadow);
  font-size: 13px;
  font-weight: 700;
}
.workflow-alert strong {
  color: #9a6700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.readonly-alert {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.editor-frame {
  margin-top: 0;
}
.readonly-paper {
  background: #fbfcff;
  border-color: #edf1f8;
}
.workflow-history {
  margin-top: 0;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #edf1f8;
  box-shadow: var(--soft-shadow);
}
.workflow-history h3 {
  font-size: 16px;
  letter-spacing: -0.3px;
  color: #253261;
}
.workflow-history-item strong {
  font-size: 13px;
  color: #253261;
}
.workflow-history-item span,
.workflow-history-item p {
  color: #8d98ad;
  font-size: 12px;
  line-height: 1.45;
}

html[data-theme="dark"] .piece-footer > span,
html[data-theme="dark"] .workflow-history-item span,
html[data-theme="dark"] .workflow-history-item p,
html[data-theme="dark"] .piece-meta-form label span {
  color: var(--muted);
}
html[data-theme="dark"] .piece-meta-form,
html[data-theme="dark"] .piece-workflow-bar,
html[data-theme="dark"] .workflow-history,
html[data-theme="dark"] .piece-modal-fields,
html[data-theme="dark"] .piece-template-fields-head,
html[data-theme="dark"] .status-readonly-pill,
html[data-theme="dark"] .readonly-paper {
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="dark"] .workflow-history h3,
html[data-theme="dark"] .workflow-history-item strong {
  color: var(--text);
}
html[data-theme="dark"] .status-in_progress {
  background: rgba(38, 120, 255, 0.16);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
}
html[data-theme="dark"] .status-waiting_approval {
  background: rgba(245, 205, 57, 0.14);
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.25);
}
html[data-theme="dark"] .status-waiting_adjustment {
  background: rgba(255, 82, 99, 0.14);
  color: #fda4af;
  border-color: rgba(253, 164, 175, 0.25);
}
html[data-theme="dark"] .status-done {
  background: rgba(22, 201, 154, 0.14);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.25);
}
html[data-theme="dark"] .workflow-alert {
  background: rgba(245, 205, 57, 0.12);
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.24);
}
html[data-theme="dark"] .workflow-alert strong {
  color: #fde68a;
}
html[data-theme="dark"] .readonly-alert {
  background: rgba(38, 120, 255, 0.14);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.24);
}

@media (max-width: 900px) {
  .piece-meta-form {
    grid-template-columns: 1fr;
  }
  .piece-workflow-bar {
    align-items: stretch;
  }
  .piece-workflow-bar .btn,
  .piece-workflow-bar form {
    width: 100%;
  }
}

/* v5 - acabamento visual e comportamento */
.ciadocs-message-modal.open,
.ciadocs-action-modal.open {
  display: block;
}
.ciadocs-message-dialog,
.ciadocs-action-dialog {
  width: min(520px, calc(100vw - 32px));
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 28px 26px 0;
}
.ciadocs-message-dialog {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: start;
}
.ciadocs-message-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 16px 28px rgba(47, 63, 113, 0.14);
}
.ciadocs-message-dialog.is-success .ciadocs-message-icon {
  background: #10b981;
}
.ciadocs-message-dialog.is-error .ciadocs-message-icon {
  background: #ef4444;
}
.ciadocs-message-content h2 {
  margin: 2px 0 6px;
  font-size: 20px;
  letter-spacing: -0.04em;
  color: var(--text-strong, #1f2937);
}
.ciadocs-message-content p {
  margin: 0;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
  font-size: 14px;
}
.ciadocs-message-actions {
  grid-column: 1 / -1;
  margin-top: 22px;
}
.ciadocs-action-dialog .ciadocs-dialog-reason {
  margin: 0 0 18px;
  display: grid;
  gap: 8px;
}
.ciadocs-action-dialog .ciadocs-dialog-reason[hidden] {
  display: none;
}
.ciadocs-dialog-reason textarea,
.modal-dialog .full-field input,
.modal-dialog .full-field select,
.modal-dialog .full-field textarea {
  width: 100%;
  border: 1px solid var(--border-strong, #dbe3f0);
  border-radius: var(--radius-md, 14px);
  background: var(--surface-soft, #f8fafc);
  color: var(--text-strong, #111827);
  min-height: var(--control-height, 44px);
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}
.ciadocs-dialog-reason textarea,
.modal-dialog .full-field textarea {
  padding: 12px 14px;
  line-height: 1.45;
  resize: vertical;
}
.ciadocs-dialog-reason textarea:focus,
.modal-dialog .full-field input:focus,
.modal-dialog .full-field select:focus,
.modal-dialog .full-field textarea:focus {
  border-color: var(--primary, #4a19ff);
  background: #fff;
  box-shadow: var(--focus-ring, 0 0 0 4px rgba(74, 25, 255, 0.12));
}
.ciadocs-dialog-reason small {
  color: #ef4444;
  font-size: 12px;
  font-weight: 800;
}

/* Kanban com scroll sem quebrar o padrão visual */
.kanban-grid {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.kanban-grid::-webkit-scrollbar {
  height: 10px;
}
.kanban-grid::-webkit-scrollbar-thumb {
  background: #dbe3f0;
  border-radius: 999px;
}
.kanban-grid::-webkit-scrollbar-track {
  background: transparent;
}
.kanban-grid .lane-card {
  min-width: 280px;
  scroll-snap-align: start;
  max-height: calc(100vh - 285px);
  overflow-y: auto;
}
.kanban-grid .lane-card::-webkit-scrollbar {
  width: 8px;
}
.kanban-grid .lane-card::-webkit-scrollbar-thumb {
  background: #dbe3f0;
  border-radius: 999px;
}

/* Paginação funcional */
.models-pagination a,
.models-pagination span {
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 12px;
}
.models-pagination a:hover {
  background: #f3f5fb;
}
.models-pagination a.active,
.models-pagination span.active {
  background: var(--purple, #4a19ff);
  color: #fff;
}
.models-pagination.is-static {
  opacity: 0.75;
}

/* Acervo: modelos virtuais vindos da tela Modelos */
.admin-file-card.is-readonly {
  cursor: pointer;
}
.admin-file-card.is-readonly .admin-file-icon {
  background: rgba(74, 25, 255, 0.1);
  color: var(--purple, #4a19ff);
}
.admin-file-card.is-readonly small {
  color: var(--purple, #4a19ff);
  font-weight: 800;
}

html[data-theme="dark"] .ciadocs-message-dialog,
html[data-theme="dark"] .ciadocs-action-dialog {
  background: var(--card);
  border-color: var(--border-soft);
}
html[data-theme="dark"] .ciadocs-dialog-reason textarea,
html[data-theme="dark"] .modal-dialog .full-field input,
html[data-theme="dark"] .modal-dialog .full-field select,
html[data-theme="dark"] .modal-dialog .full-field textarea {
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-strong);
  border-color: var(--border-soft);
}
html[data-theme="dark"] .models-pagination a:hover {
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .kanban-grid::-webkit-scrollbar-thumb,
html[data-theme="dark"] .kanban-grid .lane-card::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
}

@media (max-width: 1180px) {
  .kanban-grid {
    grid-template-columns: repeat(4, minmax(280px, 1fr));
  }
}
@media (max-width: 700px) {
  .ciadocs-message-dialog {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .ciadocs-message-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
}

/* v6 - modais de mensagens/confirmações alinhados ao padrão do sistema, sem scroll interno desnecessário */
.ciadocs-message-modal,
.ciadocs-action-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  padding: 22px;
  place-items: center;
}

.ciadocs-message-modal.open,
.ciadocs-action-modal.open {
  display: grid;
}

.ciadocs-message-modal .modal-backdrop,
.ciadocs-action-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 41, 0.3);
  backdrop-filter: blur(4px);
}

.ciadocs-message-dialog,
.ciadocs-action-dialog {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  z-index: 1;
  width: min(500px, calc(100vw - 32px));
  max-height: none;
  overflow: visible;
  padding: 26px 26px 0;
  border-radius: 24px;
  background: var(--surface, #fff);
  border: 1px solid var(--border-soft, #e7edf6);
  box-shadow: 0 30px 70px rgba(22, 28, 58, 0.18);
}

.ciadocs-action-dialog {
  display: block;
}

.ciadocs-action-dialog .modal-head,
.ciadocs-message-dialog .modal-head {
  margin-bottom: 18px;
  padding-bottom: 0;
  border-bottom: 0;
}

.ciadocs-action-dialog .modal-head h2,
.ciadocs-message-content h2 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: var(--text-strong, #1f2937);
}

.ciadocs-action-dialog .modal-head p,
.ciadocs-message-content p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

.ciadocs-message-dialog {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 15px;
  align-items: start;
}

.ciadocs-message-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 23px;
  color: #fff;
  box-shadow: 0 14px 26px rgba(47, 63, 113, 0.14);
}

.ciadocs-action-dialog .close-modal,
.ciadocs-message-dialog .close-modal {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f5f7fc;
  color: #9aa4b6;
  font-size: 24px;
  border: 0;
}

.ciadocs-action-dialog .close-modal:hover,
.ciadocs-message-dialog .close-modal:hover {
  background: #eef2ff;
  color: var(--primary, #4a19ff);
}

.ciadocs-action-dialog .ciadocs-dialog-reason {
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--text-strong, #1f2937);
}

.ciadocs-action-dialog .ciadocs-dialog-reason textarea {
  min-height: 112px;
  max-height: 180px;
  overflow-y: auto;
  resize: vertical;
}

.ciadocs-action-dialog .ciadocs-dialog-reason[hidden] {
  display: none;
}

.ciadocs-message-actions,
.ciadocs-dialog-actions {
  border-top: 1px solid var(--border-soft, #e7edf6);
  margin: 22px -26px 0;
  padding: 18px 26px;
  min-height: 72px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.65),
    rgba(248, 250, 252, 0.92)
  );
  border-radius: 0 0 24px 24px;
}

.ciadocs-message-actions {
  grid-column: 1 / -1;
}

.ciadocs-dialog-actions .btn,
.ciadocs-message-actions .btn {
  min-height: 40px;
}

html[data-theme="dark"] .ciadocs-message-dialog,
html[data-theme="dark"] .ciadocs-action-dialog {
  background: var(--card, #111827);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .ciadocs-message-actions,
html[data-theme="dark"] .ciadocs-dialog-actions {
  background: rgba(15, 23, 42, 0.72);
  border-top-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .ciadocs-action-dialog .close-modal,
html[data-theme="dark"] .ciadocs-message-dialog .close-modal {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

@media (max-width: 700px) {
  .ciadocs-message-modal,
  .ciadocs-action-modal {
    padding: 16px;
  }
  .ciadocs-message-dialog,
  .ciadocs-action-dialog {
    width: min(100%, calc(100vw - 24px));
    padding: 22px 22px 0;
  }
  .ciadocs-message-dialog {
    grid-template-columns: 44px 1fr;
    gap: 12px;
  }
  .ciadocs-message-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
  }
  .ciadocs-message-actions,
  .ciadocs-dialog-actions {
    margin-left: -22px;
    margin-right: -22px;
    padding: 16px 22px;
  }
}

/* Ajustes página Modelos v8 */
.models-team-grid {
  align-items: stretch;
}

.models-team-card {
  position: relative;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.models-team-card:hover {
  transform: translateY(-2px);
  border-color: #ded8ff;
  box-shadow: 0 14px 30px rgba(87, 64, 216, 0.12);
}

.models-team-card.is-active {
  border-color: #7a5cff;
  background: linear-gradient(135deg, #ffffff 0%, #f7f4ff 100%);
}

.models-team-card.is-active span {
  background: var(--purple);
  color: #fff;
}

.models-team-card em {
  position: absolute;
  left: 65px;
  bottom: 15px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #98a2b8;
}

.models-page .models-head {
  min-height: 22px;
}

.models-page .models-table {
  min-width: 720px;
}

.models-page .models-table th:first-child,
.models-page .models-table td:first-child {
  padding-left: 18px;
}

.models-page .row-actions,
.models-page .model-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.models-page .row-actions form {
  display: inline-flex !important;
  margin: 0 !important;
}

.models-page .row-actions .admin-icon-btn,
.models-page .row-actions a.admin-icon-btn,
.models-page .row-actions button.admin-icon-btn {
  width: 34px;
  height: 34px;
  margin-left: 0;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  box-shadow: none;
}

.models-page .row-actions .admin-icon-btn.edit {
  color: var(--purple) !important;
}

.models-page .row-actions .admin-icon-btn.danger {
  color: var(--red) !important;
}

.models-page .row-actions .admin-icon-btn:hover {
  background: #f7f4ff;
  border-color: #ded8ff;
  color: var(--purple) !important;
}

.models-page .row-actions .admin-icon-btn.danger:hover {
  background: #fff0f2;
  border-color: #ffd4db;
  color: var(--red) !important;
}

html[data-theme="dark"] .models-team-card.is-active {
  background: rgba(122, 92, 255, 0.14);
  border-color: rgba(165, 146, 255, 0.7);
}

html[data-theme="dark"] .models-team-card:hover {
  border-color: rgba(165, 146, 255, 0.7);
}

html[data-theme="dark"] .models-team-card em {
  color: #9ca6bd;
}

html[data-theme="dark"] .models-page .row-actions .admin-icon-btn {
  background: var(--card);
  border-color: var(--border-soft);
}

@media (max-width: 900px) {
  .models-team-card em {
    position: static;
    display: block;
    margin-top: 4px;
  }
}

/* v9 - Configurações do documento */
.document-settings-form {
  width: 100%;
}
.doc-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.doc-settings-card {
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}
.doc-settings-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #111827;
}
.doc-settings-card textarea,
.doc-settings-card input[type="text"],
.doc-settings-card input[type="number"],
.doc-settings-card input[type="file"],
.admin-small-modal select,
.admin-small-modal textarea,
.admin-small-modal input[type="text"],
.document-settings-form select,
.document-settings-form textarea,
.document-settings-form input[type="text"],
.document-settings-form input[type="number"],
.document-settings-form input[type="file"] {
  width: 100%;
  border: 1px solid #d8dfeb;
  border-radius: 14px;
  background: #f8fafc;
  color: #111827;
  padding: 11px 13px;
  outline: none;
  font: inherit;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.doc-settings-card textarea:focus,
.doc-settings-card input:focus,
.admin-small-modal select:focus,
.admin-small-modal textarea:focus,
.admin-small-modal input:focus,
.document-settings-form select:focus,
.document-settings-form textarea:focus,
.document-settings-form input:focus {
  border-color: #4f46e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.doc-logo-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}
.doc-logo-preview img {
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}
.doc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.document-settings-actions {
  margin-top: 18px;
}
.admin-tree-item span {
  text-align: left;
}
html[data-theme="dark"] .doc-settings-card {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .doc-settings-card h3,
html[data-theme="dark"] .doc-toggle {
  color: #e5e7eb;
}
html[data-theme="dark"] .doc-settings-card textarea,
html[data-theme="dark"] .doc-settings-card input[type="text"],
html[data-theme="dark"] .doc-settings-card input[type="number"],
html[data-theme="dark"] .doc-settings-card input[type="file"],
html[data-theme="dark"] .admin-small-modal select,
html[data-theme="dark"] .admin-small-modal textarea,
html[data-theme="dark"] .admin-small-modal input[type="text"],
html[data-theme="dark"] .document-settings-form select,
html[data-theme="dark"] .document-settings-form textarea,
html[data-theme="dark"] .document-settings-form input[type="text"],
html[data-theme="dark"] .document-settings-form input[type="number"],
html[data-theme="dark"] .document-settings-form input[type="file"] {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fafc;
}
html[data-theme="dark"] .doc-logo-preview {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.28);
}
@media (max-width: 900px) {
  .doc-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* v10 - Configurações avançadas do documento */
.doc-settings-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}
.doc-logo-preview label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.doc-logo-preview input[type="checkbox"] {
  width: auto;
}
.doc-logo-preview img[alt="Assinatura atual"] {
  max-height: 76px;
}
.doc-logo-preview img[alt="Rodapé atual"] {
  max-height: 54px;
  max-width: 240px;
}
html[data-theme="dark"] .doc-settings-note,
html[data-theme="dark"] .doc-logo-preview label {
  color: #cbd5e1;
}

/* v14 - Jurisprudência */
.juris-page .admin-panel-head,
.juris-head {
  margin-bottom: 18px;
}
.juris-table-shell {
  margin-top: 18px;
}
.juris-modal-dialog {
  max-width: 880px;
}
.juris-team-filter {
  margin-bottom: 18px;
}
.template-juris-box,
.piece-jurisprudence-wrap {
  background: var(--card-bg, #fff);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}
.template-juris-grid,
.piece-jurisprudence-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.template-juris-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.juris-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.75);
  cursor: pointer;
  transition: 0.2s ease;
}
.juris-checkbox-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.juris-checkbox-card input {
  margin-top: 3px;
  accent-color: #2563eb;
}
.juris-checkbox-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.juris-checkbox-card strong {
  font-size: 0.92rem;
  color: var(--text, #0f172a);
}
.juris-checkbox-card em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
}
.juris-checkbox-card small {
  font-size: 0.76rem;
  color: var(--muted, #64748b);
  line-height: 1.35;
}
.juris-checkbox-card.compact {
  min-height: 74px;
}
.insert-juris-marker {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
}
.jurisprudence-hint {
  display: block;
  margin-top: 10px;
  color: var(--muted, #64748b);
}
.jurisprudence-hint code {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  padding: 2px 6px;
  border-radius: 8px;
}
html[data-theme="dark"] .template-juris-box,
html[data-theme="dark"] .piece-jurisprudence-wrap,
html[data-theme="dark"] .juris-checkbox-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.18);
}

/* Recuperação de senha */
.auth-single-link {
  justify-content: center;
  margin-top: 4px;
}
.auth-single-link a {
  font-weight: 700;
}

/* CIADOCS v17 - notificações internas */
.notification-center {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.notification-center summary {
  list-style: none;
  cursor: pointer;
}
.notification-center summary::-webkit-details-marker {
  display: none;
}
.notification-trigger {
  position: relative;
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
}
.notification-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: min(380px, calc(100vw - 32px));
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  z-index: 80;
  overflow: hidden;
}
.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}
.notification-panel-head strong {
  font-size: 15px;
}
.notification-panel-head button,
.notification-all-link {
  border: 0;
  background: transparent;
  color: var(--primary, #2563eb);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.notification-list-mini {
  max-height: 360px;
  overflow: auto;
  padding: 8px;
}
.notification-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}
.notification-item:hover {
  background: rgba(37, 99, 235, 0.07);
  transform: translateY(-1px);
}
.notification-item strong,
.notification-row-body strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  color: var(--text, #0f172a);
}
.notification-item small,
.notification-row-body small {
  display: block;
  margin-top: 4px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}
.notification-item em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  color: var(--muted, #94a3b8);
  font-size: 11px;
}
.notification-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}
.notification-item.is-unread .notification-dot,
.notification-row.is-unread .notification-row-icon {
  background: #2563eb;
  color: #fff;
}
.notification-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 13px;
}
.notification-all-link {
  display: block;
  padding: 14px 18px;
  text-align: center;
  border-top: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  background: rgba(37, 99, 235, 0.04);
}
.notifications-page .section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.notification-page-list {
  display: grid;
  gap: 12px;
}
.notification-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  border-radius: 20px;
  background: var(--card-bg, #fff);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.notification-row-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}
.notification-row-icon svg {
  width: 19px;
  height: 19px;
}
.notification-row-date {
  color: var(--muted, #64748b);
  font-size: 12px;
  white-space: nowrap;
}
.empty-state-card {
  padding: 32px;
  border-radius: 24px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  text-align: center;
  color: var(--muted, #64748b);
}
.empty-state-card h3 {
  color: var(--text, #0f172a);
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .notification-row {
    grid-template-columns: 36px 1fr;
  }
  .notification-row-date {
    grid-column: 2;
  }
  .notifications-page .section-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* v21 — busca global */
.searchbox {
  min-width: min(420px, 100%);
}
.searchbox button {
  border: 0;
  background: transparent;
}
.search-results-page {
  display: grid;
  gap: 22px;
}
.search-section-head {
  align-items: flex-start;
  gap: 20px;
}
.search-page-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}
.search-page-form svg {
  width: 20px;
  height: 20px;
  color: var(--muted, #64748b);
  flex: 0 0 auto;
}
.search-page-form input {
  flex: 1;
  min-width: 120px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text, #0f172a);
  font: inherit;
}
.search-result-groups {
  display: grid;
  gap: 20px;
}
.search-result-group {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}
.search-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.search-group-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.search-group-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
  font-weight: 800;
}
.search-card-list {
  display: grid;
  gap: 10px;
}
.search-result-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.65);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.search-result-card:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.1);
}
.search-result-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
  flex: 0 0 auto;
}
.search-result-icon svg {
  width: 20px;
  height: 20px;
}
.search-result-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.search-result-body strong {
  font-size: 15px;
  font-weight: 800;
}
.search-result-body small {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-style: normal;
}
.search-result-body em {
  color: var(--text-soft, #475569);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}
.search-empty-card {
  padding: 28px;
}
html[data-theme="dark"] .search-result-group,
html[data-theme="dark"] .search-page-form {
  background: var(--surface, #111827);
  border-color: rgba(148, 163, 184, 0.18);
}
html[data-theme="dark"] .search-result-card {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.16);
}
@media (max-width: 780px) {
  .search-section-head,
  .search-page-form {
    width: 100%;
  }
  .search-page-form {
    flex-wrap: wrap;
  }
  .search-page-form .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Prazos: abas Calendário / To-do */
.deadline-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  align-items: center;
  flex-wrap: wrap;
}
.deadline-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
  color: var(--text, #111827);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.deadline-tab.active {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  border-color: transparent;
  color: #fff;
}
.is-hidden {
  display: none !important;
}
.todo-import-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
  margin-bottom: 18px;
}
.todo-import-card p {
  margin: 4px 0 0;
  color: var(--muted, #6b7280);
  font-size: 0.92rem;
}
.todo-import-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.todo-import-form input[type="file"] {
  padding: 10px;
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--soft, #f8fafc);
  max-width: 290px;
}
.todo-table-card {
  padding: 14px;
  border-radius: 22px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
  overflow: auto;
}
.todo-table {
  width: 100%;
  min-width: 980px;
}
.todo-table th,
.todo-table td {
  vertical-align: top;
}
.todo-decision-cell {
  max-width: 300px;
  white-space: normal;
  line-height: 1.45;
}
.empty-cell {
  text-align: center;
  color: var(--muted, #6b7280);
  padding: 30px !important;
}
.status-pill.pending {
  background: #fff7ed;
  color: #c2410c;
}
.status-pill.linked {
  background: #eef2ff;
  color: #4338ca;
}
.status-pill.done {
  background: #ecfdf5;
  color: #047857;
}
.status-pill.cancelled {
  background: #f1f5f9;
  color: #475569;
}
.table-action.danger {
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  cursor: pointer;
}
.piece-demand-wrap {
  border-color: rgba(124, 58, 237, 0.22);
  background: rgba(124, 58, 237, 0.035);
}
@media (max-width: 780px) {
  .todo-import-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .todo-import-form {
    justify-content: flex-start;
  }
  .deadline-tab {
    flex: 1;
  }
}

/* v24 - Prazos com abas no padrão do sistema, sem recarregar a página */
.deadline-tabbar {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.94);
  border-radius: 16px;
  padding: 4px;
  margin: 0 0 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.deadline-tab-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #64748b);
  cursor: pointer;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.deadline-tab-button:hover {
  color: var(--text, #0f172a);
  background: rgba(255, 255, 255, 0.75);
}
.deadline-tab-button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.22);
}
.dark .deadline-tabbar,
[data-theme="dark"] .deadline-tabbar {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
}
.dark .deadline-tab-button:hover,
[data-theme="dark"] .deadline-tab-button:hover {
  background: rgba(30, 41, 59, 0.9);
}
.deadline-tab-content {
  animation: deadlineTabFade 0.18s ease-out both;
}
@keyframes deadlineTabFade {
  from {
    opacity: 0.72;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 780px) {
  .deadline-tabbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .deadline-tab-button {
    width: 100%;
    padding: 11px 12px;
  }
}

/* Jurisprudência: ações no mesmo padrão visual da tela Modelos */
.juris-page .row-actions,
.juris-page .model-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.juris-page .row-actions form {
  display: inline-flex !important;
  margin: 0 !important;
}

.juris-page .row-actions .admin-icon-btn,
.juris-page .row-actions a.admin-icon-btn,
.juris-page .row-actions button.admin-icon-btn {
  width: 34px;
  height: 34px;
  margin-left: 0;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
}

.juris-page .row-actions .admin-icon-btn.edit {
  color: var(--purple) !important;
}

.juris-page .row-actions .admin-icon-btn.danger {
  color: var(--red) !important;
}

.juris-page .row-actions .admin-icon-btn.edit:hover {
  background: color-mix(in srgb, var(--purple) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--purple) 35%, transparent) !important;
  color: var(--purple) !important;
}

.juris-page .row-actions .admin-icon-btn.danger:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--red) 35%, transparent) !important;
  color: var(--red) !important;
}

/* Jurisprudência - botões no mesmo padrão de Configuração/Cadastro */
.juris-page .admin-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.juris-page .admin-actions form {
  display: inline-flex !important;
  margin: 0 !important;
}

/* Modelos - tabela Arquivos: ações no mesmo padrão de Configuração/Jurisprudência */
.models-page .admin-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.models-page .admin-actions .admin-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  padding: 0;
  margin: 0;
  box-shadow: none;
  cursor: pointer;
  text-decoration: none;
  color: #7b879d;
}
.models-page .admin-actions .admin-icon-btn[data-model-edit-url] {
  color: var(--purple) !important;
}
.models-page .admin-actions .admin-icon-btn[data-model-delete-form] {
  color: var(--red) !important;
}
.models-page .admin-actions .admin-icon-btn svg,
.models-page .admin-actions .admin-icon-btn svg path {
  stroke: currentColor !important;
}
.models-page .admin-actions .admin-icon-btn[data-model-edit-url]:hover {
  background: color-mix(in srgb, var(--purple) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--purple) 35%, transparent) !important;
  color: var(--purple) !important;
}
.models-page .admin-actions .admin-icon-btn[data-model-delete-form]:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--red) 35%, transparent) !important;
  color: var(--red) !important;
}

/* v31 - ajustes de notificações e modo escuro sem alterar layout base */
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .notification-row,
html[data-theme="dark"] .empty-state-card,
html[data-theme="dark"] .todo-import-card,
html[data-theme="dark"] .todo-table-card,
html[data-theme="dark"] .deadline-tab,
html[data-theme="dark"] .piece-demand-wrap {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: var(--soft-shadow) !important;
}
html[data-theme="dark"] .notification-panel-head,
html[data-theme="dark"] .notification-all-link {
  border-color: var(--line) !important;
}
html[data-theme="dark"] .notification-all-link {
  background: rgba(110, 89, 255, 0.12) !important;
  color: #c7d2fe !important;
}
html[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .notification-row:hover {
  background: rgba(110, 89, 255, 0.14) !important;
}
html[data-theme="dark"] .notification-item strong,
html[data-theme="dark"] .notification-row-body strong,
html[data-theme="dark"] .empty-state-card h3,
html[data-theme="dark"] .todo-import-card strong,
html[data-theme="dark"] .todo-table td,
html[data-theme="dark"] .todo-table th {
  color: var(--text) !important;
}
html[data-theme="dark"] .notification-item small,
html[data-theme="dark"] .notification-item em,
html[data-theme="dark"] .notification-row-body small,
html[data-theme="dark"] .notification-row-date,
html[data-theme="dark"] .notification-empty,
html[data-theme="dark"] .empty-state-card,
html[data-theme="dark"] .todo-import-card p,
html[data-theme="dark"] .empty-cell {
  color: var(--muted) !important;
}
html[data-theme="dark"] .todo-import-form input[type="file"] {
  background: var(--light) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .status-pill.pending {
  background: rgba(246, 156, 61, 0.15);
  color: #fdba74;
}
html[data-theme="dark"] .status-pill.linked {
  background: rgba(110, 89, 255, 0.18);
  color: #c7d2fe;
}
html[data-theme="dark"] .status-pill.done {
  background: rgba(22, 201, 154, 0.14);
  color: #86efac;
}
html[data-theme="dark"] .status-pill.cancelled {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

/* v33 - Revisão de responsividade e consistência i18n */
@media (max-width: 1180px) {
  .page-content,
  .main-content {
    min-width: 0;
  }

  .topbar {
    gap: 10px;
  }

  .searchbox {
    flex: 1 1 260px;
    min-width: 180px;
  }

  .kanban-wrap,
  .kanban-scroll,
  .kanban-board,
  .kanban-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .kanban-grid {
    min-width: 980px;
  }
}

@media (max-width: 900px) {
  .models-page,
  .jurisprudence-page,
  .deadline-page,
  .settings-page,
  .admin-cadastro-page,
  .search-page,
  .notifications-page,
  .piece-editor-page {
    width: 100%;
    min-width: 0;
  }

  .models-layout,
  .deadline-layout,
  .settings-layout,
  .admin-layout,
  .doc-settings-grid,
  .piece-editor-layout,
  .search-results-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-panel,
  .settings-panel,
  .models-panel,
  .deadline-panel,
  .juris-panel,
  .search-panel,
  .notification-panel,
  .piece-editor-panel {
    min-width: 0;
  }

  .admin-panel-head,
  .deadline-hero,
  .models-head,
  .jurisprudence-head,
  .search-section-head,
  .test-panel-head,
  .piece-editor-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .admin-panel-head .btn,
  .deadline-hero .btn,
  .models-head .btn,
  .jurisprudence-head .btn,
  .piece-editor-head .btn {
    justify-content: center;
    width: 100%;
  }

  .table-responsive,
  .admin-table-wrap,
  .models-table-wrap,
  .juris-table-wrap,
  .todo-table-wrap,
  .search-table-wrap {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.admin-table,
  table.files-table,
  table.models-table,
  table.juris-table,
  table.todo-table,
  table.search-table {
    min-width: 720px;
  }

  .todo-import-card,
  .todo-form-grid,
  .piece-meta-form,
  .model-meta-form,
  .generated-fields,
  .admin-form-grid,
  .doc-settings-grid {
    grid-template-columns: 1fr !important;
  }

  .notification-row,
  .search-result-row {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .topbar {
    left: 0;
    right: 0;
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .mobile-menu {
    flex: 0 0 42px;
  }

  .searchbox {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
  }

  .topbar-actions,
  .top-actions,
  .header-actions {
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .page-content {
    padding-top: 132px;
  }

  .deadline-tabbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .deadline-tabbar button,
  .deadline-tabbar .deadline-tab {
    justify-content: center;
    width: 100%;
  }

  .calendar-grid,
  .deadline-calendar-grid {
    min-width: 680px;
  }

  .calendar-shell,
  .deadline-calendar,
  .deadline-calendar-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-actions {
    justify-content: flex-start;
    white-space: nowrap;
  }

  .modal,
  .admin-modal,
  .ciadocs-action-modal,
  .ciadocs-message-modal {
    padding: 14px;
  }

  .modal-dialog,
  .admin-modal-dialog,
  .admin-small-modal,
  .ciadocs-action-dialog,
  .ciadocs-message-dialog {
    width: min(100%, 520px);
    max-height: calc(100vh - 28px);
    overflow-y: auto;
  }

  .editor-toolbar,
  .editor-toolbar-advanced {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .editor-toolbar .toolbar-group,
  .editor-toolbar-advanced .toolbar-group {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .stat-grid,
  .dashboard-stats,
  .settings-cards,
  .admin-card-grid,
  .models-team-grid,
  .juris-filter-grid {
    grid-template-columns: 1fr !important;
  }

  .btn,
  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .save-btn {
    min-height: 42px;
  }

  .admin-actions .admin-icon-btn {
    width: 36px;
    height: 36px;
  }

  .notification-dropdown,
  .notification-popover {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
  }

  .auth-card-v2,
  .login-card-v2 {
    width: 100%;
  }
}

/* V38 - Novo Modelo: organização de variáveis e jurisprudências */
.template-tools-row,
.juris-modal-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}
.juris-modal-filters {
  grid-template-columns: minmax(240px, 1fr) 170px 170px;
}
.compact-search,
.compact-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border-radius: 14px;
  padding: 0 12px;
  font: inherit;
  outline: none;
}
.compact-search:focus,
.compact-select:focus {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.variable-catalog {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.enhanced-variable-chip {
  align-items: flex-start;
  /*min-height: 74px;*/
}
.enhanced-variable-chip small {
  white-space: normal;
  line-height: 1.35;
}
.variable-create-form-enhanced label small,
.juris-helper-text {
  color: var(--muted, #64748b);
  font-size: 0.78rem;
  line-height: 1.35;
}
.checkbox-line.soft-checkbox-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.72);
}
.checkbox-line.soft-checkbox-line input {
  accent-color: #7c3aed;
}
.selected-juris-summary {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}
.selected-juris-summary > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted, #64748b);
  font-size: 0.84rem;
}
.selected-juris-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface, #fff);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--text, #0f172a);
  max-width: 100%;
}
.ciadocs-inline-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 18px;
}
.ciadocs-inline-modal.open {
  display: grid;
}
.ciadocs-inline-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}
.ciadocs-inline-modal-card {
  position: relative;
  width: min(920px, 96vw);
  max-height: min(760px, 92vh);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  padding: 18px;
}
.ciadocs-inline-modal-card header,
.ciadocs-inline-modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ciadocs-inline-modal-card h3 {
  margin: 2px 0 0;
}
.juris-modal-list {
  overflow: auto;
  padding-right: 4px;
}
.jurisprudence-picker-item[hidden],
.enhanced-variable-chip[hidden] {
  display: none !important;
}
.enhanced-generated-field small {
  line-height: 1.4;
}
html[data-theme="dark"] .compact-search,
html[data-theme="dark"] .compact-select,
html[data-theme="dark"] .ciadocs-inline-modal-card,
html[data-theme="dark"] .selected-juris-pill {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}
html[data-theme="dark"] .checkbox-line.soft-checkbox-line {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(167, 139, 250, 0.2);
}
@media (max-width: 720px) {
  .template-tools-row,
  .juris-modal-filters {
    grid-template-columns: 1fr;
  }
  .ciadocs-inline-modal-card {
    padding: 14px;
    border-radius: 18px;
  }
  .juris-modal-list {
    grid-template-columns: 1fr;
  }
}

/* To-do no calendário de prazos fatais */
.deadline-agenda-card.is-readonly {
  cursor: default;
}
.deadline-agenda-card.is-readonly .deadline-agenda-description {
  white-space: normal;
}



/* V44: keep logout anchored to the bottom of the sidebar */
.nav-logout-form {
  margin-top: auto;
  margin-bottom: 31px;
  width: 100%;
  flex: 0 0 auto;
}
.nav-logout-form .logout {
  margin: 0;
  width: 100%;
}
/* V46 - consulta de processo */
.process-lookup-row{display:flex;gap:12px;align-items:flex-end;padding:10px 15px 15px}.process-lookup-row .full-field{flex:1;margin:0}.process-lookup-result{margin:0 15px 15px;padding:12px 14px;border:1px solid #dfe3e8;border-radius:10px;background:#f8fafc;font-size:13px;line-height:1.55}.process-lookup-result strong{display:block;margin-bottom:4px}.process-lookup-result.is-error{background:#fff5f5}.process-lookup-result.is-success{background:#f6fff8}@media(max-width:700px){.process-lookup-row{display:block}.process-lookup-row .btn{margin-top:10px;width:100%}}


/* V46.3 - Novo Modelo: catálogo mais limpo e painéis secundários recolhidos */
.enhanced-variable-chip {
  align-items: center;
  min-height: 46px;
}
.enhanced-variable-chip span {
  line-height: 1.25;
}
