/* ==========================================================================
   CONTROLE DE LINHAS | OGGI GROUP
   Visual seguindo o Gmail (Google Material 3): fundo azul-acinzentado, lista
   numa folha branca sem sombra, busca em pílula, "Nova linha" como o "Escrever".
   ========================================================================== */

:root {
  /* Superfícies e texto (Gmail claro) */
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-elevated: #ffffff;
  --text: #1f1f1f;
  --text-secondary: #444746;
  --muted: #5e5e5e;
  --faint: #747775;
  --line: #e1e3e1;
  --line-strong: #c4c7c5;
  --outline: #747775;
  --hover: #f2f6fc;
  --nav-hover: rgba(68, 71, 70, 0.08);
  --sel: #c2dbff;
  --sel-border: #a8c7fa;
  --fill: #e9eef6;

  /* Azul do Google: só no botão principal, links e foco */
  --brand: #0b57d0;
  --brand-h: #0842a0;
  --brand-soft: #d3e3fd;
  --brand-ink: #041e49;
  --on-brand: #ffffff;

  --cta-bg: #0b57d0;
  --cta-h: #0842a0;
  --cta-ink: #ffffff;

  /* "Nova linha" no estilo do "Escrever" */
  --compose-bg: #c2e7ff;
  --compose-h: #b1dcf7;
  --compose-ink: #001d35;

  /* Etiqueta de bônus (marcador verde) */
  --tag-bg: #e6f4ea;
  --tag-ink: #0d652d;

  /* Situações (cores do Google) */
  --ok: #146c2e;
  --ok-bg: #e6f4ea;
  --ok-border: #ceead6;
  --ok-dot: #1e8e3e;

  --warn: #b06000;
  --warn-bg: #fef7e0;
  --warn-border: #feefc3;
  --warn-dot: #f9ab00;

  --bad: #b3261e;
  --bad-bg: #fce8e6;
  --bad-border: #fad2cf;
  --bad-dot: #d93025;

  --neutral: #5e5e5e;
  --neutral-bg: #f1f3f4;
  --neutral-border: #dadce0;
  --neutral-dot: #80868b;

  --green: var(--ok);
  --orange: var(--warn);
  --red: var(--bad);
  --gray: var(--neutral);
  --yellow: var(--warn);

  /* Elevações do Google (só menus, painel lateral e campo de busca em foco) */
  --shadow-xs: none;
  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-md: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  --shadow-lg: 0 4px 8px 3px rgba(60, 64, 67, 0.15), 0 1px 3px rgba(60, 64, 67, 0.3);
  --shadow-drawer: 0 4px 8px 3px rgba(60, 64, 67, 0.15), 0 1px 3px rgba(60, 64, 67, 0.3);
  --shadow-pop: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  --shadow-row: none;

  --ring: 0 0 0 2px rgba(11, 87, 208, 0.5);
  --ring-bad: 0 0 0 2px rgba(179, 38, 30, 0.4);

  --radius-xs: 4px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 16px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-norm: 250ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131314;
    --panel: #1e1f20;
    --panel-elevated: #282a2c;
    --text: #e3e3e3;
    --text-secondary: #c4c7c5;
    --muted: #a8aaa8;
    --faint: #8e918f;
    --line: #333537;
    --line-strong: #444746;
    --outline: #8e918f;
    --hover: #282a2c;
    --nav-hover: rgba(227, 227, 227, 0.08);
    --sel: #1f3760;
    --sel-border: #2d4f87;
    --fill: #282a2c;

    --brand: #a8c7fa;
    --brand-h: #c2d7fb;
    --brand-soft: #004a77;
    --brand-ink: #c2e7ff;
    --on-brand: #062e6f;

    --cta-bg: #a8c7fa;
    --cta-h: #c2d7fb;
    --cta-ink: #062e6f;

    --compose-bg: #004a77;
    --compose-h: #005a8f;
    --compose-ink: #c2e7ff;

    --tag-bg: rgba(109, 213, 140, 0.16);
    --tag-ink: #6dd58c;

    --ok: #6dd58c;
    --ok-bg: rgba(109, 213, 140, 0.14);
    --ok-border: rgba(109, 213, 140, 0.3);
    --ok-dot: #6dd58c;

    --warn: #ffb951;
    --warn-bg: rgba(255, 185, 81, 0.14);
    --warn-border: rgba(255, 185, 81, 0.3);
    --warn-dot: #ffb951;

    --bad: #f2b8b5;
    --bad-bg: rgba(242, 184, 181, 0.14);
    --bad-border: rgba(242, 184, 181, 0.3);
    --bad-dot: #f28b82;

    --neutral: #a8aaa8;
    --neutral-bg: rgba(168, 170, 168, 0.12);
    --neutral-border: rgba(168, 170, 168, 0.24);
    --neutral-dot: #a8aaa8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 1px 3px 1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 8px 3px rgba(0, 0, 0, 0.5);
    --shadow-drawer: 0 4px 8px 3px rgba(0, 0, 0, 0.5);
    --shadow-pop: 0 2px 6px 2px rgba(0, 0, 0, 0.5);
    --ring: 0 0 0 2px rgba(168, 199, 250, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #131314;
  --panel: #1e1f20;
  --panel-elevated: #282a2c;
  --text: #e3e3e3;
  --text-secondary: #c4c7c5;
  --muted: #a8aaa8;
  --faint: #8e918f;
  --line: #333537;
  --line-strong: #444746;
  --outline: #8e918f;
  --hover: #282a2c;
  --nav-hover: rgba(227, 227, 227, 0.08);
  --sel: #1f3760;
  --sel-border: #2d4f87;
  --fill: #282a2c;

  --brand: #a8c7fa;
  --brand-h: #c2d7fb;
  --brand-soft: #004a77;
  --brand-ink: #c2e7ff;
  --on-brand: #062e6f;

  --cta-bg: #a8c7fa;
  --cta-h: #c2d7fb;
  --cta-ink: #062e6f;

  --compose-bg: #004a77;
  --compose-h: #005a8f;
  --compose-ink: #c2e7ff;

  --tag-bg: rgba(109, 213, 140, 0.16);
  --tag-ink: #6dd58c;

  --ok: #6dd58c;
  --ok-bg: rgba(109, 213, 140, 0.14);
  --ok-border: rgba(109, 213, 140, 0.3);
  --ok-dot: #6dd58c;

  --warn: #ffb951;
  --warn-bg: rgba(255, 185, 81, 0.14);
  --warn-border: rgba(255, 185, 81, 0.3);
  --warn-dot: #ffb951;

  --bad: #f2b8b5;
  --bad-bg: rgba(242, 184, 181, 0.14);
  --bad-border: rgba(242, 184, 181, 0.3);
  --bad-dot: #f28b82;

  --neutral: #a8aaa8;
  --neutral-bg: rgba(168, 170, 168, 0.12);
  --neutral-border: rgba(168, 170, 168, 0.24);
  --neutral-dot: #a8aaa8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 1px 3px 1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 8px 3px rgba(0, 0, 0, 0.5);
  --shadow-drawer: 0 4px 8px 3px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 2px 6px 2px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 2px rgba(168, 199, 250, 0.6);
}

/* ==========================================================================
   RESET & TIPOGRAFIA
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--dur-fast);
}

a:hover {
  text-decoration: underline;
  color: var(--brand-h);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

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

::selection {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

/* ==========================================================================
   TELA DE LOGIN (Enterprise Standard Portal)
   ========================================================================== */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
    linear-gradient(to bottom, var(--bg), var(--hover));
}

