/* ---------------------------------------------------------------------------
   SOUSA ARAUJO — SISTEMA WEB  |  base.css
   Design: vinho/preto/branco · Playfair Display + Inter
   --------------------------------------------------------------------------- */

:root {
  --wine:        #6B1A2A;
  --wine-dark:   #4A1020;
  --wine-light:  #8B2A3E;
  --wine-ghost:  rgba(107, 26, 42, 0.08);
  --black:       #0D0D0D;
  --gray-900:    #1A1A1A;
  --gray-800:    #2C2C2C;
  --gray-600:    #5A5A5A;
  --gray-400:    #9A9A9A;
  --gray-200:    #E8E8E8;
  --gray-100:    #F5F5F5;
  --white:       #FFFFFF;
  --green:       #1F7A52;
  --red:         #B91C1C;
  --amber:       #B45309;

  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   14px;
  --radius-xl:   20px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.10);
  --shadow:      0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.18);

  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --transition:   .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}

/* -- BUTTONS ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn--primary {
  background: var(--wine); color: var(--white);
  border-color: var(--wine);
}
.btn--primary:hover { background: var(--wine-dark); border-color: var(--wine-dark); }
.btn--outline {
  background: transparent; color: var(--wine);
  border-color: var(--wine);
}
.btn--outline:hover { background: var(--wine-ghost); }
.btn--ghost {
  background: transparent; color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn--ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn--full { width: 100%; justify-content: center; }
.btn--sm { padding: 6px 14px; font-size: 12px; }
.btn--xs { padding: 4px 10px; font-size: 11px; }

/* -- FIELDS ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label {
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--gray-600);
}
.field__input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font-body); font-size: 13px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field__input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(107,26,42,.12);
}
.field__input[readonly] { background: var(--gray-100); color: var(--gray-600); cursor: not-allowed; }
.field__input:disabled { background: var(--gray-100); color: var(--gray-600); cursor: not-allowed; }
.field__textarea { resize: vertical; min-height: 72px; }
.field__password-wrap { position: relative; }
.field__password-wrap .field__input { padding-right: 40px; }
.field__eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  display: flex; align-items: center;
}
.field__eye:hover { color: var(--wine); }

/* -- ALERTS ----------------------------------------------------------------- */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
}
.alert--error { background: #FEF2F2; color: var(--red); border: 1px solid #FCA5A5; }

/* -- FLASH ------------------------------------------------------------------ */
.flash-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow); animation: slideIn .3s ease;
}
.flash--info    { background: #EFF6FF; color: #1D4ED8; }
.flash--warning { background: #FFFBEB; color: #B45309; }
.flash--danger  { background: #FEF2F2; color: var(--red); }

/* -- BADGES ----------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge--sim               { background: #D1FAE5; color: #065F46; }
.badge--não               { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge--contato-rejeitado { background: #FEE2E2; color: var(--red); }
.badge--negociado              { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge--ligar-em-outro-momento { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge--tipo              { background: var(--wine-ghost); color: var(--wine-dark); }

/* -- TOAST ------------------------------------------------------------------ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius);
  background: var(--gray-900); color: var(--white);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: all .25s ease;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.toast--error { background: var(--red); }
.toast.toast--success { background: var(--green); }

/* -- MODAL ------------------------------------------------------------------ */
.modal,
.modal-overlay {
  position: fixed; inset: 0; z-index: 8888;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal[hidden],
.modal-overlay[hidden] { display: none; }
.modal__dialog {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: scaleIn .2s ease;
  width: 440px; max-width: min(95vw, 720px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-overlay > .modal {
  position: relative;
  inset: auto;
  z-index: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: scaleIn .2s ease;
  width: 440px;
  max-width: min(95vw, 720px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: none;
}
.modal__dialog--lg {
  width: min(720px, 95vw);
}
.modal__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal__header h3,
.modal__header h4 { font-family: var(--font-display); font-size: 18px; }
.modal__body { display: flex; flex-direction: column; gap: 12px; }
.modal__close { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--gray-400); }
.modal__close:hover { color: var(--gray-900); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-feedback {
  margin-right: auto;
  font-size: 12px;
  color: var(--gray-400);
}

/* -- APP LAYOUT ------------------------------------------------------------- */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* -- TOP HEADER ------------------------------------------------------------- */
.topheader {
  position: sticky; top: 0; z-index: 200;
  background: var(--wine-dark);
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 20px; height: 60px;
  box-shadow: 0 2px 16px rgba(0,0,0,.28);
  flex-shrink: 0;
}
.topheader__center {
  text-align: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.topheader__logo { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; }
.topheader__logo img { height: 70px; width: auto; max-width: none; display: block; flex-shrink: 0; }

/* -- HAMBURGER -------------------------------------------------------------- */
.hamburger {
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 5px;
  transition: background var(--transition);
}
.hamburger:hover { background: rgba(255,255,255,.1); }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--white); border-radius: 2px; }

/* -- DRAWER OVERLAY --------------------------------------------------------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.drawer-overlay.show { opacity: 1; pointer-events: auto; }

/* -- DRAWER PANEL ----------------------------------------------------------- */
.drawer {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 280px; z-index: 301;
  background: var(--wine-dark);
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: 4px 0 32px rgba(0,0,0,.35);
}
.drawer.open { transform: translateX(0); }
.drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.drawer__logo { height: 54px; width: auto; max-width: none; display: block; flex-shrink: 0; }
.drawer__close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.6); line-height: 1;
  padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--transition); display: flex;
}
.drawer__close:hover { color: var(--white); background: rgba(255,255,255,.1); }
.drawer__nav {
  flex: 1; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(183, 85, 104, 0.72) rgba(255, 255, 255, 0.04);
}
.drawer__nav::-webkit-scrollbar {
  width: 10px;
}
.drawer__nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.drawer__nav::-webkit-scrollbar-thumb {
  background: rgba(183, 85, 104, 0.72);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.04);
}
.drawer__nav::-webkit-scrollbar-thumb:hover {
  background: rgba(183, 85, 104, 0.9);
}
.drawer__link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius);
  color: rgba(255,255,255,.65);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.drawer__link:hover { background: rgba(255,255,255,.1); color: var(--white); }
.drawer__link--active { background: rgba(255,255,255,.15); color: var(--white); font-weight: 600; }
.drawer-subnav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-subnav__toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.65);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-subnav__toggle::-webkit-details-marker { display: none; }
.drawer-subnav__toggle:hover,
.drawer-subnav[open] .drawer-subnav__toggle {
  background: rgba(255,255,255,.1);
  color: var(--white);
}
.drawer-subnav__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.drawer-subnav__arrow {
  flex-shrink: 0;
  transition: transform .22s ease;
}
.drawer-subnav[open] .drawer-subnav__arrow {
  transform: rotate(180deg);
}
.drawer-subnav__items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 14px;
}
.drawer__sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 18px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.62);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.drawer__sublink:hover {
  background: rgba(255,255,255,.08);
  color: var(--white);
}
.drawer__sublink--active {
  background: rgba(255,255,255,.14);
  color: var(--white);
  font-weight: 600;
}
.drawer__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.drawer__theme-slot {
  padding: 0 20px 12px;
}
.drawer__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--wine-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--white); flex-shrink: 0;
}
.drawer__user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.drawer__user-name { font-size: 12px; font-weight: 600; color: var(--white); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer__user-role { font-size: 10px; color: rgba(255,255,255,.5); letter-spacing: .06em; text-transform: uppercase; }
.drawer__logout {
  color: rgba(255,255,255,.4); display: flex; flex-shrink: 0;
  padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--transition);
  background: transparent; border: 0; cursor: pointer;
}
.drawer__logout:hover { color: var(--white); background: rgba(255,255,255,.1); }

