:root { color-scheme: light; font-family: Inter, "Segoe UI", Arial, sans-serif; color: #102b32; background: #f2f6f5; --ink: #102b32; --teal: #0e6f65; --teal-soft: #16b7a0; --gold: #d99a24; --paper: #f2f6f5; --line: #d5e1de; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
.login-page { background: linear-gradient(135deg, #eef6f4, #f7faf9 52%, #e6eeee); overflow-x: hidden; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); align-items: stretch; }
.login-intro { position: relative; isolation: isolate; overflow: hidden; padding: clamp(36px, 6vw, 82px); background: linear-gradient(135deg, #0a3539 0%, #0f4c4a 55%, #11313a 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.login-intro::before { content: ""; position: absolute; inset: -18% -8% auto auto; width: min(760px, 58vw); height: min(760px, 58vw); background-image: url("/public/assets/logo.svg"); background-repeat: no-repeat; background-position: center; background-size: contain; opacity: .055; transform: rotate(-12deg); animation: loginWatermarkFloat 18s ease-in-out infinite; z-index: -1; }
.login-intro::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255,255,255,.08), transparent 40%), repeating-linear-gradient(128deg, rgba(255,255,255,.055) 0 1px, transparent 1px 30px); z-index: -1; }
.login-intro > *:not(.login-visual-system) { position: relative; z-index: 2; }
.login-panel { position: relative; overflow: hidden; margin: auto; width: min(470px, calc(100% - 40px)); background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.86); border-radius: 8px; padding: clamp(24px, 4vw, 38px); box-shadow: 0 24px 70px rgba(16,43,50,.14); backdrop-filter: blur(18px); animation: loginPanelIn 700ms ease both; }
.login-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, rgba(22,183,160,.8), rgba(217,154,36,.7), transparent); }
.login-visual-system { position: absolute; top: 8%; right: 6%; width: min(360px, 32vw); height: 430px; pointer-events: none; perspective: 900px; z-index: 1; opacity: .9; }
.login-logo-card { position: absolute; top: 46px; right: 38px; display: grid; place-items: center; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.34); border-radius: 8px; background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(226,241,239,.78)); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 28px 54px rgba(0,0,0,.22); transform: rotateX(10deg) rotateY(-18deg) rotateZ(3deg); animation: loginLogoFloat 7s ease-in-out infinite; }
.login-logo-card::before { content: ""; position: absolute; inset: 16px 18px auto; height: 52px; border-radius: 8px; background: rgba(255,255,255,.64); filter: blur(9px); transform: rotate(-8deg); }
.login-logo-card img { position: relative; z-index: 1; width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(14,111,101,.18)); }
.login-glass-card { position: absolute; display: grid; gap: 5px; min-width: 170px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.32); border-radius: 8px; background: rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 18px 34px rgba(0,0,0,.16); backdrop-filter: blur(16px); animation: loginCardFloat 8s ease-in-out infinite; }
.login-glass-card span { color: #a9ebe0; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.login-glass-card strong { color: #fff; font-size: 15px; }
.login-glass-card-one { top: 12px; left: 0; }
.login-glass-card-two { top: 250px; right: 0; animation-delay: -2s; }
.login-glass-card-three { bottom: 0; left: 26px; animation-delay: -4s; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-login { margin-bottom: 28px; }
.brand-logo-wrap { flex: 0 0 auto; display: grid; place-items: center; width: 94px; height: 94px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.94); box-shadow: 0 18px 34px rgba(0,0,0,.18); transform: translateZ(0); }
.brand-logo { width: 100%; height: 100%; object-fit: contain; }
.brand-fallback { display: grid; place-items: center; width: 100%; height: 100%; background: #16b7a0; color: #fff; font-size: 28px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: 1; letter-spacing: 0; }
h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: 0; }
p { line-height: 1.5; }
.eyebrow { margin: 0 0 8px; color: #16b7a0; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.login-slogan { max-width: 760px; margin: 0; font-size: clamp(22px, 3vw, 36px); line-height: 1.22; font-weight: 750; }
.login-support { margin: 16px 0 30px; color: #c8dcda; font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 820px; }
.feature-grid article { padding: 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 26px rgba(0,0,0,.08); backdrop-filter: blur(10px); transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.feature-grid article:hover { border-color: rgba(22,183,160,.55); background: rgba(255,255,255,.12); transform: translateY(-2px); }
.feature-grid h2 { font-size: 16px; color: #fff; }
.feature-grid p { margin: 6px 0 0; color: #d7e6e4; font-size: 14px; }
.subtitle { margin: 3px 0 0; color: #586b70; }
label { display: block; margin-top: 16px; font-weight: 700; }
label span { color: #687b80; font-size: 12px; font-weight: 500; }
input, select { width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 12px; border: 1px solid #9fb4b1; border-radius: 6px; background: rgba(255,255,255,.92); color: #102b32; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
input:focus, select:focus { outline: 3px solid rgba(22,183,160,.18); border-color: #148d7d; }
button, .button-link { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 17px; border: 0; border-radius: 6px; background: #0e6f65; color: #fff; font-weight: 750; text-decoration: none; cursor: pointer; box-shadow: 0 10px 20px rgba(14,111,101,.14); transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease; }
button:hover, .button-link:hover { background: #0a5a52; transform: translateY(-1px); box-shadow: 0 14px 26px rgba(14,111,101,.18); }
button.secondary, .button-link.secondary { background: #52676b; }
button.danger { background: #9b3b2d; }
.text-button { display: block; width: 100%; margin-top: 10px; background: transparent; color: #0e6f65; }
.text-button:hover { background: #edf8f6; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions button { flex: 1; }
.error, .success { min-height: 22px; margin-top: 14px; font-weight: 650; }
.error { color: #9b2f22; }
.success { color: #0e6f65; }
.notice { padding: 12px; border-left: 4px solid #16a48f; background: #edf8f6; }
.field-help { margin: 5px 0 0; color: #687b80; font-size: 12px; }
.hidden { display: none !important; }
@keyframes loginLogoFloat { 0%, 100% { transform: translateY(0) rotateX(10deg) rotateY(-18deg) rotateZ(3deg); } 50% { transform: translateY(-12px) rotateX(7deg) rotateY(-10deg) rotateZ(1deg); } }
@keyframes loginCardFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes loginWatermarkFloat { 0%, 100% { transform: translateY(0) rotate(-12deg); } 50% { transform: translateY(16px) rotate(-9deg); } }
@keyframes loginPanelIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 1ms !important; } }
.admin-layout { width: min(1180px, calc(100% - 32px)); margin: 24px auto; }
.admin-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.admin-header h1 { font-size: 30px; }
.admin-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: #fff; border: 1px solid #cbd5da; border-radius: 8px; padding: 20px; }
.panel-wide { grid-column: 1 / -1; }
.user-list { display: grid; gap: 10px; }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid #d7e0e4; border-radius: 6px; padding: 14px; }
.user-row p { margin: 4px 0 0; color: #52636e; }
.status { display: inline-block; margin-top: 7px; padding: 4px 8px; border-radius: 4px; background: #e6f5f2; color: #0b6b5e; font-size: 12px; font-weight: 800; }
.status.inactive { background: #f9e9e6; color: #9b2f22; }
.status.pending { background: #fff4dc; color: #885b08; }
dialog { border: 1px solid #cbd5da; border-radius: 8px; padding: 0; width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(16,36,55,.45); }
.dialog-content { padding: 22px; }
.permissions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.permission-option { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.permission-option input { width: 18px; min-height: 18px; margin: 0; }
@media (max-width: 1180px) { .login-visual-system { opacity: .45; right: -70px; } }
@media (max-width: 900px) { .login-layout { grid-template-columns: 1fr; } .login-intro { min-height: auto; padding: 32px 22px; } .login-panel { margin: 24px auto; } .login-visual-system { display: none; } }
@media (max-width: 760px) { .feature-grid, .admin-grid { grid-template-columns: 1fr; } .admin-header, .user-row { grid-template-columns: 1fr; display: grid; } .permissions-grid { grid-template-columns: 1fr; } .actions button, .button-link { width: 100%; } .brand-logo-wrap { width: 74px; height: 74px; } .login-slogan { font-size: 24px; } .login-panel { width: min(470px, calc(100% - 24px)); } }

/* Administração: ramo, unidades e logo da empresa */
.company-section { margin: 22px 0 0; padding: 4px 16px 16px; border: 1px solid #d7e0e4; border-radius: 8px; }
.company-section legend { padding: 0 6px; font-weight: 800; }
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-row input[type=color] { padding: 4px; cursor: pointer; }
.unit-list { display: grid; gap: 12px; margin: 12px 0; }
.unit-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding: 4px 14px 14px; border: 1px solid #d7e0e4; border-radius: 6px; background: #f7faf9; }
.unit-card > button { grid-column: 1 / -1; margin-top: 14px; justify-self: start; }
.logo-preview { display: grid; place-items: center; min-height: 110px; margin-top: 12px; padding: 14px; border: 1px dashed #9fb4b1; border-radius: 8px; background: #151417; color: #c8dcda; }
.logo-preview img { max-width: min(420px, 100%); max-height: 90px; object-fit: contain; }
@media (max-width: 760px) { .unit-card, .color-row { grid-template-columns: 1fr; } }
/* Tela de entrada com logo da empresa (login-brand.js) */
html[data-logo-empresa] .brand-logo-wrap { width: auto; max-width: min(340px, 70vw); height: 72px; padding: 10px 16px; background: #0b0b0d; transform: none; animation: none; }
html[data-logo-empresa] .brand-logo { width: auto; max-width: 100%; }
.brand-fallback[hidden] { display: none; }
html[data-logo-empresa] .brand-login { flex-direction: column; align-items: flex-start; }
html[data-logo-empresa] .login-visual-system { display: none; }
html[data-logo-empresa] .login-logo-card::before, html[data-logo-empresa] .login-intro::before { display: none; }
html[data-logo-empresa] .login-logo-card img { filter: none; }
/* Tela de entrada no tema escuro: cores da marca da empresa (--marca-1, --marca-2) */
html[data-tema="escuro"] { color-scheme: dark; }
html[data-tema="escuro"] .login-page { background: #0b0b0d; color: #f7f5f8; }
html[data-tema="escuro"] .login-intro { background: linear-gradient(135deg, #0b0b0d 0%, color-mix(in srgb, var(--marca-1) 20%, #0f0e11) 58%, #0b0b0d 100%); }
html[data-tema="escuro"] .eyebrow { color: color-mix(in srgb, var(--marca-1) 70%, #fff); }
html[data-tema="escuro"] .login-glass-card span { color: color-mix(in srgb, var(--marca-1) 55%, #fff); }
html[data-tema="escuro"] .feature-grid article:hover { border-color: color-mix(in srgb, var(--marca-1) 60%, transparent); }
html[data-tema="escuro"] .login-panel { background: rgba(21, 20, 23, .94); border-color: #302c35; color: #f7f5f8; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
html[data-tema="escuro"] .login-panel::before { background: linear-gradient(90deg, transparent, var(--marca-1), var(--marca-2), transparent); }
html[data-tema="escuro"] .login-panel .subtitle, html[data-tema="escuro"] .login-panel label span, html[data-tema="escuro"] .field-help { color: #b2adb9; }
html[data-tema="escuro"] .login-panel input { background: #1b191f; color: #f7f5f8; border-color: #3a3540; }
html[data-tema="escuro"] .login-panel input:focus { outline-color: color-mix(in srgb, var(--marca-1) 30%, transparent); border-color: var(--marca-1); }
html[data-tema="escuro"] .login-panel button:not(.text-button) { background: linear-gradient(110deg, var(--marca-1), var(--marca-2)); color: #fff; }
html[data-tema="escuro"] .text-button { color: color-mix(in srgb, var(--marca-1) 65%, #fff); }
html[data-tema="escuro"] .text-button:hover { background: #1b191f; }
html[data-tema="escuro"] .notice { background: #1b191f; border-left-color: var(--marca-1); color: #f7f5f8; }
html[data-tema="escuro"] .success { color: color-mix(in srgb, var(--marca-2) 70%, #fff); }
html[data-tema="escuro"] .error { color: #ff8f80; }