.login-wrapper {
  width: 100%;
  max-width: 410px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login .box, .login-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-xl);
  padding: 34px 32px 32px;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-brand .appicon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.login-brand .appicon svg {
  width: 22px;
  height: 22px;
}

.login h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login p {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.45;
}

.login .fld {
  margin-bottom: 16px;
}

.login .fld label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.fld-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.fld-input-wrap .fld-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.fld-input-wrap .fld-icon svg {
  width: 16px;
  height: 16px;
}

.fld-input-wrap input {
  padding-left: 38px;
  padding-right: 38px;
}

.pwd-toggle {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}

.pwd-toggle:hover {
  color: var(--text);
  background: var(--hover);
}

.pwd-toggle svg {
  width: 17px;
  height: 17px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.remember-label input[type=checkbox] {
  margin: 0;
}

.login .filled, .login-btn {
  width: 100%;
  height: 42px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}

.err-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bad-bg);
  border: 1px solid var(--bad-border);
  border-radius: var(--radius-sm);
  color: var(--bad);
  font-size: 13px;
  font-weight: 500;
  animation: shake 0.3s var(--ease);
}

.err-banner svg {
  width: 16px;
  height: 16px;
  color: var(--bad);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.login-security-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.login-security-tag svg {
  width: 15px;
  height: 15px;
  color: var(--ok);
}

/* ==========================================================================
   ESTRUTURA PRINCIPAL (Header Superior + Sidebar + Conteúdo)
   ========================================================================== */
.frame {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  grid-template-columns: 248px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg);
}

/* ---------- Topbar Superior ---------- */
.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 228px;
  flex: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  user-select: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text strong {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-text span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.appicon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25);
}

.appicon svg {
  width: 18px;
  height: 18px;
}

.search {
  flex: 1;
  max-width: 600px;
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 40px 0 36px;
  background: var(--bg);
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast);
}

.search input::placeholder {
  color: var(--muted);
  font-size: 13px;
}

.search input:focus {
  background: var(--panel);
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.search .search-kbd, .search-kbd {
  position: absolute;
  right: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  pointer-events: none;
  line-height: 1;
}

.spacer {
  flex: 1;
}

.menubtn, .navscrim {
  display: none;
}

.iconbtn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}

.iconbtn:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--line);
}

.iconbtn:active {
  transform: scale(0.96);
}

.iconbtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.acct {
  height: 38px;
  padding: 2px 8px 2px 3px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}

.acct:hover {
  background: var(--hover);
  border-color: var(--line);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex: none;
  letter-spacing: 0;
  box-shadow: var(--shadow-xs);
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 10.5px;
  border-radius: 4px;
}

/* ---------- Sidebar Navegação ---------- */
.nav {
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

/* Botão de Ação Primária: Nova Linha */
.compose {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  margin: 0 0 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}

.compose:hover {
  background: var(--cta-h);
  box-shadow: var(--shadow-sm);
}

.compose:active {
  transform: scale(0.98);
}

.compose svg {
  width: 17px;
  height: 17px;
}

.shortcut-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

.navitem {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}

.navitem svg {
  color: var(--muted);
  width: 17px;
  height: 17px;
  transition: color var(--dur-fast);
}

.navitem:hover {
  background: var(--hover);
  color: var(--text);
}

.navitem:hover svg {
  color: var(--text);
}

.navitem.on {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: var(--sel-border);
  font-weight: 600;
}

.navitem.on svg {
  color: var(--brand);
}

.navitem .n {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  background: var(--fill);
  padding: 1px 7px;
  border-radius: 10px;
}

.navitem.on .n {
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.navsep {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 18px 12px 6px;
}

/* ---------- Área de Conteúdo Principal ---------- */
.content {
  background: var(--panel);
  border-left: 1px solid transparent;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ==========================================================================
   BARRA DE FERRAMENTAS & FILTROS (.bar)
   ========================================================================== */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}

.bar .count {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bar .count b {
  color: var(--brand);
}

.bar .grow {
  flex: 1;
}

/* Filtros Suspensos Padronizados */
.chipsel {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--panel);
  color: var(--text-secondary);
  padding: 0 28px 0 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13px;
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  transition: border-color var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}

.chipsel:hover {
  border-color: var(--line-strong);
  background-color: var(--hover);
  color: var(--text);
}

.chipsel:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.chipsel.active {
  background-color: var(--brand-soft);
  border-color: var(--sel-border);
  color: var(--brand-ink);
  font-weight: 600;
}

/* Botões Padronizados Corporativos */
.textbtn {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}

.textbtn:hover {
  background: var(--hover);
  border-color: var(--line-strong);
  text-decoration: none;
}

.textbtn:active {
  transform: scale(0.98);
}

.textbtn svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.textbtn:hover svg {
  color: var(--text);
}

.textbtn.danger, .bar .textbtn.danger {
  color: var(--bad);
  border-color: var(--bad-border);
  background: var(--panel);
}

.textbtn.danger:hover, .bar .textbtn.danger:hover {
  background: var(--bad-bg);
  border-color: var(--bad);
}

.textbtn.danger svg, .bar .textbtn.danger svg {
  color: var(--bad);
}

.filled {
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}

.filled:hover {
  background: var(--cta-h);
  box-shadow: var(--shadow-sm);
}

.filled:active {
  transform: scale(0.98);
}

.filled:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.outline {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}

.outline:hover {
  background: var(--hover);
  border-color: var(--muted);
}

.outline:active {
  transform: scale(0.98);
}

/* ==========================================================================
   ABAS DE OPERADORAS (.tabs)
   ========================================================================== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 0 16px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}

.tab:hover {
  color: var(--text);
  background: var(--hover);
}

.tab.on {
  color: var(--text);
  font-weight: 600;
}

.tab.on::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--c, var(--brand));
}

.tab .n {
  font-size: 11px;
  line-height: 18px;
  min-width: 20px;
  text-align: center;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--fill);
  color: var(--muted);
  font-weight: 600;
}

.tab.on .n {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--faint));
  flex: none;
}

/* ==========================================================================
   TABELA CORPORATIVA DE LINHAS (High-density Data Grid)
   ========================================================================== */
.scroll {
  flex: 1;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-fast);
}

thead th:hover {
  color: var(--text);
}

thead th.nosort {
  cursor: default;
}

td {
  padding: 0 14px;
  height: 44px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--text);
}