/* -- MAIN CONTENT ----------------------------------------------------------- */
.main-content { flex: 1; overflow-x: hidden; display: flex; flex-direction: column; }

/* -- TOPBAR ----------------------------------------------------------------- */
.topbar {
  padding: 16px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.topbar__welcome {
  font-size: 11px; font-weight: 500;
  color: var(--gray-400); letter-spacing: .03em;
  margin-bottom: 1px;
}
.topbar__welcome-line {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  letter-spacing: .01em;
  white-space: nowrap;
}
.topbar__welcome-line strong {
  color: var(--black);
  font-weight: 700;
}
.topbar__title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--black);
  letter-spacing: .01em;
}
.topbar__left { display: flex; flex-direction: column; gap: 0; }
.topbar__badge { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--wine); }
.topbar__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--wine); animation: pulse 2s infinite; }

/* -- TABLE ------------------------------------------------------------------ */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead tr { border-bottom: 2px solid var(--gray-200); }
.data-table th {
  padding: 10px 12px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gray-400);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr:hover { background: var(--gray-100); }
.data-table tbody tr:last-child td { border-bottom: none; }
.row--sim td { border-left: 3px solid var(--green); }
.row--rejeitado td { border-left: 3px solid var(--red); opacity: .8; }
.row--negociado td { border-left: 3px solid var(--amber); }
.row--ligar td { border-left: 3px solid #F59E0B; }
.td-empty { text-align: center; color: var(--gray-400); padding: 32px !important; font-style: italic; }
.td-valor { font-weight: 600; }
.td-nome { font-weight: 600; }
.td-icon { width: 28px; text-align: center; }
.btn-del { background: none; border: none; cursor: pointer; color: var(--gray-400); display: flex; padding: 4px; border-radius: 4px; transition: all var(--transition); }
.btn-del:hover { color: var(--red); background: #FEF2F2; }

/* -- FICHA MODAL ------------------------------------------------------------ */
.modal--ficha { width: 640px; }
.ficha-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px;
}
.ficha-grid .field--full { grid-column: 1 / -1; }
.ficha-value {
  font-size: 14px; font-weight: 500; color: var(--gray-900);
  padding: 5px 0; border-bottom: 1px solid var(--gray-100);
  min-height: 26px; word-break: break-word;
}
.ficha-permission {
  margin-right: auto;
  font-size: 12px;
  color: var(--gray-400);
}

/* -- LOGIN PAGE ------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(48px, 8vw, 120px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #781720 0%, #3A1E22 55%, #171717 100%);
  padding: 28px 24px;
}
.login-brand {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}
.login-brand__logo {
  width: min(100%, 420px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.24));
}
.login-card {
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  padding: 34px 30px;
  box-shadow: 0 24px 50px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 1;
  transform: translateY(-6px);
  justify-self: center;
}
.login-card__header { margin-bottom: 24px; text-align: center; }
.login-card__title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0;
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field__label {
  color: rgba(255,255,255,.92);
  font-size: 11px;
}
.login-field__input {
  min-height: 54px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid rgba(139, 29, 36, 0.95);
  background: rgba(255,255,255,.95);
  color: var(--gray-900);
  font-size: 15px;
}
.login-field__input::placeholder {
  color: #8D8D8D;
}
.login-field__input:focus {
  border-color: #C43838;
  box-shadow: 0 0 0 4px rgba(139, 29, 36, .18);
}
.login-field__password-wrap .field__eye {
  right: 16px;
  color: var(--wine);
}
.login-card__submit {
  min-height: 54px;
  margin-top: 4px;
  border-radius: 999px;
  background: #8B1D24;
  border-color: #8B1D24;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(139, 29, 36, .24);
}
.login-card__submit:hover {
  background: #B71C1C;
  border-color: #B71C1C;
}
.login-card__domain-note {
  margin-top: 18px;
  font-size: 11px;
  color: rgba(255,255,255,.68);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.login-page .alert--error {
  margin-bottom: 18px;
  background: rgba(254, 242, 242, .96);
}
.login-page__bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-page__bg-shape {
  position: absolute; border-radius: 50%;
  filter: blur(72px); opacity: .28;
}
.login-page__bg-shape--1 {
  width: 460px; height: 460px;
  background: #A52430; top: -140px; right: -140px;
}
.login-page__bg-shape--2 {
  width: 340px; height: 340px;
  background: #6B1A2A; bottom: -100px; left: -100px;
}

/* -- CONSTRUCTION PAGE ------------------------------------------------------ */
.construction-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-100); }
.construction-box { text-align: center; background: var(--white); border-radius: var(--radius-xl); padding: 48px; max-width: 400px; box-shadow: var(--shadow); }
.construction-box__icon { font-size: 48px; margin-bottom: 16px; }
.construction-box h1 { font-family: var(--font-display); margin-bottom: 8px; }
.construction-box p { color: var(--gray-600); margin-bottom: 24px; }

