/* MyDoc — especificação comum, derivada da referência fornecida. */



*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--loud);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-weight: var(--w-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-slow) var(--ease),
              color var(--dur-slow) var(--ease);
}

::selection { background: var(--brand-muted); color: var(--loud); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}


* { scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: var(--r-full); }
*::-webkit-scrollbar-thumb:hover { background: var(--stroke-strong); }


.t-display, .t-h1, .t-h2, .t-h3, .t-h4 {
  font-family: var(--font-title);
  font-weight: var(--w-medium);
  color: var(--loud);
  margin: 0;
}
.t-display { font-size: var(--text-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
.t-h1 { font-size: var(--text-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); }
.t-h2 { font-size: var(--text-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
.t-h3 { font-size: var(--text-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
.t-h4 { font-size: var(--text-h4); line-height: var(--lh-h4); letter-spacing: var(--ls-h4); }

.t-body-lg { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: var(--w-regular); }
.t-body    { font-size: var(--text-base); line-height: var(--lh-base); font-weight: var(--w-regular); }
.t-body-sm { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: var(--w-regular); }

.t-label-lg { font-size: var(--label-lg); line-height: var(--lh-label-lg); letter-spacing: var(--ls-label-lg); font-weight: var(--w-medium); }
.t-label    { font-size: var(--label-base); line-height: var(--lh-label); letter-spacing: var(--ls-label); font-weight: var(--w-medium); }
.t-label-sm { font-size: var(--label-sm); line-height: var(--lh-label-sm); letter-spacing: var(--ls-label-sm); font-weight: var(--w-medium); }

.t-mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: var(--lh-mono);
  letter-spacing: var(--ls-mono);
  font-weight: var(--w-medium);
  text-transform: uppercase;
}

.c-loud  { color: var(--loud); }
.c-muted { color: var(--muted); }
.c-ghost { color: var(--ghost); }
.c-brand { color: var(--brand); }


.t-gradient {
  background-image: linear-gradient(180deg, var(--loud), color-mix(in srgb, var(--loud) 72%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


.btn {
  --btn-py: 9px;
  --btn-px: 18px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--btn-py) var(--btn-px);
  border: 0;
  border-radius: var(--r-full);        
  font-family: var(--font-body);
  font-size: var(--label-base);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  font-weight: var(--w-medium);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}

.btn:active { transition-duration: var(--dur-instant); transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--brand-contrast);
  box-shadow: var(--btn-primary-shadow);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:active:not(:disabled) { background: var(--brand-active); }

.btn-neutral {
  background: var(--btn-neutral-bg);
  color: var(--loud);
  box-shadow: var(--btn-neutral-shadow);
}
.btn-neutral:hover:not(:disabled) { background: var(--bg-ghost); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-ghost); color: var(--loud); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-danger:hover:not(:disabled) { filter: brightness(.93); }

.btn-sm { --btn-py: 5px; --btn-px: 12px; font-size: var(--label-sm); }
.btn-lg { --btn-py: 12px; --btn-px: 24px; font-size: var(--label-lg); }
.btn-icon { --btn-px: 9px; }
.btn-block { display: flex; width: 100%; }

.btn svg { width: 16px; height: 16px; flex: none; }


.btn-swap { overflow: hidden; }
.btn-swap .swap-track {
  display: grid; place-items: center;
  overflow: hidden;                 
  height: var(--lh-label);
  transition: transform var(--dur-fast) var(--ease);
}
.btn-swap .swap-track > * { grid-area: 1 / 1; }
.btn-swap .swap-out { transform: translateY(0); }
.btn-swap .swap-in { transform: translateY(120%); }
.btn-swap:hover .swap-out { transform: translateY(-120%); }
.btn-swap:hover .swap-in { transform: translateY(0); }
.btn-swap .swap-out, .btn-swap .swap-in {
  transition: transform var(--dur-fast) var(--ease);
}


.field { display: flex; flex-direction: column; gap: var(--sp-3); }
.field-label {
  font-size: var(--label-sm);
  line-height: var(--lh-label-sm);
  letter-spacing: var(--ls-label-sm);
  font-weight: var(--w-medium);
  color: var(--muted);
}
.field-hint { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--ghost); }
.field-error { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-ghost);
  color: var(--loud);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  transition: all var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ghost); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--stroke); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brand-ghost);
}
.input:disabled, .select:disabled, .textarea:disabled {
  opacity: .5; cursor: not-allowed;
}
.input[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.textarea { min-height: 88px; resize: vertical; }

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' 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;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 36px; }
.input-group .input-icon {
  position: absolute; left: 12px; display: grid; place-items: center;
  color: var(--ghost); pointer-events: none;
}
.input-group .input-icon svg { width: 16px; height: 16px; }


.check { display: inline-flex; align-items: center; gap: var(--sp-4); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 18px; height: 18px; flex: none;
  border: 1px solid var(--stroke);
  border-radius: var(--r-xs);
  background: var(--bg-ghost);
  display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease);
}
.check .box.round { border-radius: var(--r-full); }
.check .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.6); transition: all var(--dur-fast) var(--ease); }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--brand-ghost); }
.check .txt { font-size: var(--text-base); color: var(--loud); }


