:root {
  --purple: #487629;
  --purple-dark: #34571e;
  --purple-soft: #eef4ea;
  --yellow: #f4df00;
  --yellow-bright: #fff200;
  --green: #23b324;
  --graphite: #24222a;
  --muted: #747874;
  --border: #e5e7e3;
  --surface: #ffffff;
  --background: #f7f7f7;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 20px 60px rgba(42, 24, 55, .1);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--graphite); background: var(--background); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--purple); text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px clamp(48px, 7vw, 112px) 76px; color: white; background: #f4f4f4; }
.auth-hero::after { content: ''; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: -230px; top: 12%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.02); }
.hero-glow { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .8; }
.hero-glow-one { width: 180px; height: 180px; background: var(--yellow); left: -90px; bottom: -60px; }
.hero-glow-two { width: 12px; height: 12px; background: var(--yellow); right: 15%; top: 18%; box-shadow: 46px 65px 0 2px rgba(255,255,255,.22); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; font-weight: 700; }
.auth-brand p { margin: 0; font-size: 18px; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 36px; color: white; font-weight: 800; font-size: 21px; letter-spacing: -2px; background: linear-gradient(145deg, #05ad25, #53ce00 58%, #f7e800); border-radius: 48% 54% 45% 58%; transform: rotate(-7deg); box-shadow: 0 6px 18px rgba(15, 89, 9, .18); }
.brand-mark-large { width: 62px; height: 54px; font-size: 31px; }
.brand-mark::first-letter { letter-spacing: -3px; }
.hero-content { position: relative; z-index: 1; max-width: 650px; }
.hero-content h1 { margin: 18px 0 22px; font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -4px; }
.hero-content h1 em { color: var(--yellow-bright); font-style: normal; }
.hero-content > p { max-width: 500px; font-size: 18px; line-height: 1.65; color: rgba(255,255,255,.8); }
.hero-feature { display: inline-flex; align-items: center; gap: 10px; margin-top: 38px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.08); backdrop-filter: blur(10px); font-size: 13px; }
.hero-feature span { display: grid; place-items: center; width: 22px; height: 22px; color: var(--purple-dark); border-radius: 50%; background: var(--yellow); font-weight: 800; }
.eyebrow { display: block; color: var(--purple); font-size: 11px; line-height: 1.4; font-weight: 800; letter-spacing: 1.8px; }
.eyebrow.light { color: var(--yellow-bright); }
.auth-panel { display: grid; place-items: center; padding: 48px; background: #fff; }
.auth-card { width: min(100%, 420px); }
.auth-card h2, .compact-card h1 { margin: 12px 0 8px; font-size: 34px; letter-spacing: -1.3px; }
.muted { margin: 0 0 30px; color: var(--muted); line-height: 1.6; }
.mobile-brand { display: none; }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
.form-stack label { margin-top: 8px; color: #41453f; font-size: 13px; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.label-row label { margin: 0; }
.label-row a { font-size: 12px; font-weight: 700; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > span { position: absolute; left: 16px; color: #939893; font-weight: 700; }
.input-wrap input { width: 100%; height: 50px; padding: 0 46px; color: var(--graphite); border: 1px solid #dfe3dc; border-radius: 10px; outline: none; transition: .2s; }
.input-wrap input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(72,118,41,.12); }
.password-toggle { position: absolute; right: 12px; width: 34px; height: 34px; color: #959a94; border: 0; background: transparent; cursor: pointer; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; border: 0; border-radius: 10px; font-weight: 750; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--purple); box-shadow: 0 10px 24px rgba(72,118,41,.2); }
.button-primary:hover { box-shadow: 0 13px 28px rgba(72,118,41,.28); }
.button-block { width: 100%; margin-top: 18px; }
.button-block span { margin-left: auto; }
.button-secondary { border: 1px solid var(--border); background: #fff; color: var(--graphite); }
.button-quiet { min-height: 40px; padding: 0 10px; color: var(--muted); background: transparent; }
.support-copy, .mock-note { margin-top: 28px; color: #98929c; font-size: 12px; text-align: center; }
.support-copy a { font-weight: 700; }
.alert { margin: 18px 0; padding: 13px 15px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.alert-error { color: var(--danger); background: #fff1ef; border: 1px solid #ffd5cf; }
.alert-success { color: var(--success); background: #eaf8f1; border: 1px solid #c1ead5; }
.demo-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 4px 8px; color: #5d5700; border: 1px solid #ddd26a; border-radius: 999px; background: #fffbea; font-size: 9px; font-weight: 800; letter-spacing: 1px; line-height: 1; }
.demo-notice { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0 8px; padding: 14px; color: #4f4c2d; border: 1px solid #e5dfad; border-radius: 10px; background: #fffdf2; }
.demo-notice-mark { flex: 0 0 auto; padding: 5px 7px; color: #5d5700; border-radius: 6px; background: #f4ed9a; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.demo-notice strong, .demo-banner strong { display: block; color: #3e3d31; font-size: 12px; }
.demo-notice p, .demo-banner p { margin: 4px 0 0; color: #76725b; font-size: 11px; line-height: 1.5; }

.compact-auth-page { background: radial-gradient(circle at 50% 0, #eef4ea, transparent 42%), #f8f7f9; }
.compact-auth { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 32px; padding: 32px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--graphite); font-weight: 750; }
.compact-card { width: min(100%, 500px); padding: 44px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.back-link { display: inline-block; margin-bottom: 34px; font-size: 13px; font-weight: 700; }
.round-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; color: var(--purple); background: var(--purple-soft); border-radius: 14px; font-size: 20px; }

.app-header { position: sticky; z-index: 10; top: 0; height: 72px; display: grid; grid-template-columns: 250px 1fr auto; align-items: center; gap: 24px; padding: 0 clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.header-brand-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-demo-badge { flex: 0 0 auto; }
.brand-copy { font-size: 15px; }
.main-nav { height: 100%; display: flex; align-items: stretch; gap: 4px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 18px; color: #6d726b; font-size: 13px; font-weight: 650; }
.nav-link.active { color: var(--purple); }
.nav-link.active::after { content: ''; position: absolute; bottom: 0; left: 18px; right: 18px; height: 3px; border-radius: 3px 3px 0 0; background: var(--purple); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar, .profile-avatar { display: grid; place-items: center; width: 38px; height: 38px; color: var(--purple); background: var(--purple-soft); border-radius: 50%; font-weight: 800; }
.user-copy { display: flex; flex-direction: column; min-width: 110px; }
.user-copy strong { overflow: hidden; max-width: 170px; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.user-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logout-button { padding: 8px; color: #77717b; border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.page-container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 64px; }
.narrow-container { width: min(980px, calc(100% - 40px)); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 7px 0 7px; font-size: 38px; line-height: 1.1; letter-spacing: -1.5px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.security-pill { padding: 9px 12px; color: var(--success); border: 1px solid #d7eee3; background: #f1faf6; border-radius: 999px; font-size: 11px; font-weight: 700; }
.demo-banner { display: flex; align-items: center; gap: 13px; margin: -10px 0 18px; padding: 13px 15px; border: 1px solid #e5dfad; border-radius: 10px; background: #fffdf2; }
.demo-banner .demo-badge { flex: 0 0 auto; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 16px; padding: 21px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-weight: 800; }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-icon.yellow { color: #766d00; background: #fffbd4; }
.stat-icon.green { color: var(--success); background: #e8f8f0; }
.stat-card div { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 1px 8px; }
.stat-card small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 23px; letter-spacing: -.7px; }
.stat-card div span { color: #a4a9a2; font-size: 10px; }
.content-card { padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 8px 26px rgba(41,26,49,.035); }
.card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.card-toolbar h2, .password-card h2 { margin: 0 0 5px; font-size: 18px; }
.card-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-form input { width: 210px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; outline: none; font-size: 12px; }
.filter-form select,
.form-stack select { min-height: 46px; padding: 0 34px 0 12px; color: var(--graphite); border: 1px solid var(--border); border-radius: 9px; background: #fff; outline: none; font-size: 12px; }
.filter-form select:focus,
.form-stack select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(72,118,41,.12); }
.filter-form input:focus { border-color: var(--purple); }
.filter-form input:disabled { background: #f4f2f5; }
.scope-note { padding: 10px 12px; color: #5e6559; background: #f5f7f3; border-radius: 8px; font-size: 11px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 12px; color: #878c85; background: #fafafa; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 750; letter-spacing: .5px; text-align: left; text-transform: uppercase; }
td { padding: 16px 12px; border-bottom: 1px solid #ededed; font-size: 12px; }
td:first-child strong, td:first-child small { display: block; }
td:first-child small { margin-top: 4px; color: #969b93; font-size: 10px; }
.doc-type { display: inline-block; margin-right: 7px; padding: 3px 5px; color: var(--purple); background: var(--purple-soft); border-radius: 4px; font-size: 9px; font-weight: 800; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-ready { color: var(--success); background: #eaf8f1; }
.status-pending { color: #8b6a00; background: #fff8d8; }
.download-button { display: flex; align-items: center; gap: 5px; padding: 7px 9px; color: var(--purple); border: 1px solid #bfd0b4; border-radius: 7px; background: white; cursor: pointer; font-size: 11px; font-weight: 750; }
.download-button:disabled { opacity: .4; cursor: not-allowed; }
.table-feedback { padding: 42px; color: var(--muted); text-align: center; font-size: 13px; }
.site-footer { display: flex; justify-content: space-between; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0; color: #9a9f98; border-top: 1px solid var(--border); font-size: 10px; }

.account-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.profile-card { padding: 30px; text-align: center; border: 1px solid var(--border); border-radius: 16px; background: white; }
.profile-avatar { width: 72px; height: 72px; margin: 0 auto 14px; font-size: 26px; }
.profile-card h2 { margin: 0 0 6px; font-size: 18px; }
.profile-card > p { overflow-wrap: anywhere; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.role-badge { display: inline-block; padding: 6px 9px; color: var(--purple); background: var(--purple-soft); border-radius: 999px; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.profile-card dl { margin: 24px 0 0; text-align: left; }
.profile-card dl div { padding: 13px 0; border-top: 1px solid var(--border); }
.profile-card dt { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.profile-card dd { margin: 4px 0 0; font-size: 12px; font-weight: 650; }
.password-card { padding: 34px; }
.password-card .form-stack { max-width: 470px; }
.field-hint { margin-top: -6px; color: var(--muted); font-size: 10px; }
.inline-logout { margin-top: 22px; text-align: center; }
.inline-logout button { padding: 8px; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.pagination button,
.pagination a { min-width: 78px; padding: 8px 11px; color: var(--purple); border: 1px solid var(--border); border-radius: 7px; background: #fff; text-align: center; cursor: pointer; font-size: 11px; font-weight: 700; }
.pagination button:disabled,
.pagination a.disabled { opacity: .45; pointer-events: none; }

.admin-layout { display: grid; grid-template-columns: minmax(290px, 350px) minmax(0, 1fr); gap: 18px; align-items: start; }
.create-user-card { position: sticky; top: 92px; }
.create-user-card h2 { margin: 8px 0 6px; font-size: 22px; }
.section-copy { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 13px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.check-row input { margin-top: 2px; accent-color: var(--purple); }
.check-row span { display: flex; flex-direction: column; gap: 3px; }
.check-row strong { font-size: 12px; }
.check-row small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.users-list-card { min-width: 0; }
.admin-filter input { width: 180px; min-height: 40px; }
.admin-filter select { min-height: 40px; }
.table-action { padding: 7px 9px; color: var(--purple); border: 1px solid #bfd0b4; border-radius: 7px; background: #fff; cursor: pointer; font-size: 10px; font-weight: 700; white-space: nowrap; }

.backup-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.backup-action-card h2,
.backup-config-card h2 { margin: 9px 0 8px; font-size: 21px; }
.backup-action-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.backup-action-card .button:disabled { opacity: .55; cursor: wait; }
.config-list { margin: 20px 0; }
.config-list div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.config-list dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.config-list dd { overflow-wrap: anywhere; margin: 0; font-size: 12px; font-weight: 650; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--graphite); font-size: 14px; }
.empty-state span { font-size: 12px; }

.error-page { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #eef4ea, transparent 40%), #faf9fb; }
.error-shell { max-width: 460px; padding: 40px; text-align: center; }
.error-code { display: block; margin-top: 24px; color: var(--purple); font-size: 68px; font-weight: 800; letter-spacing: -5px; }
.error-shell h1 { margin: 0; }
.error-shell p { margin: 14px 0 28px; color: var(--muted); line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: 360px; padding: 34px 38px; }
  .hero-content h1 { font-size: 48px; }
  .hero-feature { display: none; }
  .auth-panel { padding: 54px 24px; }
  .app-header { grid-template-columns: auto 1fr auto; padding: 0 20px; }
  .app-header .brand-copy, .user-copy { display: none; }
  .main-nav { justify-content: center; }
  .stats-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .backup-overview { grid-template-columns: 1fr; }
  .create-user-card { position: static; }
}

@media (max-width: 600px) {
  .auth-hero { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 58px; }
  .auth-panel { align-items: start; min-height: 100vh; padding-top: 34px; }
  .auth-card h2 { font-size: 30px; }
  .compact-card { padding: 30px 22px; }
  .app-header { height: auto; min-height: 68px; grid-template-columns: auto 1fr auto; gap: 8px; }
  .header-brand-group { gap: 5px; }
  .header-demo-badge { min-height: 20px; padding: 3px 5px; font-size: 8px; }
  .main-nav { order: 4; grid-column: 1 / -1; height: 44px; justify-content: stretch; }
  .nav-link { flex: 1; justify-content: center; padding: 0 8px; }
  .logout-button { padding: 8px 0; }
  .page-container { width: min(100% - 24px, 1180px); padding-top: 34px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .demo-banner { align-items: flex-start; margin-top: -8px; }
  .page-heading h1 { font-size: 31px; }
  .card-toolbar { align-items: stretch; flex-direction: column; }
  .filter-form input { width: 100%; min-height: 44px; }
  .filter-form select { width: 100%; }
  .filter-form .button { flex: 1; }
  .content-card { padding: 18px 14px; }
  .download-button span { display: none; }
  .site-footer { width: calc(100% - 24px); }
  .pagination { justify-content: space-between; }
}

/* Revisao minimalista baseada no manual de identidade da Oi. */
:root {
  --purple: #487629;
  --purple-dark: #34571e;
  --purple-soft: #eef4ea;
  --graphite: #4d4d4d;
  --muted: #777777;
  --border: #e7e7e7;
  --background: #f7f7f7;
  --shadow: none;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: -.01em;
}

.brand-image {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  overflow: hidden;
  background: transparent;
}

.brand-image img {
  position: absolute;
  width: 116.82%;
  max-width: none;
  height: auto;
  display: block;
  transform: translate(-10%, -33.9%);
}

.brand-image-small { width: 190px; height: 73px; }
.brand-image-large { width: min(340px, 100%); height: 131px; }

.app-header .brand-image-small { width: 138px; height: 53px; }
.brand,
.auth-brand,
.mobile-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.brand-copy,
.auth-brand p,
.mobile-brand strong {
  margin-top: 4px;
  color: #666;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-copy { margin-left: 38px; }
.auth-brand p { margin-left: 64px; }
.mobile-brand strong { margin-left: 33px; }
.app-header .brand-copy { margin-left: 28px; }

.auth-hero {
  color: var(--graphite);
  background: #f4f4f4;
  border-right: 1px solid var(--border);
}

.auth-hero::after,
.hero-glow { display: none; }

.auth-brand p { color: #666; }
.hero-content h1 { letter-spacing: -3px; }
.hero-content h1 em { color: var(--purple); }
.hero-content > p { color: var(--muted); }
.eyebrow.light { color: var(--purple); }

.hero-feature {
  color: #5f5f5f;
  border-color: #dedede;
  background: #fff;
  backdrop-filter: none;
}

.hero-feature span {
  color: #fff;
  background: var(--purple);
}

.button-primary {
  background: var(--purple);
  box-shadow: none;
}

.button-primary:hover {
  background: var(--purple-dark);
  box-shadow: none;
}

.compact-auth-page,
.error-page { background: var(--background); }

.compact-card,
.content-card,
.profile-card,
.stat-card {
  box-shadow: none;
}

.compact-card { border-radius: 14px; }
.app-header { background: rgba(255,255,255,.98); }
.page-heading h1 { color: #333; }
.security-pill { color: #5f5f5f; border-color: var(--border); background: #fff; }
.security-pill::first-letter { color: var(--purple); }

.stat-icon.neutral {
  color: var(--purple);
  background: var(--purple-soft);
}

.content-card,
.profile-card,
.stat-card { border-radius: 12px; }

.scope-note { background: #f5f5f5; }
.round-icon { color: var(--purple); background: var(--purple-soft); }
.role-badge { color: var(--purple); background: var(--purple-soft); }
.status-ready { color: #356b4b; background: #edf5f0; }
.status-pending { color: #756524; background: #f7f4e8; }
.download-button { color: var(--purple); border-color: #bfd0b4; }

.input-wrap input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(72, 118, 41, .12);
}

@media (max-width: 600px) {
  .brand-image-small { width: 166px; height: 64px; }
  .brand-copy,
  .mobile-brand strong { margin-left: 33px; }
}