/* -- ANIMATIONS ------------------------------------------------------------- */
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* -- RESPONSIVE ------------------------------------------------------------- */
@media (max-width: 768px) {
  .topheader { padding: 0 14px; height: 54px; }
  .topbar { padding: 14px 16px; }
  .login-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px 18px;
  }
  .login-brand__logo {
    width: min(100%, 260px);
  }
  .login-card {
    padding: 28px 20px;
    border-radius: 22px;
  }
  .login-card__title {
    font-size: 28px;
  }
}

:root {
  --surface-base: var(--gray-100);
  --surface-panel: var(--white);
  --surface-panel-soft: #FBF9F8;
  --surface-panel-alt: #FCFAF9;
  --surface-overlay: rgba(255,255,255,.72);
  --border-soft: var(--gray-200);
  --border-strong: #DDD2CC;
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --theme-shadow-sm: var(--shadow-sm);
  --theme-shadow: var(--shadow);
  --theme-shadow-lg: var(--shadow-lg);
}

html[data-theme='dark'] {
  --wine: #8f3243;
  --wine-dark: #5b1d2c;
  --wine-light: #b75568;
  --wine-ghost: rgba(143, 50, 67, 0.12);
  --black: #f6f1ed;
  --gray-900: #ece6e0;
  --gray-800: #d4cbc2;
  --gray-600: #9a8f86;
  --gray-400: #7e756d;
  --gray-200: #2c2930;
  --gray-100: #17161c;
  --white: #121317;
  --green: #34c38f;
  --red: #f87171;
  --amber: #d7a24d;

  --surface-base: #101218;
  --surface-panel: #1c1f27;
  --surface-panel-soft: #232833;
  --surface-panel-alt: #151821;
  --surface-overlay: rgba(16, 18, 24, 0.78);
  --border-soft: rgba(255,255,255,.06);
  --border-strong: rgba(255,255,255,.12);
  --text-primary: #ece6e0;
  --text-secondary: #b8ada3;
  --text-muted: #9a8f86;
  --theme-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.22);
  --theme-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  --theme-shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.34);
}