.switch { display: inline-flex; align-items: center; gap: var(--sp-4); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 22px; flex: none;
  background: var(--bg-muted);
  border-radius: var(--r-full);
  padding: 2px;
  transition: background var(--dur-fast) var(--ease);
}
.switch .thumb {
  width: 18px; height: 18px;
  background: #fff;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--brand-ghost); }


.badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--label-sm);
  line-height: var(--lh-label-sm);
  letter-spacing: var(--ls-label-sm);
  font-weight: var(--w-medium);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; flex: none; }
.badge-neutral { background: var(--bg-muted); color: var(--muted); }
.badge-brand   { background: var(--brand-ghost); color: var(--brand); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }


.card {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--dur-fast) var(--ease);
}
.card-pad { padding: var(--sp-9); }
.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--stroke);
}
.card-header {
  padding: var(--sp-7) var(--sp-9);
  border-bottom: 1px solid var(--stroke-lighter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-7);
}
.card-body { padding: var(--sp-9); }
.card-footer {
  padding: var(--sp-7) var(--sp-9);
  border-top: 1px solid var(--stroke-lighter);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-4);
}


.stat { display: flex; flex-direction: column; gap: var(--sp-3); }
.stat-label { font-size: var(--text-sm); color: var(--muted); }
.stat-value {
  font-family: var(--font-title);
  font-size: var(--text-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
  font-weight: var(--w-medium);
  color: var(--loud);
  font-variant-numeric: tabular-nums;
}
.stat-delta { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--text-sm); }
.stat-up { color: var(--success); }
.stat-down { color: var(--danger); }


.table-wrap {
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table thead th {
  padding: var(--sp-5) var(--sp-7);
  text-align: left;
  background: var(--bg-ghost);
  border-bottom: 1px solid var(--stroke-lighter);
  font-size: var(--label-sm);
  letter-spacing: var(--ls-label-sm);
  font-weight: var(--w-medium);
  color: var(--muted);
  white-space: nowrap;
}
.table tbody td {
  padding: var(--sp-6) var(--sp-7);
  border-bottom: 1px solid var(--stroke-lighter);
  color: var(--loud);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--bg-ghost); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-acao { width: 1%; white-space: nowrap; }



.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 520px; }
.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--stroke-lighter);
  padding: var(--sp-7);
  display: flex; flex-direction: column; gap: var(--sp-8);
}
.sidebar-brand { display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-4); }
.sidebar-mark {
  width: 28px; height: 28px; flex: none;
  border-radius: var(--r-md);
  background: var(--brand);
  box-shadow: var(--btn-primary-shadow);
  display: grid; place-items: center;
  color: #fff;
}
.sidebar-mark svg { width: 15px; height: 15px; }
.nav-group { display: flex; flex-direction: column; gap: var(--sp-1); }
.nav-title {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--ghost);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
}
.nav-item {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 7px var(--sp-4);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: var(--label-base);
  letter-spacing: var(--ls-label);
  font-weight: var(--w-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item:hover { background: var(--bg-ghost); color: var(--loud); }
.nav-item.ativo { background: var(--brand-ghost); color: var(--brand); }
.nav-item .conta {
  margin-left: auto;
  font-size: var(--label-sm);
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--bg-muted);
  color: var(--muted);
}


.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-7);
  padding: 0 var(--sp-9);
  border-bottom: 1px solid var(--stroke-lighter);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);       
  -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}


.tabs { display: inline-flex; gap: var(--sp-1); padding: 3px; background: var(--bg-ghost); border-radius: var(--r-full); }
.tab {
  padding: 6px 16px;
  border: 0; background: transparent;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--label-base);
  letter-spacing: var(--ls-label);
  font-weight: var(--w-medium);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.tab:hover { color: var(--loud); }
.tab:active { transition-duration: var(--dur-instant); transform: translateY(1px); }
.tab.ativo { background: var(--bg-elevated); color: var(--loud); box-shadow: var(--shadow-sm); }


.avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--brand-ghost);
  color: var(--brand);
  font-size: var(--label-sm);
  font-weight: var(--w-medium);
  letter-spacing: 0;
  border: 1px solid var(--stroke-lighter);
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: var(--label-base); }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }


.alert {
  display: flex; gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-7);
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke-lighter);
  font-size: var(--text-base);
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert-title { font-weight: var(--w-medium); color: var(--loud); }
.alert-info    { background: var(--info-bg); color: var(--info); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-danger  { background: var(--danger-bg); color: var(--danger); }
.alert p { margin: 2px 0 0; color: var(--muted); }


.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: var(--sp-7);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.modal-backdrop.aberto { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 460px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  transform: translateY(8px) scale(.98);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.modal-backdrop.aberto .modal { transform: translateY(0) scale(1); }


.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 200px;
  padding: var(--sp-3);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: all var(--dur-fast) var(--ease);
}
.dropdown.aberto .dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--sp-5);
  width: 100%;
  padding: 7px var(--sp-5);
  border: 0; background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--loud);
  text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.dropdown-item:hover { background: var(--bg-ghost); }
.dropdown-item svg { width: 15px; height: 15px; color: var(--muted); }
.dropdown-sep { height: 1px; background: var(--stroke-lighter); margin: var(--sp-3) 0; }


.combo { position: relative; }

.combo-botao {
  width: 100%;
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 9px 12px;
  background: var(--bg-ghost);
  color: var(--loud);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  text-align: left;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.combo-botao:hover { border-color: var(--stroke); }
.combo-botao:focus-visible,
.combo.aberto .combo-botao {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brand-ghost);
}
.combo-botao:active { transition-duration: var(--dur-instant); }
.combo-valor { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-valor.vazio { color: var(--ghost); }
.combo-seta {
  width: 16px; height: 16px; flex: none; color: var(--muted);
  transition: transform var(--dur-fast) var(--ease);
}
.combo.aberto .combo-seta { transform: rotate(180deg); }

.combo-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  padding: var(--sp-3);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: all var(--dur-fast) var(--ease);
}
.combo.aberto .combo-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.combo.para-cima .combo-menu { top: auto; bottom: calc(100% + 6px); }

.combo-busca { position: relative; margin-bottom: var(--sp-3); }
.combo-busca input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  background: var(--bg-ghost);
  color: var(--loud);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
}
.combo-busca input:focus { outline: none; border-color: var(--brand); }
.combo-busca svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--ghost); pointer-events: none;
}

.combo-lista { max-height: 248px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }

.combo-item {
  display: flex; align-items: center; gap: var(--sp-5);
  width: 100%;
  padding: 8px var(--sp-5);
  border-radius: var(--r-sm);
  font-size: var(--text-base);
  color: var(--loud);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.combo-item:hover,
.combo-item.destacado { background: var(--bg-ghost); }
.combo-item[aria-selected='true'] { color: var(--brand); font-weight: var(--w-medium); }
.combo-item .marca { width: 15px; height: 15px; flex: none; opacity: 0; }
.combo-item[aria-selected='true'] .marca { opacity: 1; }
.combo-item .rotulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item .apoio { color: var(--muted); font-size: var(--text-sm); flex: none; }

.combo-vazio { padding: var(--sp-7) var(--sp-5); text-align: center; color: var(--ghost); font-size: var(--text-sm); }


@media (max-width: 720px) {
  .combo-botao { font-size: 16px; padding: 12px 14px; min-height: 46px; }

  .combo-menu {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 110;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding: var(--sp-5) var(--sp-7) calc(var(--sp-8) + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform var(--dur-slow) var(--ease);
    max-height: 76vh;
  }
  .combo.aberto .combo-menu { transform: translateY(0); }
  .combo.para-cima .combo-menu { bottom: 0; top: auto; }
  .combo-menu::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    margin: 0 auto var(--sp-6);
    border-radius: var(--r-full);
    background: var(--stroke-strong);
  }
  .combo-item { padding: 13px var(--sp-6); min-height: 48px; font-size: 16px; }
  .combo-lista { max-height: 52vh; }
  .combo-busca input { font-size: 16px; padding: 11px 12px 11px 34px; }
  .combo-veu {
    position: fixed; inset: 0; z-index: 105;
    background: var(--overlay);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease);
  }
  .combo.aberto .combo-veu { opacity: 1; pointer-events: auto; }
}


.tema-sel {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  background: var(--bg-ghost);
  border: 1px solid var(--stroke-lighter);
  border-radius: var(--r-full);
}