tbody tr {
  cursor: pointer;
  position: relative;
  background-color: var(--panel);
  transition: background-color var(--dur-fast);
}

tbody tr:hover {
  background-color: var(--hover);
}

tbody tr.sel {
  background-color: var(--sel);
}

td.chk, th.chk {
  width: 44px;
  padding-right: 0;
  padding-left: 16px;
}

input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
  border-radius: 4px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.sub {
  color: var(--muted);
  font-size: 12.5px;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.mute {
  color: var(--faint);
  font-weight: 400;
}

.cdot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
}

.cdot .cn {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.tw {
  overflow-x: auto;
}

/* Colunas Tabela de Linhas */
table.lines {
  table-layout: fixed;
}

table.lines th, table.lines td {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: none;
}

table.lines .c-line_number { width: 140px; }
table.lines .c-carrier { width: 110px; }
table.lines .c-data_gb { width: 170px; }
table.lines .c-chip_number { width: 190px; }
/* Colunas escolhidas pelo usuário: cada uma do tamanho do conteúdo, sem cortar texto;
   só textos longos (plano, observações) são encurtados. Se não couber, a tabela rola para o lado. */
table.lines.custom { table-layout: auto; }
table.lines.custom th, table.lines.custom td { white-space: nowrap; width: auto; }
table.lines.custom td.chk, table.lines.custom th.chk { width: 44px; }
table.lines.custom .c-plan, table.lines.custom .c-notes, table.lines.custom .c-user_name { max-width: 240px; }
table.lines .c-monthly_value { width: 110px; }
table.lines .c-activated_at { width: 110px; }
table.lines .c-renewal_date { width: 140px; }
table.lines .c-status { width: 120px; }
table.lines td.c-user_name { font-weight: 500; }
table.lines td.c-line_number { font-weight: 600; color: var(--text-secondary); }

/* Bônus de GB da operadora, ao lado do pacote na coluna GB */
.bonus {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1px solid var(--sel-border);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Badges de Status Semânticos Corporativos (.pill) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.pill.Ativa {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}
.pill.Ativa::before {
  background: var(--ok-dot);
}

.pill.Suspensa {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}
.pill.Suspensa::before {
  background: var(--warn-dot);
}

.pill.Cancelada {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid var(--bad-border);
}
.pill.Cancelada::before {
  background: var(--bad-dot);
}

.pill.Estoque {
  background: var(--neutral-bg);
  color: var(--neutral);
  border: 1px solid var(--neutral-border);
}
.pill.Estoque::before {
  background: var(--neutral-dot);
}

/* Ações ao passar o mouse na linha */
.rowact {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  gap: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

tbody tr:hover .rowact {
  display: inline-flex;
  align-items: center;
}

.rowact .iconbtn {
  width: 30px;
  height: 30px;
}

.rowact svg {
  width: 15px;
  height: 15px;
}

td.acts, thead th.nosort:last-child {
  width: 0;
  padding: 0;
}

/* Empty State */
.empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
  gap: 8px;
}

.empty svg {
  width: 44px;
  height: 44px;
  color: var(--line-strong);
}

.empty b {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}

.empty span {
  font-size: 13.5px;
  max-width: 380px;
}

/* Rodapé & Paginação (.foot) */
.foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 20px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  min-height: 48px;
}

.foot select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 12.5px;
}

.foot .totals {
  margin-right: auto;
  display: flex;
  gap: 20px;
  align-items: center;
}

.foot .totals > span {
  white-space: nowrap;
}

.foot .totals b {
  font-weight: 600;
  color: var(--text);
  margin-left: 4px;
}

/* ==========================================================================
   ALERTA DE RENOVAÇÕES (.renewbar)
   ========================================================================== */
.renewbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 16px 2px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn);
}

.renewbar > svg {
  color: var(--warn);
  width: 18px;
  height: 18px;
}

.renewbar > b {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.rchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: var(--panel);
  color: var(--text);
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}

.rchip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.rchip.over::before { background: var(--bad); }
.rchip.d7::before { background: var(--warn); }
.rchip.d30::before { background: var(--muted); }

.rchip:hover {
  background: var(--hover);
  border-color: var(--muted);
}

.rchip.on {
  background: var(--text);
  color: var(--panel);
  border-color: transparent;
}

.renewbar .textbtn {
  height: 28px;
  background: transparent;
  border-color: transparent;
  color: var(--brand);
}

.ren {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
}

.ren small {
  font-size: 11px;
}

.ren.over small { color: var(--bad); font-weight: 600; }
.ren.d7 small { color: var(--warn); font-weight: 600; }
.ren.d30 small { color: var(--muted); }

/* ==========================================================================
   PÁGINAS PADRÃO (Custos, Operadoras, Listas, Usuários, Atividade)
   ========================================================================== */
.page {
  padding: 24px 28px 48px;
  overflow-y: auto;
  flex: 1;
  position: relative;
}

.page > div:has(> button.filled:only-child) {
  position: absolute;
  top: 24px;
  right: 28px;
  margin: 0 !important;
}

.page h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.page .lead {
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 680px;
  font-size: 14px;
}

/* Cartões Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.card .grow {
  flex: 1;
  min-width: 0;
}

.card b {
  font-weight: 600;
  font-size: 14.5px;
}

.card.off {
  opacity: 0.6;
}

.swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--c);
  flex: none;
}

.swatchimg {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px;
  flex: none;
}

.callout {
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  color: var(--text-secondary);
  max-width: 760px;
}

.callout h3 {
  color: var(--text);
  margin-bottom: 6px;
  font-size: 14.5px;
}

code {
  background: var(--fill);
  border: 1px solid var(--line-strong);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Custos: KPI Cards & Controles */
.seg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
}

.seg button {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--dur-fast);
}

.seg button:hover {
  border-color: var(--line-strong);
  background: var(--hover);
  color: var(--text);
}

.seg button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.seg .grow {
  flex: 1;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.kpis > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.kpis small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.kpis b {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.hbar {
  height: 8px;
  border-radius: 4px;
  background: var(--fill);
  min-width: 80px;
  overflow: hidden;
}

.hbar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand);
}

.bar-col {
  width: 30%;
}

/* ==========================================================================
   PAINEL LATERAL DESLIZANTE (.drawer / Slide-over)
   ========================================================================== */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: var(--panel);
  z-index: 41;
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer header h2 {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
}

