/* GEMBA LEAN · shell no padrão do AGPR5 Brain
   Tipografia, controles, barra lateral, login, conta e introdução. Carregado depois de app.css. */

/* ---------------------------------------------------------------- base */

html {
  -webkit-text-size-adjust: 100%;
}
/* `hidden` precisa vencer qualquer `display` dos componentes. */
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font: 15px/1.5 var(--font-body);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
}
h1 {
  font-size: 26px;
  font-weight: 700;
}
h2 {
  font-size: 17px;
  font-weight: 700;
}
h3 {
  font-size: 14.5px;
  font-weight: 700;
}
::selection {
  background: var(--ring-soft);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--input) transparent;
}
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- controles */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--foreground);
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
button:hover {
  background: var(--muted);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.primary,
button.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.primary:hover,
button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.danger {
  color: var(--red);
}
.danger-outline {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
  background: transparent;
}
.danger-outline:hover {
  background: var(--danger-soft);
}
.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
}
.icon-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}
.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  color: var(--accent);
}
.link-btn:hover {
  background: transparent;
  text-decoration: underline;
}

input,
select,
textarea {
  border: 1px solid var(--input);
  border-radius: 8px;
  padding: 8px 11px;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
input[readonly] {
  background: var(--muted);
  color: var(--muted-foreground);
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
/* Lista dos selects estilizada (Chrome/Edge 135+). Nos demais navegadores fica a lista
   nativa, com a seta acima. Vale para todos os selects do app, sem mudar a marcação. */
@supports (appearance: base-select) {
  select:not([multiple]),
  select:not([multiple])::picker(select) {
    appearance: base-select;
  }
  select:not([multiple]) {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    background-image: none;
    cursor: pointer;
  }
  select:not([multiple]):hover {
    border-color: color-mix(in srgb, var(--input) 60%, var(--foreground));
  }
  select:not([multiple])::picker-icon {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: auto;
    background: var(--muted-foreground);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
      center / contain no-repeat;
    transition: rotate 0.15s;
  }
  select:not([multiple]):open::picker-icon {
    rotate: 180deg;
  }
  select:not([multiple]):open {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--ring-soft);
  }
  ::picker(select) {
    margin-top: 6px;
    padding: 4px;
    max-height: min(340px, 60vh);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--foreground);
    box-shadow: var(--shadow-md);
  }
  select option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
  }
  select option:hover,
  select option:focus-visible {
    background: var(--muted);
    outline: none;
  }
  select option:checked {
    background: var(--accent-soft);
    color: var(--accent-soft-fg);
    font-weight: 600;
  }
  select option::checkmark {
    content: '';
    order: 1;
    width: 14px;
    height: 14px;
    margin-left: auto;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
      center / contain no-repeat;
  }
  select option:disabled {
    color: var(--faint);
    cursor: not-allowed;
  }
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--primary);
}
input[type='file'] {
  padding: 7px;
  background: var(--surface);
}
.field label {
  font-size: 13px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- superfícies */

.stat,
.panel {
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.stat small {
  font-size: 13px;
  font-weight: 500;
}
.stat strong {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.panel h2 {
  font-size: 16px;
}
th {
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface);
}
.badge {
  border-radius: 6px;
  font-weight: 500;
}
.list-item {
  border-radius: 10px;
}
.board-frame {
  border-radius: var(--radius);
}
.postit {
  border-radius: 8px;
}
/* Post-its mantêm as cores de papel nos dois temas. */
.postit .badge {
  background: rgb(255 255 255 / 70%);
  color: #21323d;
}
.postit .badge.red {
  background: #ffedef;
  color: #a62130;
}
.postit .badge.teal {
  background: #ddf3f1;
  color: #066b70;
}
.postit .badge.dark {
  background: #e1e7f6;
  color: #334279;
}
.trend text {
  fill: var(--muted-foreground);
}
.trend line[stroke='#dde6ec'] {
  stroke: var(--border);
}
.trend line[stroke='#087f8c'],
.trend polyline {
  stroke: var(--accent);
}
.trend circle {
  fill: var(--accent);
}

dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 24px 60px rgb(0 0 0 / 22%);
}
.modal-head {
  padding: 16px 20px 16px 24px;
}
.modal-head h2 {
  font-size: 18px;
}
.toast {
  border-radius: 10px;
  font-size: 14px;
  padding: 12px 18px;
}

/* ---------------------------------------------------------------- estrutura */

body:not(.signed-in) > .app,
body.booting > .app,
body.booting > .access-screen {
  display: none !important;
}
body.signed-in > .access-screen {
  display: none;
}
.boot-loader {
  display: none;
}
body.booting > .boot-loader {
  display: grid;
  place-items: center;
  min-height: 100vh;
}
.boot-loader span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  min-height: 100vh;
}
main {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  color: var(--foreground);
}
/* Medidas da barra lateral do AGPR5 Brain (components/NavSidebar.tsx). */
.sidebar-head {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 16px;
}
.brand {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  letter-spacing: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
  box-sizing: border-box;
  object-fit: contain;
  padding: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 4px 8px rgb(8 127 140 / 18%));
}
:root:not([data-theme='dark']) .sidebar .brand-mark {
  content: url('/assets/brand/gemba-lean-favicon-light.png?v=2.4.2');
}
.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.035em;
  white-space: nowrap;
}
.brand-tagline {
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand b,
.auth-wordmark b,
.auth-mobile-brand b {
  color: var(--accent);
}
/* Seletor de sistema na marca: Gemba Daily ↔ Gemba TWI. */
.app-switch {
  position: relative;
  flex: 1;
  min-width: 0;
}
.app-switch-trigger {
  width: calc(100% + 12px);
  margin: 0 -6px;
  gap: 10px;
  padding: 4px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.app-switch-trigger:hover,
.app-switch-trigger[aria-expanded='true'] {
  background: var(--sidebar-hover);
}
.app-switch-chevron {
  display: flex;
  margin-left: auto;
  color: var(--muted-foreground);
}
.app-switch-chevron .icon {
  width: 16px;
  height: 16px;
}
.app-switch-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: -6px;
  z-index: 40;
  min-width: calc(100% + 12px);
  width: max-content;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-md);
}
.app-switch-menu[hidden] {
  display: none;
}
.app-switch-label {
  padding: 4px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  text-transform: uppercase;
}
.app-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  color: var(--foreground);
  text-decoration: none;
}
.app-switch-item:hover {
  background: var(--muted);
}
.app-switch-item.is-current {
  background: var(--accent-soft);
}
.app-switch-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  object-fit: contain;
}
:root:not([data-theme='dark']) img.app-switch-logo:not(.twi) {
  content: url('/assets/brand/gemba-lean-favicon-light.png?v=2.4.2');
}
.app-switch-logo.twi {
  display: grid;
  place-items: center;
  object-fit: contain;
  padding: 2px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
}
.app-switch-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}
.app-switch-copy strong {
  font-size: 13.5px;
}
.app-switch-copy small {
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.app-switch-check {
  display: flex;
  margin-left: auto;
  color: var(--accent);
}
.app-switch-check .icon {
  width: 16px;
  height: 16px;
}
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}
.nav-group + .nav-group {
  margin-top: 16px;
}
.nav-label {
  padding: 0 10px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.sidebar nav button,
.side-link {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
}
.sidebar nav button + button,
.side-link + .side-link {
  margin-top: 2px;
}
.sidebar nav button:hover,
.side-link:hover {
  background: var(--sidebar-hover);
  color: var(--foreground);
}
.sidebar nav button.active {
  background: var(--sidebar-active);
  color: var(--foreground);
  font-weight: 600;
}
.sidebar nav button.active .icon {
  color: var(--accent);
}
.sidebar-foot {
  padding: 8px;
  border-top: 1px solid var(--sidebar-border);
}
.side-link {
  font-size: 12.5px;
}
.sync-state {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 2px;
  font-size: 11.5px;
  color: var(--faint);
}
.sync-state .icon {
  width: 13px;
  height: 13px;
}
.sync-state.saved .icon {
  color: var(--success);
}
.sync-state.saving .icon {
  animation: spin 0.9s linear infinite;
}
.sync-state.offline {
  color: var(--red);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
}
.user-card-main {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  gap: 10px;
  padding: 6px;
  border: 0;
  background: transparent;
  text-align: left;
}
.user-card-main:hover {
  background: var(--sidebar-hover);
}
.user-card-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.user-card-text strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}
.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: var(--avatar);
  color: var(--avatar-fg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-size: 10px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
}
.role-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.role-badge.leader {
  border-color: color-mix(in srgb, var(--amber-soft-fg) 30%, transparent);
  background: var(--amber-soft);
  color: var(--amber-soft-fg);
}
.role-badge.analyst {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success-soft-fg);
}