body {
  color: var(--text-primary);
  background: var(--surface-base);
  transition: background .3s ease, color .3s ease;
}



html[data-theme='dark'] .login-page {
  background: linear-gradient(135deg, #551924 0%, #221a20 52%, #0e1015 100%);
}
html[data-theme='dark'] .login-brand__logo {
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.34));
}
html[data-theme='dark'] .login-card {
  background: rgba(17, 18, 24, 0.72);
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 24px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}
html[data-theme='dark'] .login-card__title { color: #fff8f4; }
html[data-theme='dark'] .login-field__label { color: rgba(255,255,255,.88); }
html[data-theme='dark'] .login-field__input {
  border-color: rgba(255,255,255,.08);
  background: rgba(21, 24, 31, 0.94);
  color: var(--text-primary);
}
html[data-theme='dark'] .login-field__input::placeholder { color: #8b8580; }
html[data-theme='dark'] .login-field__input:focus {
  border-color: rgba(183, 85, 104, 0.72);
  box-shadow: 0 0 0 4px rgba(143, 50, 67, .18);
}
html[data-theme='dark'] .login-field__password-wrap .field__eye { color: #d9b1b8; }
html[data-theme='dark'] .login-card__domain-note { color: rgba(255,255,255,.62); }
html[data-theme='dark'] .login-page .alert--error { background: rgba(88, 29, 36, .74); }
html[data-theme='dark'] .login-page__bg-shape--1 { background: #96384b; }
html[data-theme='dark'] .login-page__bg-shape--2 { background: #745128; }

html[data-theme='dark'] .btn--primary {
  background: linear-gradient(135deg, var(--wine-light), var(--wine));
  color: #fff9f6;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 10px 24px rgba(91, 29, 44, 0.26);
}
html[data-theme='dark'] .btn--primary:hover { background: linear-gradient(135deg, #ca6177, #9b3347); border-color: transparent; transform: translateY(-1px); }
html[data-theme='dark'] .btn--outline { color: var(--gray-900); border-color: rgba(183, 85, 104, 0.42); }
html[data-theme='dark'] .btn--outline:hover { background: rgba(183, 85, 104, 0.18); }
html[data-theme='dark'] .btn--ghost { background: rgba(255,255,255,.02); color: var(--gray-800); border-color: var(--border-soft); }
html[data-theme='dark'] .btn--ghost:hover { background: rgba(255,255,255,.06); color: var(--gray-900); border-color: var(--border-strong); }

html[data-theme='dark'] .field__label { color: var(--text-muted); }
html[data-theme='dark'] .field__input {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(33, 37, 46, 0.94), rgba(25, 28, 36, 0.98));
  border-color: var(--border-soft);
  caret-color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
}
html[data-theme='dark'] .field__input::placeholder { color: var(--gray-400); }
html[data-theme='dark'] .field__input:focus { border-color: rgba(183, 85, 104, 0.65); box-shadow: 0 0 0 3px rgba(143, 50, 67, 0.18); }
html[data-theme='dark'] .field__input[readonly],
html[data-theme='dark'] .field__input:disabled { background: rgba(255,255,255,.03); color: var(--text-muted); }
html[data-theme='dark'] .field__input:-webkit-autofill,
html[data-theme='dark'] .field__input:-webkit-autofill:hover,
html[data-theme='dark'] .field__input:-webkit-autofill:focus,
html[data-theme='dark'] .field__input:-webkit-autofill:active,
html[data-theme='dark'] .login-field__input:-webkit-autofill,
html[data-theme='dark'] .login-field__input:-webkit-autofill:hover,
html[data-theme='dark'] .login-field__input:-webkit-autofill:focus,
html[data-theme='dark'] .login-field__input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px #1c212b inset;
  box-shadow: 0 0 0 1000px #1c212b inset;
  transition: background-color 9999s ease-in-out 0s;
}
html[data-theme='dark'] select.field__input {
  color: var(--text-primary);
  background-color: #1c212b;
}
html[data-theme='dark'] select.field__input option,
html[data-theme='dark'] select.field__input optgroup {
  color: var(--text-primary);
  background: #1c212b;
}
html[data-theme='dark'] select.field__input:disabled option,
html[data-theme='dark'] select.field__input[readonly] option {
  color: var(--text-muted);
}
html[data-theme='dark'] .field__eye { color: var(--text-muted); }
html[data-theme='dark'] .field__eye:hover { color: var(--text-primary); }

html[data-theme='dark'] .alert--error { background: rgba(248, 113, 113, 0.12); color: #ffb3b3; border-color: rgba(248, 113, 113, 0.24); }
html[data-theme='dark'] .flash { border: 1px solid transparent; backdrop-filter: blur(10px); }
html[data-theme='dark'] .flash--info { background: rgba(104, 169, 255, 0.14); color: #cce1ff; border-color: rgba(104, 169, 255, 0.22); }
html[data-theme='dark'] .flash--warning { background: rgba(215, 162, 77, 0.16); color: #f6d9a3; border-color: rgba(215, 162, 77, 0.24); }
html[data-theme='dark'] .flash--danger { background: rgba(248, 113, 113, 0.14); color: #ffc6c6; border-color: rgba(248, 113, 113, 0.22); }

html[data-theme='dark'] .badge { border: 1px solid transparent; }
html[data-theme='dark'] .badge--sim { background: rgba(52, 195, 143, 0.14); color: #9ff0cf; border-color: rgba(52, 195, 143, 0.24); }
html[data-theme='dark'] .badge--não,
html[data-theme='dark'] .badge--nao { background: rgba(255,255,255,.04); color: var(--gray-800); border-color: var(--border-soft); }
html[data-theme='dark'] .badge--contato-rejeitado { background: rgba(248, 113, 113, 0.14); color: #ffb9b9; border-color: rgba(248, 113, 113, 0.24); }
html[data-theme='dark'] .badge--negociado,
html[data-theme='dark'] .badge--ligar-em-outro-momento { background: rgba(215, 162, 77, 0.16); color: #f7d598; border-color: rgba(215, 162, 77, 0.24); }
html[data-theme='dark'] .badge--tipo { background: rgba(143, 50, 67, 0.18); color: #f3c4cd; border-color: rgba(183, 85, 104, 0.18); }

html[data-theme='dark'] .toast { background: #1d212a; color: var(--text-primary); border: 1px solid var(--border-strong); }
html[data-theme='dark'] .toast.toast--error { background: #52232a; color: #ffd7d7; }
html[data-theme='dark'] .toast.toast--success { background: #173c33; color: #cdf6e7; }

html[data-theme='dark'] .modal,
html[data-theme='dark'] .modal-overlay { background: rgba(3, 4, 7, 0.68); backdrop-filter: blur(5px); }
html[data-theme='dark'] .modal__dialog { background: linear-gradient(180deg, rgba(28, 31, 39, 0.98), rgba(19, 21, 27, 0.98)); border: 1px solid var(--border-strong); box-shadow: var(--theme-shadow-lg); }
html[data-theme='dark'] .modal-overlay > .modal { background: linear-gradient(180deg, rgba(28, 31, 39, 0.98), rgba(19, 21, 27, 0.98)); border: 1px solid var(--border-strong); box-shadow: var(--theme-shadow-lg); }
html[data-theme='dark'] .modal__header h3,
html[data-theme='dark'] .modal__header h4 { color: var(--text-primary); }
html[data-theme='dark'] .modal__close { color: var(--text-muted); }
html[data-theme='dark'] .modal__close:hover { color: var(--text-primary); }

html[data-theme='dark'] .topheader {
  background: linear-gradient(90deg, rgba(72, 18, 30, 0.98), rgba(25, 17, 23, 0.98));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
html[data-theme='dark'] .topheader__center { color: rgba(255,241,236,.58); }
html[data-theme='dark'] .hamburger:hover { background: rgba(255,255,255,.08); }
html[data-theme='dark'] .hamburger span { background: #fff4ef; }
html[data-theme='dark'] .drawer-overlay { background: rgba(3,4,7,.6); }
html[data-theme='dark'] .drawer {
  background: linear-gradient(180deg, #101216 0%, #171019 100%);
  border-right: 1px solid rgba(255,255,255,.04);
}
html[data-theme='dark'] .drawer__nav {
  scrollbar-color: rgba(183, 85, 104, 0.72) rgba(255, 255, 255, 0.04);
}
html[data-theme='dark'] .drawer__nav::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}
html[data-theme='dark'] .drawer__nav::-webkit-scrollbar-thumb {
  background: rgba(183, 85, 104, 0.72);
  border-color: rgba(255,255,255,.04);
}
html[data-theme='dark'] .drawer__nav::-webkit-scrollbar-thumb:hover {
  background: rgba(183, 85, 104, 0.9);
}
html[data-theme='dark'] .drawer__header,
html[data-theme='dark'] .drawer__footer { border-color: rgba(255,255,255,.08); }
html[data-theme='dark'] .drawer__close,
html[data-theme='dark'] .drawer__logout { color: rgba(255,255,255,.5); }
html[data-theme='dark'] .drawer__close:hover,
html[data-theme='dark'] .drawer__logout:hover { color: var(--text-primary); background: rgba(255,255,255,.08); }
html[data-theme='dark'] .drawer__link,
html[data-theme='dark'] .drawer__sublink,
html[data-theme='dark'] .drawer-subnav__toggle { color: rgba(236, 230, 224, 0.66); }
html[data-theme='dark'] .drawer__link:hover,
html[data-theme='dark'] .drawer__sublink:hover,
html[data-theme='dark'] .drawer-subnav__toggle:hover,
html[data-theme='dark'] .drawer-subnav[open] .drawer-subnav__toggle { background: rgba(255,255,255,.08); color: var(--text-primary); }
html[data-theme='dark'] .drawer__link--active,
html[data-theme='dark'] .drawer__sublink--active { background: linear-gradient(135deg, rgba(143, 50, 67, 0.34), rgba(143, 50, 67, 0.16)); color: #fff5f2; border: 1px solid rgba(183, 85, 104, 0.18); }
html[data-theme='dark'] .drawer__avatar { background: linear-gradient(135deg, var(--wine-light), var(--wine)); color: #fff; }
html[data-theme='dark'] .drawer__user-name { color: var(--text-primary); }
html[data-theme='dark'] .drawer__user-role { color: rgba(255,255,255,.45); }

html[data-theme='dark'] .topbar {
  background: rgba(16, 18, 24, 0.78);
  border-bottom-color: var(--border-soft);
  backdrop-filter: blur(12px);
}
html[data-theme='dark'] .topbar__welcome,
html[data-theme='dark'] .topbar__badge { color: #d4a8b1; }
html[data-theme='dark'] .topbar__welcome-line { color: var(--text-secondary); }
html[data-theme='dark'] .topbar__welcome-line strong,
html[data-theme='dark'] .topbar__title { color: var(--text-primary); }
html[data-theme='dark'] .topbar__pulse { background: #d35c70; box-shadow: 0 0 0 6px rgba(211, 92, 112, 0.14); }

html[data-theme='dark'] .data-table thead tr { border-bottom: 1px solid var(--border-strong); }
html[data-theme='dark'] .data-table th { color: var(--text-muted); }
html[data-theme='dark'] .data-table td { color: var(--text-secondary); border-bottom-color: rgba(255,255,255,.05); }
html[data-theme='dark'] .data-table tbody tr:hover { background: rgba(255,255,255,.03); }
html[data-theme='dark'] .td-empty { color: var(--text-muted); }
html[data-theme='dark'] .td-valor,
html[data-theme='dark'] .td-nome { color: var(--text-primary); }
html[data-theme='dark'] .btn-del { color: var(--text-muted); }
html[data-theme='dark'] .btn-del:hover { color: #ffc3c3; background: rgba(248, 113, 113, 0.12); }
html[data-theme='dark'] .ficha-value { color: var(--text-primary); border-bottom-color: rgba(255,255,255,.06); }
html[data-theme='dark'] .ficha-permission { color: var(--text-muted); }

html[data-theme='dark'] .construction-page { background: linear-gradient(180deg, #0f1117, #141821); }
html[data-theme='dark'] .construction-box { background: linear-gradient(180deg, rgba(29,33,42,.96), rgba(19,21,27,.98)); border: 1px solid var(--border-soft); color: var(--text-primary); }
html[data-theme='dark'] .construction-box p { color: var(--text-secondary); }

.drawer__user-info { gap: 2px; }
.drawer__theme-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}
.drawer__theme-slot .drawer__theme-switch {
  animation: riseIn .35s ease both;
}
.drawer__theme-title {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
}
.drawer__theme-pill {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.drawer__theme-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.1));
  box-shadow: 0 10px 20px rgba(0,0,0,.18);
  transition: transform .28s cubic-bezier(.22,.61,.36,1), background .28s ease;
}
.drawer__theme-switch[data-theme='dark'] .drawer__theme-thumb {
  transform: translateX(100%);
  background: linear-gradient(135deg, rgba(183,85,104,.72), rgba(91,29,44,.92));
}
.drawer__theme-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,.74);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition), filter var(--transition);
}
.drawer__theme-btn:hover {
  color: #fff;
  transform: translateY(-1px);
}
.drawer__theme-btn.is-active {
  color: #fff;
}
.drawer__theme-icon {
  font-size: 14px;
  line-height: 1;
  transition: transform .28s ease, filter .28s ease;
}
.drawer__theme-btn.is-active .drawer__theme-icon {
  transform: rotate(-8deg) scale(1.08);
  filter: drop-shadow(0 0 10px rgba(255,255,255,.22));
}
html[data-theme='light'] .drawer__theme-title { color: var(--gray-600); }
html[data-theme='light'] .drawer__theme-pill {
  border-color: var(--gray-200);
  background: linear-gradient(180deg, #f7f1ee, #eee7e2);
}
html[data-theme='light'] .drawer__theme-thumb {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,255,255,.74));
  box-shadow: 0 10px 18px rgba(107, 26, 42, 0.12);
}
html[data-theme='light'] .drawer__theme-switch[data-theme='dark'] .drawer__theme-thumb {
  background: linear-gradient(135deg, var(--wine-light), var(--wine));
}
html[data-theme='light'] .drawer__theme-btn {
  color: var(--gray-600);
}
html[data-theme='light'] .drawer__theme-btn:hover,
html[data-theme='light'] .drawer__theme-btn.is-active {
  color: var(--gray-900);
}
html[data-theme='light'] .drawer__theme-slot {
  padding-bottom: 14px;
}

@media (max-width: 680px) {
  .drawer__theme-slot {
    padding: 0 16px 10px;
  }
}
.topbar,
.admin-card,
.analytics-card,
.analytics-panel,
.analytics-highlight,
.kpi-card,
.progress-block,
.form-section,
.table-section,
.bulk-card,
.progress-insight,
.master-chip,
.master-panel,
.master-card,
.master-table-card,
.week-month {
  animation: riseIn .55s cubic-bezier(.2, .8, .2, 1) both;
}

.admin-card:hover,
.analytics-card:hover,
.analytics-panel:hover,
.analytics-highlight:hover,
.kpi-card:hover,
.progress-block:hover,
.bulk-card:hover,
.master-chip:hover,
.master-card:hover,
.master-table-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-shadow);
}

.admin-card,
.analytics-card,
.analytics-panel,
.analytics-highlight,
.kpi-card,
.progress-block,
.form-section,
.table-section,
.bulk-card,
.progress-insight,
.master-chip,
.master-panel,
.master-card,
.master-table-card,
.week-month,
.data-table tbody tr,
.btn,
.drawer__link,
.drawer__sublink,
.week-pill,
.analytics-month,
.sales-funnel__item {
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition), opacity var(--transition);
}

.bulk-card__header h4 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
}

.bulk-card__header p,
.bulk-card__feedback {
  font-size: 13px;
  color: var(--text-secondary);
}

.bulk-card__textarea {
  min-height: 220px;
  resize: vertical;
}

.bulk-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

@keyframes floatGlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.analytics-ai__toggle,
.login-brand__logo {
  animation: floatGlow 5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