.tema-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 5px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--label-sm);
  line-height: var(--lh-label-sm);
  letter-spacing: var(--ls-label-sm);
  font-weight: var(--w-medium);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}
.tema-btn svg { width: 14px; height: 14px; flex: none; }
.tema-btn:hover { color: var(--loud); }
.tema-btn:active { transition-duration: var(--dur-instant); transform: translateY(1px); }
.tema-btn.ativo {
  background: var(--bg-elevated);
  color: var(--loud);
  box-shadow: var(--shadow-sm);
}


.tema-btn:not(:has(span)) { padding: 6px; min-width: 30px; justify-content: center; }

@media (max-width: 720px) {
  .tema-btn { padding: 8px; min-width: 36px; min-height: 36px; justify-content: center; }
  .tema-btn svg { width: 16px; height: 16px; }
}


.tip { position: relative; display: inline-flex; }
.tip .tip-bolha {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  background: var(--loud); color: var(--bg);
  border-radius: var(--r-sm);
  font-size: var(--label-sm);
  font-weight: var(--w-medium);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all var(--dur-fast) var(--ease);
  box-shadow: var(--shadow-lg);
}
.tip:hover .tip-bolha { opacity: 1; transform: translateX(-50%) translateY(0); }


.vazio {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-6);
  padding: var(--sp-13) var(--sp-9);
  text-align: center;
}
.vazio-icone {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--bg-ghost);
  color: var(--ghost);
  border: 1px solid var(--stroke-lighter);
}
.vazio-icone svg { width: 22px; height: 22px; }


.paginacao { display: flex; align-items: center; gap: var(--sp-2); }
.pag-item {
  min-width: 32px; height: 32px;
  display: grid; place-items: center;
  padding: 0 var(--sp-4);
  border: 0; background: transparent;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--label-base);
  font-weight: var(--w-medium);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.pag-item:hover:not(:disabled) { background: var(--bg-ghost); color: var(--loud); }
.pag-item.ativo { background: var(--brand); color: #fff; box-shadow: var(--btn-primary-shadow); }
.pag-item:disabled { opacity: .35; cursor: not-allowed; }


.progress { height: 6px; background: var(--bg-muted); border-radius: var(--r-full); overflow: hidden; }
.progress-bar {
  height: 100%; background: var(--brand); border-radius: var(--r-full);
  transition: width var(--dur-slower) var(--ease-inout);
}


.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg,
    var(--bg-muted) 25%,
    var(--bg-ghost) 50%,
    var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: skeleton-brilho 1.6s var(--ease-inout) infinite;
}
@keyframes skeleton-brilho {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}


.linha { display: flex; align-items: center; gap: var(--sp-5); }
.linha-entre { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.coluna { display: flex; flex-direction: column; }
.grid { display: grid; gap: var(--sp-7); }
.divisor { height: 1px; background: var(--stroke-lighter); border: 0; margin: 0; }


.shell > *, .grid > *, .coluna > * { min-width: 0; }
.linha > *, .linha-entre > * { min-width: 0; }
.table-wrap, .card { max-width: 100%; }




body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (max-width: 720px) {
  
  .btn { --btn-py: 11px; --btn-px: 20px; min-height: 44px; }
  .btn-sm { --btn-py: 8px; --btn-px: 14px; min-height: 38px; }
  .btn-icon { --btn-px: 12px; min-width: 44px; }

  .nav-item { padding: 11px var(--sp-5); min-height: 44px; }
  .tab { padding: 10px 16px; min-height: 42px; }
  .pag-item { min-width: 42px; height: 42px; }
  .dropdown-item { padding: 11px var(--sp-5); min-height: 44px; }
  .check .box { width: 22px; height: 22px; }
  .switch .track { width: 44px; height: 26px; }
  .switch .thumb { width: 22px; height: 22px; }
  .switch input:checked + .track .thumb { transform: translateX(18px); }

  
  .input, .select, .textarea {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 46px;
  }
  .input-group .input { padding-left: 40px; }

  
  .card-pad, .card-body { padding: var(--sp-8); }
  .card-header, .card-footer { padding: var(--sp-7) var(--sp-8); }
  .card { border-radius: var(--r-xl); }
  .grid, .grid-2, .grid-3, .grid-4 { gap: var(--sp-7); }

  .table thead th { padding: var(--sp-6) var(--sp-7); }
  .table tbody td { padding: var(--sp-7); }
  .table-wrap { border-radius: var(--r-xl); }

  
  .linha, .linha-entre { gap: var(--sp-6); }
  .alert { padding: var(--sp-7); gap: var(--sp-6); }
  .badge { padding: 3px 11px; }
  .vazio { padding: var(--sp-12) var(--sp-8); }

  
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal {
    max-width: 100%;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom);
    transition: transform var(--dur-slow) var(--ease);
  }
  .modal-backdrop.aberto .modal { transform: translateY(0); }
  
  .modal::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    margin: 10px auto 0;
    border-radius: var(--r-full);
    background: var(--stroke-strong);
  }
  .card-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: var(--sp-5);
    padding-bottom: var(--sp-9);
  }
  .card-footer .btn { width: 100%; }

  
  .dropdown-menu { position: fixed; left: var(--sp-7); right: var(--sp-7); top: auto; min-width: 0; }

  
  .tip .tip-bolha { display: none; }

  
  .table-scroll { -webkit-overflow-scrolling: touch; }
  .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}