/* Cabeçalho no padrão do Brain: ícone do módulo, título, descrição e data. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 32px;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.page-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.page-icon .icon {
  width: 18px;
  height: 18px;
}
.page-meta {
  min-width: 0;
}
.page-title {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.page-desc {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-foreground);
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Data no topo. Classe própria: .today marca a coluna de hoje nas tabelas e no calendário. */
.topbar-today {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted-foreground);
}
.topbar-today .icon {
  width: 15px;
  height: 15px;
}
#today-label::first-letter {
  text-transform: uppercase;
}
.mobile-menu {
  display: none;
}
.workspace {
  padding: 28px 32px 40px;
}
.heading {
  margin-bottom: 24px;
}
.heading h1 {
  margin-bottom: 4px;
}
.scrim {
  display: none;
}

@media (max-width: 760px) {
  .app {
    display: block;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }
  body.nav-open .sidebar {
    transform: none;
  }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(9 9 11 / 45%);
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    padding: 0 16px;
  }
  .workspace {
    padding: 20px 16px 32px;
  }
  .topbar-today {
    display: none;
  }
}

/* ---------------------------------------------------------------- login */

.access-screen {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  min-height: 100vh;
  background: var(--background);
}
/* Painel da marca: estático, verde-petróleo liso e um mini quadro Heijunka. */
/* Nome no topo e rodapé fixos; o conteúdo fica centralizado na mesma altura do formulário. */
.auth-stage {
  --stage-x: clamp(40px, 6vw, 88px);
  position: relative;
  display: flex;
  align-items: center;
  padding: 104px var(--stage-x);
  background: #0c3337;
  color: #fff;
}
.auth-wordmark {
  position: absolute;
  top: 48px;
  left: var(--stage-x);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.auth-wordmark .brand-mark {
  width: 68px;
  height: 68px;
  flex-basis: 68px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / 22%));
}
.auth-wordmark .brand-name {
  font-size: 22px;
  color: #fff;
}
.auth-wordmark b {
  color: #5fd8d4;
}
.auth-pitch {
  max-width: 480px;
}
.auth-pitch h1 {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #fff;
}
.auth-pitch > p {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: rgb(255 255 255 / 68%);
}
.auth-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 36px;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 14px;
  background: rgb(255 255 255 / 4%);
}
.auth-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 212px;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgb(0 0 0 / 14%);
}
.auth-col span {
  margin-bottom: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 55%);
  text-align: center;
}
.auth-col i {
  display: block;
  height: 30px;
  border-radius: 4px;
  background-image: linear-gradient(rgb(33 50 61 / 22%), rgb(33 50 61 / 22%)), linear-gradient(rgb(33 50 61 / 14%), rgb(33 50 61 / 14%));
  background-size:
    70% 3px,
    45% 3px;
  background-position:
    7px 9px,
    7px 17px;
  background-repeat: no-repeat;
}
.auth-col i.green {
  background-color: #d7edbf;
}
.auth-col i.yellow {
  background-color: #fff0ad;
}
.auth-col i.pink {
  background-color: #f8cedf;
}
.auth-col i.blue {
  background-color: #c8e4f9;
}
.auth-meta {
  position: absolute;
  bottom: 44px;
  left: var(--stage-x);
  font-size: 12px;
  color: rgb(255 255 255 / 45%);
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-form {
  width: 100%;
  max-width: 380px;
}
.auth-mobile-brand {
  display: none;
  margin-bottom: 32px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.auth-mobile-brand .brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  padding: 0;
  border-radius: 0;
}
.auth-mobile-brand .brand-name {
  font-size: 20px;
}
.auth-form h2 {
  margin: 0;
  font-size: 25px;
}
.auth-form > .sub {
  margin: 6px 0 26px;
  font-size: 13.5px;
}
.auth-form .field {
  margin-bottom: 14px;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.input-icon {
  position: relative;
}
.input-icon > .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}
.input-icon input {
  height: 44px;
  padding-left: 38px;
  border-width: 1.5px;
  border-radius: 12px;
  font-size: 14px;
}
.input-icon input:focus {
  border-color: #0ca8b4;
  box-shadow: 0 0 0 4px rgb(12 168 180 / 14%);
}
.input-action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
}
.input-icon input[type='password'],
#login-password {
  padding-right: 44px;
}
.hint-box {
  margin: 4px 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.5;
}
.remember-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 18px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.remember-check input {
  width: auto;
}
.login-submit {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.login-submit.busy .icon {
  display: none;
}
.access-error {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--red);
}
.auth-foot {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
}
@media (max-width: 1023px) {
  .access-screen {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-stage {
    display: none;
  }
  .auth-mobile-brand {
    display: flex;
  }
}

/* ---------------------------------------------------------------- troca de senha obrigatória */

.gate-dialog {
  width: min(440px, 94vw);
  padding: 0;
}
.gate-dialog::backdrop {
  background: rgb(9 9 11 / 60%);
  backdrop-filter: blur(3px);
}
.gate {
  display: grid;
  gap: 12px;
  padding: 28px;
}
.gate h2 {
  margin: 4px 0 0;
  font-size: 21px;
}
.gate .sub {
  margin: 0 0 6px;
}
.gate-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.gate-icon .icon {
  width: 22px;
  height: 22px;
}
.gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.user-row {
  justify-content: flex-start;
}
.user-row > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

/* ---------------------------------------------------------------- conta */

/* Configurações: segunda barra lateral com as seções e conteúdo com cabeçalho próprio. */
@media (min-width: 761px) {
  body[data-page='settings'] .topbar {
    display: none;
  }
}
body[data-page='settings'] .workspace {
  padding: 0;
}
.settings {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.settings-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
}
.settings-nav-head {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}
.settings-nav nav {
  padding: 4px 8px 12px;
}
.settings-nav nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0 0 2px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-foreground);
  text-align: left;
}
.settings-nav nav button:hover {
  background: var(--sidebar-hover);
}
.settings-nav nav button.active {
  background: var(--sidebar-active);
}
.settings-nav nav button.active .icon {
  color: var(--accent);
}
.settings-nav nav button span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.settings-nav nav b {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--foreground);
}
.settings-nav nav button.active b {
  font-weight: 600;
}
.settings-nav nav small {
  font-size: 11.5px;
  line-height: 1.35;
}
.settings-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--border);
}
.settings-head h1 {
  margin: 0;
  font-size: 17px;
}
.settings-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.settings-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}
.section-label.first {
  margin-top: 0;
}
.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.settings-card strong {
  font-size: 14.5px;
}
.settings-card .sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
}
.settings-card button {
  flex-shrink: 0;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
}
.theme-option:hover {
  background: var(--card);
  border-color: var(--input);
}
.theme-option.selected {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
.theme-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 78px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.theme-preview i {
  display: block;
  height: 8px;
  border-radius: 4px;
}
.theme-preview i:nth-child(1) {
  width: 45%;
}
.theme-preview i:nth-child(2) {
  width: 80%;
}
.theme-preview i:nth-child(3) {
  width: 62%;
}
.theme-preview.light {
  background: #fff;
}
.theme-preview.light i {
  background: #e4e4e7;
}
.theme-preview.dark {
  background: #18181b;
}
.theme-preview.dark i {
  background: #3f3f46;
}
.theme-preview.system {
  background: linear-gradient(135deg, #fff 50%, #18181b 50%);
}
.theme-preview.system i {
  background: #a1a1aa;
}
.theme-preview i:first-child {
  background: #0ca8b4 !important;
}
.theme-option-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
}
.theme-option-label b {
  font-size: 13.5px;
  font-weight: 600;
}
.theme-option small {
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.about-list {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.about-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  font-size: 13.5px;
}
.about-list div + div {
  border-top: 1px solid var(--border);
}
.about-list dt {
  color: var(--muted-foreground);
}
.about-list dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}
@media (max-width: 760px) {
  .settings {
    display: block;
    min-height: 0;
  }
  .settings-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }
  .settings-nav-head {
    display: none;
  }
  .settings-nav nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
  }
  .settings-nav nav button {
    width: auto;
    flex-shrink: 0;
    margin: 0;
  }
  .settings-nav nav small {
    display: none;
  }
  .settings-head {
    padding: 10px 16px;
  }
  .settings-body {
    padding: 20px 16px 32px;
  }
  .theme-options {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.account-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.account-id strong {
  font-family: var(--font-heading);
  font-size: 17px;
}
.account-id small {
  color: var(--muted-foreground);
  font-size: 13px;
}
.section-label {
  margin: 26px 0 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.session-row strong {
  display: block;
  font-size: 14px;
}
.session-row small {
  color: var(--muted-foreground);
  font-size: 12.5px;
}
@media (max-width: 760px) {
  .form-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .sidebar,
  .topbar,
  .access-screen,
  .boot-loader {
    display: none !important;
  }
}

/* ---------------------------------------------------------------- linha de ações das páginas */

.heading.slim {
  align-items: center;
  margin-bottom: 20px;
}
.heading.slim .heading-note {
  flex: 1;
  min-width: 0;
}
.heading.slim .actions {
  flex-shrink: 0;
  flex-wrap: nowrap;
}
@media (max-width: 760px) {
  .heading.slim {
    flex-direction: column;
    align-items: stretch;
  }
  .heading.slim .actions {
    flex-wrap: wrap;
  }
}
.heading-note {
  font-size: 14px;
  color: var(--muted-foreground);
}
.heading-note b {
  color: var(--foreground);
  font-weight: 600;
}
.print-only {
  display: none;
}
@media print {
  .print-only {
    display: block;
  }
}

/* ---------------------------------------------------------------- campos de data (datepicker.js) */

.date-field {
  position: relative;
  display: flex;
  min-width: 150px;
}
.date-field > input[data-picker] {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.date-display {
  flex: 1;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--input);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  box-shadow: none;
}
.date-display:hover {
  background: var(--background);
  border-color: color-mix(in srgb, var(--input) 60%, var(--foreground));
}
.date-display.open,
.date-display:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
.date-display.empty .date-text {
  color: var(--faint);
}
.date-display.invalid {
  border-color: var(--red);
}
.date-display .date-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.date-display .icon {
  color: var(--muted-foreground);
}

.datepicker {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
}
.datepicker button {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dp-nav {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--muted-foreground) !important;
}
.dp-nav:hover {
  background: var(--muted) !important;
  color: var(--foreground) !important;
}
.dp-title {
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}
button.dp-title:hover {
  background: var(--muted);
}
.dp-week,
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-week span {
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
}
.dp-day,
.dp-month {
  height: 34px;
  padding: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.dp-day:hover,
.dp-month:hover {
  background: var(--muted) !important;
}
.dp-day.weekend {
  color: var(--muted-foreground);
}
.dp-day.out {
  color: var(--faint);
  opacity: 0.55;
}
.dp-day.today,
.dp-month.today {
  box-shadow: inset 0 0 0 1px var(--accent-border);
  color: var(--accent);
  font-weight: 700;
}
.dp-day.selected,
.dp-month.selected {
  background: var(--primary) !important;
  color: var(--primary-fg);
  font-weight: 700;
  opacity: 1;
}
.dp-day:disabled,
.dp-month:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.dp-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.dp-month {
  height: 42px;
  text-transform: capitalize;
}
.dp-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dp-link {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted-foreground) !important;
}
.dp-link.strong {
  color: var(--accent) !important;
  font-weight: 600;
}
.dp-link:hover {
  background: var(--muted) !important;
}
/* Horário: duas colunas roláveis, horas e minutos. */
.datepicker.time-mode {
  width: 196px;
}
.dp-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dp-col-wrap > span {
  display: block;
  padding: 0 0 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
}
.dp-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 208px;
  overflow-y: auto;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface);
  scrollbar-width: none;
}
.dp-time-item {
  flex-shrink: 0;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.dp-time-item:hover {
  background: var(--muted) !important;
}
.dp-time-item.now {
  color: var(--accent);
  font-weight: 700;
}
.dp-time-item.selected {
  background: var(--primary) !important;
  color: var(--primary-fg);
  font-weight: 700;
}
.dp-time-item:disabled {
  opacity: 0.3;
}
.datepicker.time-mode .dp-title {
  width: 100%;
  text-align: center;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* Na barra de ferramentas o campo de data ocupa o espaço, como os inputs dela. */
.toolbar > .date-field {
  flex: 1;
  min-width: 190px;
}