.drawer .body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.drawer footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.sect {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.sect:first-child {
  margin-top: 0;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Campos de Formulário Padronizados */
.fld {
  display: grid;
  margin-bottom: 14px;
}

.fld > label {
  grid-row: 1;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.fld > input, .fld > select, .fld > textarea {
  grid-row: 2;
}

.fld > small { grid-row: 3; }
.fld > .inlineadd { grid-row: 4; }
.fld > .logoprev { grid-row: 3; }

.fld input, .fld select, .fld textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background-color: var(--panel);
  outline: none;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.fld textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.fld select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

.fld input:focus, .fld select:focus, .fld textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.fld small {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.fld input[type=color] {
  padding: 4px;
  height: 38px;
  cursor: pointer;
}

.err {
  color: var(--bad);
  font-size: 12.5px;
  min-height: 18px;
  margin-top: 4px;
  margin-bottom: 6px;
  font-weight: 500;
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px 16px;
  margin: 0;
  font-size: 13.5px;
}

.kv dt {
  color: var(--muted);
  font-weight: 500;
}

.kv dd {
  margin: 0;
  word-break: break-word;
  color: var(--text);
  font-weight: 500;
}

/* Switch iOS / Toggle Moderno */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex: none;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch span {
  position: absolute;
  inset: 0;
  background: var(--line-strong);
  border-radius: 12px;
  transition: background-color var(--dur-fast);
}

.switch span::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur-fast);
}

.switch input:checked + span {
  background: var(--ok);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  box-shadow: var(--ring);
}

.inlineadd {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.inlineadd input {
  height: 34px;
}

/* Seleção múltipla com chips (centros de custo e projetos) */
.fld.ms > * {
  grid-row: auto;
}

.ms-wrap {
  position: relative;
}

.ms-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background-color: var(--panel);
  cursor: text;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.ms-box:focus-within {
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.fld .ms-box input,
.fld .ms-box input:focus {
  flex: 1 1 120px;
  min-width: 120px;
  width: auto;
  height: 26px;
  padding: 0 4px;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  height: 26px;
  padding: 0 3px 0 9px;
  border: 1px solid var(--sel-border);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 600;
}

.ms-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-chip button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.ms-chip button:hover, .ms-chip button:focus-visible {
  opacity: 1;
  background: var(--sel-border);
}

.ms-chip button svg {
  width: 14px;
  height: 14px;
}

.ms-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 248px;
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

.ms-list [role=option] {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}

.ms-list [role=option]:hover, .ms-list [role=option].on {
  background: var(--hover);
}

.ms-list .ms-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ms-list .ms-new {
  color: var(--brand);
  font-weight: 600;
}

.ms-chk {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-xs);
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}

.ms-chk svg {
  width: 12px;
  height: 12px;
  fill: var(--on-brand);
  visibility: hidden;
}

[aria-selected=true] > .ms-chk {
  background: var(--brand);
  border-color: var(--brand);
}

[aria-selected=true] > .ms-chk svg {
  visibility: visible;
}

.ms-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Edição em lote: Adicionar / Substituir / Remover */
.msmode {
  display: flex;
  margin-bottom: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.msmode label {
  flex: 1;
  position: relative;
}

.msmode input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.msmode span {
  display: grid;
  place-items: center;
  height: 32px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.msmode label + label span {
  border-left: 1px solid var(--line-strong);
}

.msmode span:hover {
  background: var(--hover);
}

.msmode input:checked + span {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}

.msmode input:focus-visible + span {
  box-shadow: inset var(--ring);
}

/* Tabela: vários centros de custo/projetos = primeiro item + "+N" */
.mv {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mv > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv .more {
  flex: none;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--fill);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Importação de Planilhas */
.drop {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--bg);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast);
}

.drop:hover, .drop.over {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.report {
  margin-top: 16px;
  font-size: 13px;
}

.report ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--bad);
  max-height: 220px;
  overflow-y: auto;
}

.steps {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 18px;
  padding-left: 20px;
}

/* ==========================================================================
   MENUS SUSPENSOS (.menu) & NOTIFICAÇÕES (#toasts)
   ========================================================================== */
.menu {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 50;
  min-width: 220px;
  max-width: calc(100vw - 16px);
}

.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}

.menu button:hover {
  background: var(--hover);
}

/* Menu "Colunas": uma caixa de seleção por coluna */
.colsmenu { max-height: calc(100vh - 24px); overflow-y: auto; }
.colsmenu .head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.menu .opt {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.menu .opt:hover { background: var(--hover); }
.menu .opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.menu .opt.lock { cursor: default; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.menu button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.menu .head {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 -6px 6px;
  padding-left: 14px;
}

.menu .head b {
  font-size: 13.5px;
  display: block;
}

.menu .head small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

#toasts {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  border-left: 4px solid var(--brand);
}

@media (prefers-color-scheme: dark) {
  .toast {
    background: #1e293b;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
  }
}

.clogo {
  object-fit: contain;
  border-radius: 4px;
  flex: none;
  background: #fff;
}

.logoprev {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.logoprev img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 4px;
}

tr.off td {
  opacity: 0.5;
}

tr.off td.acts {
  opacity: 1;
}

/* ==========================================================================
   ANIMAÇÕES & MICRO-INTERAÇÕES ULTRA-RÁPIDAS
   ========================================================================== */
.dw.closing {
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  #main > * {
    animation: fadeIn var(--dur-norm) var(--ease) backwards;
  }
  .scrim {
    animation: fadeIn var(--dur-norm) ease-out backwards;
  }
  .drawer {
    animation: slideInRight var(--dur-norm) var(--ease) backwards;
  }
  .dw.closing .scrim {
    animation: fadeOut var(--dur-fast) ease-in forwards;
  }
  .dw.closing .drawer {
    animation: slideOutRight var(--dur-fast) ease-in forwards;
  }
  .menu {
    animation: menuPop var(--dur-fast) var(--ease) backwards;
    transform-origin: top left;
  }
  .menu.up {
    animation-name: menuPopUp;
    transform-origin: bottom left;
  }
  .toast {
    animation: toastSlideUp var(--dur-norm) var(--ease) backwards;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes menuPop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes menuPopUp {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVIDADE (Tablets & Mobile)
   ========================================================================== */
/* Colunas padrão somem conforme a largura; com colunas escolhidas pelo usuário (.custom) a tabela rola para o lado */
@media (max-width: 960px) { table.lines:not(.custom) .c-monthly_value { display: none; } }
@media (max-width: 820px) { table.lines:not(.custom) .c-nucleo { display: none; } }
@media (max-width: 760px) { table.lines:not(.custom) .c-activated_at { display: none; } }
@media (max-width: 700px) { table.lines:not(.custom) .c-renewal_date { display: none; } }

@media (max-width: 1180px) {
  .foot .totals > span:nth-child(2) { display: none; }
  td, thead th { padding-left: 10px; padding-right: 10px; }
}

/* Layout Tablet / Gaveta Lateral */
@media (max-width: 1024px) {
  .frame {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 58px minmax(0, 1fr);
  }
  .menubtn {
    display: inline-grid;
    flex: none;
    margin-left: -4px;
  }
  .spacer {
    display: none;
  }
  .page > div:has(> button.filled:only-child) {
    position: static;
    margin: 0 0 18px !important;
  }
  .page h1, .page .lead {
    padding-right: 0;
  }
  .logo {
    width: auto;
  }
  .logo .logo-text {
    display: none;
  }

  .nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(-1 * min(300px, 86vw) - 20px);
    width: min(300px, 86vw);
    z-index: 45;
    background: var(--panel);
    padding: 20px 14px;
    padding-top: max(20px, env(safe-area-inset-top));
    box-shadow: var(--shadow-pop);
    transition: left var(--dur-norm) var(--ease);
  }
  .navopen .nav {
    left: 0;
  }
  .navscrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-norm);
  }
  .navopen .navscrim {
    opacity: 1;
    pointer-events: auto;
  }

  .compose {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
    margin: 0;
    z-index: 30;
    box-shadow: var(--shadow-lg);
  }
  .scroll {
    padding-bottom: 80px;
  }
  .page {
    padding: 20px 16px 88px;
  }
}

/* Mobile Pequeno (<= 600px) */
@media (max-width: 600px) {
  .top {
    gap: 8px;
    padding: 0 10px;
  }
  .appicon, .logo {
    display: none;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .bar {
    gap: 8px;
    padding: 8px 12px;
  }
  .chipsel {
    flex: 1 1 0;
    min-width: 0;
  }
  .bar .grow {
    flex-basis: 100%;
    height: 0;
  }
  .renewbar {
    margin: 6px 10px 0;
    padding: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .renewbar > b, .renewbar > svg {
    display: none;
  }
  .tabs {
    padding: 0 8px;
  }
  .tab {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0 6px;
    font-size: 13px;
  }
  .drawer {
    width: 100vw;
  }
  .drawer .body, .drawer header, .drawer footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .kv {
    grid-template-columns: 110px 1fr;
  }
  #toasts {
    left: 16px;
    right: 16px;
    bottom: 84px;
    max-width: none;
  }
  table.lines .acts {
    display: none;
  }
  table.lines .c-line_number { width: 126px; }
  table.lines .c-carrier { width: 56px; }
  table.lines .c-status { width: 100px; }
  table.lines .cn { display: none; }
  .compose span, .shortcut-badge {
    display: none;
  }
  .compose {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
  }
}

/* ==========================================================================
   AJUSTES DE CAMADAS E TELAS PEQUENAS (varredura de UX)
   ========================================================================== */
/* O botão "Nova linha" fica dentro do menu lateral (z 45 em telas até 1024px);
   o painel precisa ficar acima dele, senão o botão cobre o "Salvar". */
.scrim { z-index: 46; }
.drawer { z-index: 47; }
/* Contador do item ativo do menu: branco translúcido ficava ilegível no modo escuro */
.navitem.on .n { background: var(--panel); }

@media (max-width: 1024px) {
  /* Filtros encolhem para caber na mesma linha dos botões */
  .chipsel { flex: 1 1 0; min-width: 0; max-width: 200px; }
  /* Espaço para o botão flutuante não cobrir a paginação */
  .has-fab .foot { padding-right: 176px; }
  .foot .pp { display: none; }
}

@media (max-width: 600px) {
  .acct > span, .search-kbd { display: none; }
  .acct { padding: 2px; }
  .has-fab .foot { padding-right: 76px; }
  .foot { flex-wrap: wrap; justify-content: space-between; row-gap: 2px; }
  .foot .totals { flex: 1 1 100%; min-width: 0; overflow: hidden; }
  .foot span { margin: 0 !important; }
  /* Tabela: operadora só pelo logo; colunas de ícone sem título para sobrar espaço ao nome */
  td, thead th { padding-left: 8px; padding-right: 8px; }
  td.chk, th.chk { width: 34px; padding-left: 10px; padding-right: 0; }
  table.lines .c-line_number { width: 122px; }
  table.lines .c-carrier { width: 36px; }
  table.lines th.c-carrier { font-size: 0; }
  table.lines .c-status { width: 104px; }
  /* Rodapé do painel: dois botões por linha */
  .drawer footer { flex-wrap: wrap; }
  .drawer footer > * { flex: 1 1 calc(50% - 5px); justify-content: center; margin: 0 !important; }
}

@media (max-width: 420px) {
  /* Status só pela bolinha colorida (o texto continua para leitores de tela) */
  table.lines .c-status { width: 30px; }
  table.lines th.c-status { font-size: 0; }
  table.lines .pill { font-size: 0; gap: 0; padding: 0; border: 0; background: none; }
  table.lines .pill::before { width: 10px; height: 10px; }
}

/* Usuários: acesso por centro de custo (uma linha por centro) */
.acclist { border: 1px solid var(--line); border-radius: var(--radius-md); max-height: 320px; overflow-y: auto; }
.accrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.accrow:last-child { border-bottom: 0; }
.accrow span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accrow select { flex: none; width: 140px; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); font: inherit; }

/* ==========================================================================
   ESTILO GMAIL — prevalece sobre as regras equivalentes acima
   Sem ícone de app, sem ícones nos botões e menus, sem cartões com sombra.
   ========================================================================== */
@font-face {
  font-family: "Inter";
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
h1, h2, h3, h4 { letter-spacing: 0; }
.num, td.num, .foot .totals b { font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }

/* Sem ícones nos botões de texto e menus (ficam só os botões que são só ícone) */
.textbtn svg, .outline svg, .filled svg, .navitem svg, .menu button svg, .empty svg { display: none; }

/* ---------- Estrutura: cabeçalho e menu sobre o fundo; lista numa folha branca sem sombra ---------- */
.top { background: var(--bg); border-bottom: 0; height: 64px; }
.frame { grid-template-rows: 64px minmax(0, 1fr); }
.nav { background: var(--bg); border-right: 0; padding: 8px 16px 16px 0; gap: 0; }
@media (min-width: 1025px) {
  .content { margin: 0 16px 16px 0; border-radius: var(--radius-xl); background: var(--panel); box-shadow: none; }
}

/* Marca só em texto, como o "Gmail" ao lado do menu */
.appicon { display: none; }
.logo { width: 232px; gap: 0; }
.logo-text strong { font-size: 20px; font-weight: 400; color: var(--text-secondary); letter-spacing: 0; }
.logo-text span { display: none; }

/* Busca */
.search { max-width: 720px; }
.search svg { left: 16px; width: 20px; height: 20px; color: var(--text-secondary); }
.search input { height: 48px; border: 0; border-radius: 24px; background: var(--fill); padding: 0 20px 0 52px; font-size: 16px; }
.search input::placeholder { font-size: 16px; color: var(--text-secondary); }
.search input:focus { background: var(--panel); border: 0; box-shadow: var(--shadow-sm); }

/* Conta: círculo com a inicial (cor definida no app) */
.acct { border-radius: 24px; }
.avatar { border-radius: 50%; border: 0; box-shadow: none; color: #fff; font-weight: 500; }

/* "Nova linha" = "Escrever" */
.compose { height: 56px; min-width: 140px; justify-content: flex-start; gap: 12px; padding: 0 24px 0 18px; margin: 0 0 16px 8px; border: 0; border-radius: 16px; background: var(--compose-bg); color: var(--compose-ink); font-size: 14px; font-weight: 500; box-shadow: none; align-self: flex-start; }
.compose:hover { background: var(--compose-h); box-shadow: var(--shadow-sm); }
.compose svg { width: 22px; height: 22px; }

/* Menu lateral: pílula colada à esquerda, sem ícones */
.navitem { height: 32px; padding: 0 12px 0 26px; gap: 0; border-radius: 0 16px 16px 0; color: var(--text); font-size: 14px; font-weight: 400; }
.navitem:hover { background: var(--nav-hover); color: var(--text); }
.navitem.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.navitem .n, .navitem.on .n { background: none; padding: 0; color: inherit; font-size: 12px; font-weight: inherit; }
.navsep { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--text); padding: 18px 12px 6px 26px; }

/* Barra de filtros: chips como os de busca do Gmail; ações como botões de texto */
.bar { padding: 8px 16px; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--line); background: transparent; }
.chipsel { height: 32px; border-radius: 8px; border: 1px solid var(--outline); color: var(--text-secondary); background-color: transparent; }
.chipsel.active { background-color: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.textbtn { height: 36px; padding: 0 12px; border: 0; border-radius: 18px; background: transparent; color: var(--text-secondary); font-weight: 500; }
.textbtn:hover { background: var(--nav-hover); }
.outline { height: 40px; padding: 0 24px; border: 1px solid var(--outline); border-radius: 20px; background: transparent; color: var(--brand); font-weight: 500; }
.outline:hover { background: var(--hover); }
.filled { height: 40px; padding: 0 24px; border: 0; border-radius: 20px; background: var(--cta-bg); color: var(--cta-ink); font-weight: 500; box-shadow: none; }
.filled:hover { background: var(--cta-h); box-shadow: var(--shadow-sm); }
.filled:active, .outline:active, .textbtn:active, .compose:active { transform: none; }
.iconbtn { border-radius: 50%; }

/* Abas como as categorias do Gmail */
.tabs { padding: 0; border-bottom: 1px solid var(--line); }
.tab { height: 56px; min-width: 140px; padding: 0 20px; justify-content: flex-start; font-weight: 500; color: var(--text-secondary); }
.tab:hover { background: var(--hover); }
.tab.on { color: var(--text); font-weight: 600; }
.tab.on::after { height: 3px; left: 8px; right: 8px; border-radius: 3px 3px 0 0; }
.tab .n, .tab.on .n { background: none; padding: 0; min-width: 0; margin-left: 4px; color: var(--muted); font-weight: 400; font-size: 12px; }

/* Lista */
thead th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--panel); }
td { border-bottom-color: var(--line); }
tbody tr:hover { background: var(--hover); }
tbody tr.sel, tbody tr.sel:hover { background: var(--sel); }

/* Situação: bolinha + texto */
.pill, .pill.Ativa, .pill.Suspensa, .pill.Cancelada, .pill.Estoque { background: none; border: 0; padding: 0; gap: 8px; font-weight: 400; }
.pill::before { width: 8px; height: 8px; border-radius: 50%; }
.pill.Ativa { color: var(--text-secondary); }
.pill.Suspensa { color: var(--warn); }
.pill.Cancelada { color: var(--bad); }
.pill.Estoque { color: var(--neutral); }

/* Bônus como marcador do Gmail */
.bonus { border: 0; border-radius: 4px; padding: 1px 6px; background: var(--tag-bg); color: var(--tag-ink); font-size: 12px; font-weight: 500; }

/* Formulários: campos contornados do Google */
.fld input, .fld select, .fld textarea, .ms-box { border-radius: 4px; border-color: var(--outline); }
.fld input, .fld select { height: 40px; }
.ms-box { min-height: 40px; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .ms-box:focus-within { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.sect { text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 500; color: var(--text); border-bottom: 0; padding-bottom: 0; margin: 24px 0 12px; }

/* Painel lateral e menus: superfícies planas com a elevação padrão do Google */
.drawer { border-radius: 0; }
.drawer header { border-bottom: 0; }
.drawer header h2 { font-size: 22px; font-weight: 400; letter-spacing: 0; }
.drawer footer { border-top: 0; }
.menu { border-radius: 4px; padding: 8px 0; }
.menu button, .menu .opt { border-radius: 0; padding: 0 16px; }
.menu .head { padding: 8px 16px 10px; }

/* Páginas sem cartões: números e listas direto na folha */
.kpis { gap: 0; }
.kpis > div { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 4px 32px 4px 0; margin-right: 32px; border-right: 1px solid var(--line); }
.kpis > div:last-child { border-right: 0; }
.kpis small { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.kpis b { font-size: 28px; font-weight: 400; letter-spacing: 0; }
.cards { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; padding: 12px 8px; }
.card:hover { box-shadow: none; background: var(--hover); }
.page h1 { font-size: 22px; font-weight: 400; letter-spacing: 0; }

/* Aviso rápido como o "snackbar" do Google */
.toast { border-radius: 4px; }

/* Telas menores: "Nova linha" no menu lateral, não flutuando */
.top .newtop { display: none; height: 40px; padding: 0 20px; border: 0; border-radius: 20px; background: var(--compose-bg); color: var(--compose-ink); font-weight: 500; align-items: center; cursor: pointer; flex: none; }
@media (max-width: 1024px) {
  .compose { position: static; margin: 0 0 16px 8px; box-shadow: none; }
  .compose span { display: inline; }
  .scroll { padding-bottom: 0; }
  .top .newtop { display: inline-flex; }
}
@media (max-width: 600px) { .top .newtop { padding: 0 14px; } }

/* Login no padrão do Google: título à esquerda, campos à direita, botão em pílula */
.login { background: var(--bg); padding: 24px 16px; }
.login-wrapper { max-width: 1040px; }
.login-card { display: grid; grid-template-columns: 1fr; gap: 24px; border: 0; border-radius: 28px; box-shadow: none; padding: 36px; background: var(--panel); }
@media (min-width: 840px) { .login-card { grid-template-columns: 1fr 1fr; gap: 48px; padding: 36px 36px 28px; } }
.login-head .login-org { font-size: 15px; color: var(--text-secondary); margin-bottom: 18px; }
.login-head h1 { font-size: 36px; font-weight: 400; line-height: 1.2; color: var(--text); margin: 0 0 14px; letter-spacing: 0; }
.login-head p { font-size: 16px; color: var(--text); margin: 0; }
.login .fld { margin-bottom: 20px; }
.login .fld input { height: 56px; border-radius: 4px; font-size: 16px; padding: 0 16px; }
.login .fld-input-wrap input { padding-left: 16px; }
.login .remember-label { margin: 0 0 8px; font-size: 14px; color: var(--text); }
.login #le:empty { display: none; }
.login-actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.login .login-btn { width: auto; height: 40px; padding: 0 24px; border-radius: 20px; font-size: 14px; margin: 0; }
@media (max-width: 1024px) {
  .logo { width: auto; }
  .logo .logo-text { display: flex; }
  .logo-text strong { font-size: 18px; white-space: nowrap; }
}
@media (max-width: 760px) { .logo .logo-text { display: none; } }
.switch input:checked + span { background: var(--brand); }

/* ---------- Avatar com foto e humor ---------- */
.avatar { position: relative; overflow: visible; }
.avatar.photo { background: var(--fill); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .mood { position: absolute; right: -5px; bottom: -5px; font-size: 13px; line-height: 1; font-style: normal; background: var(--panel); border-radius: 50%; padding: 1px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar.xl { width: 88px; height: 88px; font-size: 32px; }
.avatar.xl .mood { font-size: 24px; right: -2px; bottom: -2px; }
.acct-head { display: flex; align-items: center; gap: 12px; }
.acct-head small { display: block; }
.who > span { display: flex; flex-direction: column; min-width: 0; }
.who small { font-size: 12px; }

/* Meu perfil */
.pphoto { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.pphoto .textbtn { margin-left: 4px; }
.moods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.moodbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 8px; border: 1px solid var(--outline); border-radius: 8px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; cursor: pointer; transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.moodbtn span { font-size: 16px; }
.moodbtn:hover { background: var(--hover); }
.moodbtn.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); font-weight: 500; }
#pwf { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }

/* Logo do centro de custo */
.cclogo { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; flex: none; }
.ccname { display: inline-flex; align-items: center; gap: 8px; }
.mv > .cclogo + span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbox { width: 64px; height: 64px; display: inline-grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; flex: none; }
.lbox .cclogo { width: 52px; height: 52px; }

/* Login: barra de progresso ao entrar (como no Google) */
.login-card { position: relative; overflow: hidden; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; width: 40%; height: 4px; background: var(--brand); opacity: 0; }
.login-card.busy::before { opacity: 1; }
.login-card.busy form { opacity: 0.6; pointer-events: none; transition: opacity var(--dur-fast); }

/* Efeito de toque */
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: 0.16; pointer-events: none; transform: scale(0); }

@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color 0.25s ease; }
  .login-card { animation: riseIn 0.5s var(--ease) both; }
  .login-head > *, .login form > * { animation: riseIn 0.45s var(--ease) both; }
  .login-head > :nth-child(1) { animation-delay: 0.06s; }
  .login-head > :nth-child(2) { animation-delay: 0.1s; }
  .login-head > :nth-child(3) { animation-delay: 0.14s; }
  .login form > :nth-child(1) { animation-delay: 0.16s; }
  .login form > :nth-child(2) { animation-delay: 0.2s; }
  .login form > :nth-child(3) { animation-delay: 0.24s; }
  .login form > :nth-child(n+4) { animation-delay: 0.28s; }
  .login-card.busy::before { animation: loadbar 1.1s ease-in-out infinite; }
  .login.leaving .login-card { animation: leaveDown 0.22s ease-in forwards; }
  tbody.enter tr { animation: rowIn 0.3s var(--ease) both; }
  tbody.enter tr:nth-child(2) { animation-delay: 18ms; }
  tbody.enter tr:nth-child(3) { animation-delay: 36ms; }
  tbody.enter tr:nth-child(4) { animation-delay: 54ms; }
  tbody.enter tr:nth-child(5) { animation-delay: 72ms; }
  tbody.enter tr:nth-child(6) { animation-delay: 90ms; }
  tbody.enter tr:nth-child(7) { animation-delay: 108ms; }
  tbody.enter tr:nth-child(8) { animation-delay: 126ms; }
  tbody.enter tr:nth-child(9) { animation-delay: 144ms; }
  tbody.enter tr:nth-child(10) { animation-delay: 162ms; }
  tbody.enter tr:nth-child(11) { animation-delay: 180ms; }
  tbody.enter tr:nth-child(12) { animation-delay: 198ms; }
  tbody.enter tr:nth-child(13) { animation-delay: 216ms; }
  tbody.enter tr:nth-child(n+14) { animation-delay: 230ms; }
  .tab.on::after { animation: tabIn 0.25s var(--ease); }
  .avatar .mood { animation: pop 0.35s var(--ease) both; }
  .ripple { animation: ripple 0.55s ease-out forwards; }
  .moodbtn.on span { animation: pop 0.3s var(--ease); }
}
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes leaveDown { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tabIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ==========================================================================
   TELAS: conteúdo de ponta a ponta, escala por tamanho de tela e tabela que se ajusta para caber
   ========================================================================== */
/* Escala geral (--z mantém certas as alturas de tela cheia) */
@media (min-width: 1025px) and (max-width: 1365px) { html { zoom: 0.9; --z: 0.9; } }
@media (min-width: 1920px) { html { zoom: 1.1; --z: 1.1; } }
@media (min-width: 2400px) { html { zoom: 1.3; --z: 1.3; } }
@media (min-width: 3000px) { html { zoom: 1.6; --z: 1.6; } }
@media (min-width: 3600px) { html { zoom: 1.9; --z: 1.9; } }
.frame { height: calc(100dvh / var(--z, 1)); }
.login { min-height: calc(100dvh / var(--z, 1)); }
.colsmenu { max-height: calc(100dvh / var(--z, 1) - 24px); }

/* De ponta a ponta: sem margem em volta do conteúdo; menu lateral recolhível no computador (botão ☰) */
@media (min-width: 1025px) {
  .content { margin: 0; border-radius: 0; border-left: 1px solid var(--line); }
  .menubtn { display: inline-grid; flex: none; margin-left: -4px; }
  .frame.navhide { grid-template-columns: minmax(0, 1fr); }
  .frame.navhide .nav { display: none; }
  .frame.navhide .content { border-left: 0; }
  .logo { width: auto; min-width: 200px; }
}

/* Tabela: cada coluna do tamanho do conteúdo, sem quebrar linha; o número nunca é cortado */
table.lines { table-layout: auto; }
table.lines th, table.lines td { white-space: nowrap; width: auto; }
table.lines td.chk, table.lines th.chk { width: 44px; }
table.lines .c-user_name, table.lines .c-plan, table.lines .c-notes { max-width: 220px; }
table.lines .c-project, table.lines .c-cost_center, table.lines .c-nucleo { max-width: 180px; }
table.lines .c-line_number { max-width: none; overflow: visible; text-overflow: clip; }
/* Se não couber, aperta em até 3 níveis antes de rolar para o lado (fitTable no app.js) */
table.lines.d1 th, table.lines.d1 td { padding-left: 9px; padding-right: 9px; font-size: 13px; }
table.lines.d2 th, table.lines.d2 td { padding-left: 6px; padding-right: 6px; font-size: 12.5px; }
table.lines.d2 .c-user_name, table.lines.d2 .c-plan, table.lines.d2 .c-notes { max-width: 150px; }
table.lines.d2 .c-project, table.lines.d2 .c-cost_center, table.lines.d2 .c-nucleo { max-width: 130px; }
table.lines.d3 th, table.lines.d3 td { padding-left: 4px; padding-right: 4px; font-size: 12px; }
table.lines.d3 .c-user_name, table.lines.d3 .c-plan, table.lines.d3 .c-notes { max-width: 110px; }
table.lines.d3 .c-project, table.lines.d3 .c-cost_center, table.lines.d3 .c-nucleo { max-width: 100px; }
table.lines.d3 .bonus .bl { display: none; }

/* ==========================================================================
   LOGIN (Material 3 Expressive, 2026): fundo vivo, cartão de vidro, rótulo flutuante
   ========================================================================== */
.login { position: relative; overflow: hidden; isolation: isolate; background: var(--bg); }
.login-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.login-bg i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(80px); opacity: 0.6; }
.login-bg i:nth-child(1) { background: #c2e7ff; top: -22vmax; left: -12vmax; }
.login-bg i:nth-child(2) { background: #d3e3fd; bottom: -26vmax; right: -16vmax; }
.login-bg i:nth-child(3) { background: #c4eed0; top: 28%; left: 46%; width: 34vmax; height: 34vmax; opacity: 0.5; }
.login-bg i:nth-child(4) { background: #ffe7b0; bottom: -12vmax; left: 8%; width: 30vmax; height: 30vmax; opacity: 0.4; }
:root[data-theme="dark"] .login-bg i:nth-child(1) { background: #0b3a66; }
:root[data-theme="dark"] .login-bg i:nth-child(2) { background: #1f3760; }
:root[data-theme="dark"] .login-bg i:nth-child(3) { background: #0f3d26; }
:root[data-theme="dark"] .login-bg i:nth-child(4) { background: #4a3a10; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-bg i:nth-child(1) { background: #0b3a66; }
  :root:not([data-theme="light"]) .login-bg i:nth-child(2) { background: #1f3760; }
  :root:not([data-theme="light"]) .login-bg i:nth-child(3) { background: #0f3d26; }
  :root:not([data-theme="light"]) .login-bg i:nth-child(4) { background: #4a3a10; }
}

.login .login-card {
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid color-mix(in srgb, #ffffff 60%, transparent);
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12), 0 24px 60px -16px rgba(60, 64, 67, 0.28);
}
:root[data-theme="dark"] .login .login-card { border-color: rgba(255, 255, 255, 0.08); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login .login-card { border-color: rgba(255, 255, 255, 0.08); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.6); } }
.login-head .login-org { font-size: 15px; font-weight: 500; color: var(--text-secondary); margin-bottom: 20px; }
.login-head h1 { font-size: 40px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.15; }
.login-head h1 span { display: inline-block; }
.login-head p { font-size: 16px; color: var(--text-secondary); }
.login-foot { text-align: center; color: var(--text-secondary); font-size: 12px; margin: 18px 0 0; opacity: 0.8; }

/* Campo com rótulo flutuante */
.ffl { position: relative; margin-bottom: 18px; }
.ffl input { width: 100%; height: 56px; padding: 22px 16px 6px; border: 1px solid var(--outline); border-radius: 8px; background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--text); font-size: 16px; outline: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast); }
.ffl input[name=password] { padding-right: 52px; }
.ffl input:hover { border-color: var(--text-secondary); }
.ffl input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--panel); }
.ffl label { position: absolute; left: 17px; top: 28px; transform: translateY(-50%); font-size: 16px; color: var(--text-secondary); pointer-events: none; transition: top 0.18s var(--ease), font-size 0.18s var(--ease), color 0.18s; }
.ffl input:focus + label, .ffl input:not(:placeholder-shown) + label, .ffl input:-webkit-autofill + label { top: 14px; font-size: 12px; }
.ffl input:focus + label { color: var(--brand); }
.ffl .pwd-toggle { top: 12px; right: 8px; width: 32px; height: 32px; border-radius: 50%; }
.caps { margin: -10px 0 14px 4px; font-size: 12px; font-weight: 500; color: var(--warn); }
.login .login-btn { height: 48px; padding: 0 32px; border-radius: 24px; font-size: 15px; font-weight: 500; transition: background-color var(--dur-fast), box-shadow var(--dur-fast), transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.login .login-btn:hover { box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 10px rgba(11, 87, 208, 0.25); }
.login .login-btn:active { transform: scale(0.96); }
.login-actions { margin-top: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .login-bg i { animation: drift 26s ease-in-out infinite alternate; }
  .login-bg i:nth-child(2) { animation-duration: 32s; animation-delay: -9s; }
  .login-bg i:nth-child(3) { animation-duration: 22s; animation-delay: -4s; }
  .login-bg i:nth-child(4) { animation-duration: 28s; animation-delay: -14s; }
  .login-head h1 span { animation: wordIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; animation-delay: 0.12s; }
  .login-head h1 span + span { animation-delay: 0.2s; }
  .login-card.shake { animation: shakeX 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
  .login.leaving .login-card { animation: leaveScale 0.3s ease-in forwards; }
  .login.leaving .login-bg { animation: fadeOut 0.3s ease-in forwards; }
  .login-foot { animation: riseIn 0.6s var(--ease) 0.4s both; }
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 6vmax) scale(0.95); }
}
@keyframes wordIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes shakeX {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
@keyframes leaveScale { to { opacity: 0; transform: scale(0.96) translateY(6px); } }

/* Atividade: filtros, quem fez e o que mudou */
.auditbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.auditq { height: 32px; min-width: 220px; padding: 0 12px; border: 1px solid var(--outline); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; outline: none; }
.auditq:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
table.audit td { vertical-align: top; }
table.audit td:first-child { white-space: nowrap; }
.chg { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-secondary); }
.chg b { font-weight: 500; color: var(--text); margin-right: 4px; }
.chg s { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.amore { display: flex; justify-content: center; padding: 16px 0 8px; }

/* Centros de custo: logo enviada direto pela lista */
.lcell { width: 64px; }
.logobtn { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 1px dashed var(--outline); border-radius: 8px; background: transparent; color: var(--brand); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: background-color var(--dur-fast), border-color var(--dur-fast); }
.logobtn:hover { background: var(--hover); border-color: var(--brand); }
.logobtn.has { border-style: solid; border-color: var(--line); }
.logobtn .cclogo { width: 36px; height: 36px; }