@media (max-width: 1020px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    width: 272px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform var(--dur-slow) var(--ease);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    padding-top: max(var(--sp-7), env(safe-area-inset-top));
  }
  .sidebar.aberto { transform: translateX(0); }
}

.veu {
  position: fixed; inset: 0; z-index: 80;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.veu.aberto { opacity: 1; pointer-events: auto; }


.so-mobile { display: none; }
@media (max-width: 1020px) { .so-mobile { display: inline-flex; } }


@media (hover: none) {
  .card-hover:hover { transform: none; box-shadow: var(--shadow-md); }
  .btn-swap:hover .swap-out { transform: translateY(0); }
  .btn-swap:hover .swap-in { transform: translateY(120%); }
}

/* MyDoc: composição do Tutor + acessibilidade. Cores e sombras vêm dos tokens. */
[hidden] { display:none !important; }
.btn[aria-busy='true'] { cursor:progress; }
.btn[aria-busy='true']::before { content:'';width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:var(--r-full);animation:ds-spin .8s linear infinite; }
@keyframes ds-spin { to { transform:rotate(360deg); } }
.tip:focus-within .tip-bolha { opacity:1;transform:translateX(-50%) translateY(0); }
.modal-backdrop:not(.aberto),.dropdown:not(.aberto) .dropdown-menu,.combo:not(.aberto) .combo-menu { visibility:hidden; }
.modal { max-height:90dvh;overflow-y:auto; }
.toast { position:fixed;bottom:24px;right:24px;z-index:120;max-width:calc(100% - 48px);box-shadow:var(--shadow-xl);background:var(--bg-elevated); }
.tutor { max-width:560px;margin:auto;padding:24px;display:flex;flex-direction:column;gap:24px;color:var(--loud); }
.tutor p { margin:0; }
.tutor .btn { white-space:normal; }
.skeleton { animation-play-state:paused; }
.tutor-brand { display:flex;align-items:center;gap:10px; }
.tutor-brand img { width:32px;height:32px;border-radius:var(--r-md); }
.tutor-brand .badge { margin-left:auto; }
.tutor-intro { text-align:center;display:flex;flex-direction:column;gap:8px; }
.tutor-intro p { max-width:38ch;margin:auto; }
.tutor-interaction { display:flex;flex-direction:column;align-items:center;gap:16px;padding:8px 0; }
.tutor-orb { width:112px;height:112px;padding:0;flex:none; }
.tutor-orb svg { width:32px;height:32px; }
.tutor-orb:focus-visible { outline:2px solid var(--brand);outline-offset:4px; }
.tutor-conversation .card-header { padding:16px 24px; }
.tutor-conversation .card-body { display:flex;flex-direction:column;gap:6px;min-height:104px; }
.tutor-disclaimer { color:var(--muted);font-size:var(--text-sm);line-height:var(--lh-sm);border-top:1px solid var(--stroke-lighter);padding-top:16px; }
.tutor-area-nav { display:flex;flex-wrap:wrap;gap:8px; }
.tutor-area-nav .btn[aria-current='page'] { background:var(--brand-ghost);color:var(--info);box-shadow:none; }
.tutor-area { display:flex;flex-direction:column;gap:16px; }
@media(max-width:720px) {
 .tutor {padding:20px;gap:24px;}
 .tutor-intro .t-h1 {font-size:24px;line-height:30px;letter-spacing:-.48px;}
 .tutor .btn,.tema-btn,.btn,.btn-sm,.nav-item,.tab,.pag-item,.dropdown-item,.combo-botao {min-height:48px;}
 .tema-btn {min-width:48px;}
 .tutor-conversation .card-header {padding:16px 20px;}
 .tutor-disclaimer {padding-bottom:env(safe-area-inset-bottom);}
 .check,.switch {min-height:48px;}
}
