:root {
    --red: #b80006;
    --red-dark: #850005;
    --red-soft: #fff0f0;
    --ink: #252425;
    --muted: #756f6b;
    --line: #e5dfda;
    --paper: #f6f3ef;
    --white: #fff;
    --green: #15865b;
    --green-soft: #eaf8f1;
    --amber: #ad6b08;
    --amber-soft: #fff6df;
    --blue: #2868a8;
    --blue-soft: #edf5ff;
    --shadow: 0 20px 55px rgba(66, 39, 25, .10);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.is-hidden { display: none !important; }

.ambient { position: fixed; z-index: -3; width: 680px; height: 680px; border-radius: 50%; filter: blur(1px); opacity: .65; pointer-events: none; }
.ambient-one { right: -280px; top: -270px; background: radial-gradient(circle, rgba(184, 0, 6, .16), transparent 67%); }
.ambient-two { left: -340px; bottom: -400px; background: radial-gradient(circle, rgba(222, 162, 110, .2), transparent 66%); }
.noise { position: fixed; inset: 0; z-index: -2; opacity: .18; pointer-events: none; background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(59, 45, 37, .018) 4px); }
.glass { background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); }
.app-shell { width: 100%; min-height: 100vh; }
.view { min-height: 100vh; }

.brand { display: inline-flex; align-items: center; gap: 18px; color: inherit; text-decoration: none; }
.brand img { width: 218px; max-height: 62px; object-fit: contain; object-position: left center; }
.brand-divider { width: 1px; height: 38px; background: #d9d2cc; }
.portal-label { display: inline-flex; align-items: center; align-self: center; font-size: 13px; font-weight: 800; letter-spacing: .12em; line-height: 1.2; text-transform: uppercase; color: #5d5652; max-width: 128px; transform: translateY(-2px); }
.brand.compact img { width: 164px; }
.brand.compact .brand-divider { height: 30px; }
.brand.compact .portal-label { font-size: 11px; }
.brand-partnership { flex: 0 0 auto; gap: 14px; }
.partner-logo-lockup { display: inline-flex; align-items: center; gap: 10px; }
.partner-logo-lockup .blim-partner-logo { width: 135px; max-height: 38px; filter: invert(1); }
.partner-logo-lockup .ce-partner-logo { width: 165px; max-height: 48px; }
.brand.compact .blim-partner-logo { width: 88px; max-height: 27px; }
.brand.compact .ce-partner-logo { width: 108px; max-height: 34px; }
.brand-cross { display: inline-grid; height: 20px; place-items: center; align-self: center; color: #a49b95; font-size: 16px; font-weight: 600; line-height: 1; transform: translateY(-2px); }

.login-view { max-width: 1440px; margin: 0 auto; padding: 42px 6vw 26px; display: flex; flex-direction: column; }
.login-brand { min-height: 62px; }
.login-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(390px, 490px); align-items: center; gap: clamp(60px, 10vw, 170px); padding: 46px 2vw; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .14em; color: var(--red); font-size: 11px; font-weight: 900; }
.eyebrow i { width: 22px; height: 2px; border-radius: 99px; background: var(--red); }
.login-copy h1, .welcome h1 { margin: 18px 0 22px; font-size: clamp(50px, 5vw, 79px); line-height: .98; letter-spacing: -.06em; font-weight: 900; }
.login-copy h1 em, .welcome h1 em { color: var(--red); font-style: normal; }
.login-copy > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.trust-row { display: flex; gap: 34px; margin-top: 42px; }
.trust-item { display: flex; align-items: center; gap: 12px; }
.mini-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--white); color: var(--red); border: 1px solid var(--line); box-shadow: 0 7px 16px rgba(68,46,34,.07); font-weight: 900; }
.trust-item strong, .trust-item small { display: block; }
.trust-item strong { font-size: 13px; }
.trust-item small { color: var(--muted); font-size: 11px; margin-top: 3px; }

.login-card { position: relative; border-radius: 28px; padding: 38px 40px 32px; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--red), #ed3c40); }
.card-kicker { color: var(--red); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 900; }
.login-card h2 { margin: 7px 0 7px; font-size: 29px; letter-spacing: -.035em; }
.login-card > p { color: var(--muted); margin: 0 0 27px; font-size: 14px; }
form label { display: block; color: #4f4946; font-size: 12px; font-weight: 800; margin: 16px 0 8px; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; height: 54px; padding: 0 48px 0 45px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.86); color: var(--ink); outline: none; transition: .2s; }
.input-wrap input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .filters input:focus, .filters select:focus { border-color: rgba(184,0,6,.55); box-shadow: 0 0 0 4px rgba(184,0,6,.08); }
.input-wrap input:read-only { background: #f4f1ee; color: #756f6b; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #aaa09a; font-weight: 800; }
.valid-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%) scale(.6); opacity: 0; color: var(--green); transition: .2s; }
.input-wrap.is-valid .valid-icon { opacity: 1; transform: translateY(-50%) scale(1); }
.input-wrap.has-error input { border-color: #d6333a; box-shadow: 0 0 0 4px rgba(214,51,58,.08); }
.field-error { min-height: 17px; color: #c4262e; font-size: 11px; line-height: 1.45; margin: 6px 0 0; }
.field-error:empty { display: none; }
#cnpjField:not(.is-hidden) { margin-bottom: 20px; }
.auth-input:has(#password) { margin-bottom: 20px; }
.auth-error { margin-top: 13px; }
.startup-error { padding: 10px 12px; background: var(--red-soft); border-radius: 9px; }
.account-fields { margin-top: 12px; animation: slideIn .25s ease; }
.company-greeting { padding: 12px 14px; margin: 12px 0 4px; border-radius: 11px; background: #f4f1ed; font-size: 12px; color: var(--muted); }
.company-greeting strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; }
.company-greeting span { display: inline-flex; margin-top: 5px; padding: 3px 7px; border-radius: 99px; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.password-toggle { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 35px; height: 35px; border: 0; background: transparent; }
.password-toggle span { display: block; width: 18px; height: 12px; margin: auto; border: 1.8px solid #8d8580; border-radius: 50%; position: relative; }
.password-toggle span::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #8d8580; top: 2px; left: 5px; }
.password-toggle.is-visible span::before { content: ""; position: absolute; width: 23px; height: 2px; background: #8d8580; transform: rotate(-43deg); top: 4px; left: -3px; }
.password-hint { color: var(--muted); font-size: 10px; margin: 6px 0 0; }
.link-button { display: block; width: 100%; border: 0; padding: 9px 0 0; background: transparent; color: var(--red); font-size: 11px; font-weight: 800; text-align: center; }
.primary-btn, .confirm-btn, .primary-action { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 54px; margin-top: 8px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--red), #d71920); box-shadow: 0 11px 23px rgba(184,0,6,.22); font-weight: 800; transition: .2s; }
.primary-btn:hover, .confirm-btn:hover, .primary-action:hover { transform: translateY(-1px); box-shadow: 0 15px 27px rgba(184,0,6,.27); }
.primary-btn:disabled, .confirm-btn:disabled { opacity: .6; cursor: wait; }
.btn-arrow { margin-left: auto; margin-right: 3px; font-size: 18px; }
.spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .spinner { display: inline-block; }
.is-loading .btn-arrow, .is-loading > span:not(.btn-label):not(.spinner) { display: none; }
.access-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 21px; color: #847c77; font-size: 10px; font-weight: 700; }
.access-note i, .status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(21,134,91,.1); }
.login-footer { display: flex; justify-content: space-between; align-items: center; color: #918984; font-size: 10px; letter-spacing: .04em; }
.status { display: flex; align-items: center; gap: 8px; }

.topbar { min-height: 78px; padding: 12px clamp(22px, 4vw, 64px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-actions { display: grid; grid-template-columns: auto minmax(0, max-content) auto; flex: 1 1 auto; align-items: center; justify-content: end; gap: 10px 18px; min-width: 0; }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 0 6px 0 10px; width: auto; min-width: 0; max-width: min(420px, 34vw); }
.user-chip > span { flex: 0 0 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--red-soft); color: var(--red); font-weight: 900; }
.user-chip div { width: auto; min-width: 0; max-width: 100%; }
.user-chip strong, .user-chip small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip strong { max-width: 190px; font-size: 11px; }
.user-chip small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.logout-btn { position: relative; z-index: 1; flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: #625b57; border-radius: 10px; padding: 9px 13px; font-size: 11px; font-weight: 800; }
.logout-btn:hover { border-color: #d2c7c0; background: #f8f5f2; }
.dashboard-content { max-width: 1580px; margin: auto; padding: 30px clamp(20px, 4vw, 64px) 70px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 33px; }
.welcome h1 { font-size: clamp(35px, 3vw, 51px); margin: 12px 0 8px; line-height: 1.08; }
.welcome p { margin: 0; color: var(--muted); font-size: 14px; }
.hero-actions { flex: 0 0 auto; }
.primary-action { width: auto; min-height: 48px; margin: 0; padding: 0 20px; border-radius: 12px; font-size: 12px; }
.primary-action span { font-size: 20px; font-weight: 400; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 25px; align-items: start; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card { min-width: 0; padding: 19px; display: flex; align-items: center; gap: 13px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 7px 18px rgba(70,46,34,.045); }
.stat-icon { flex: 0 0 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-card small, .stat-card strong { display: block; }
.stat-card small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.stat-card strong { margin-top: 2px; font-size: 22px; letter-spacing: -.03em; }
.appointments-card { border-radius: var(--radius); padding: 25px; box-shadow: 0 15px 40px rgba(64,43,31,.07); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.035em; }
.section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dashboard-new-action { min-height: 39px; padding-inline: 14px; white-space: nowrap; }
.dashboard-new-action span { font-size: 17px; }
.filters { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; margin: 0; }
.search-field span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #918985; }
.filters input, .filters select { height: 39px; border: 1px solid var(--line); background: #fff; border-radius: 9px; outline: none; color: #5d5652; font-size: 10px; }
.filters input { width: 220px; padding: 0 11px 0 34px; }
.filters select { padding: 0 29px 0 10px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
.appointments-table { min-width: 900px; }
th { padding: 11px 13px; text-align: left; color: #8d8580; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line); }
td { padding: 15px 13px; font-size: 11px; border-bottom: 1px solid #eee9e5; vertical-align: middle; }
tbody tr { animation: none; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbf9f7; }
.protocol { color: var(--red); font-weight: 900; letter-spacing: .02em; }
.cell-main { display: block; font-weight: 750; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-scheduled { background: var(--amber-soft); color: var(--amber); }
.status-awaiting-integration { background: #f2edf7; color: #7651a1; }
.status-cancelled-integration { background: #f4e7e7; color: #9d4a4d; }
.status-received { background: var(--blue-soft); color: var(--blue); }
.status-completed { background: var(--green-soft); color: var(--green); }
.status-cancelled { background: #f0edeb; color: #77706c; }
.empty-state { display: none; padding: 55px 20px 40px; flex-direction: column; align-items: center; text-align: center; color: var(--muted); }
.empty-state.show { display: flex; }
.empty-state > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--red-soft); color: var(--red); font-size: 21px; }
.empty-state strong { margin-top: 15px; color: var(--ink); }
.empty-state p { margin: 5px 0 15px; font-size: 11px; }
.empty-state button { border: 0; background: transparent; color: var(--red); font-size: 11px; font-weight: 850; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 13px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.table-pagination.is-hidden { display: none; }
.table-pagination > div { display: flex; align-items: center; gap: 9px; }
.table-pagination strong { min-width: 100px; color: var(--ink); font-size: 11px; text-align: center; }
.table-pagination button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 21px; line-height: 1; }
.table-pagination button:hover:not(:disabled) { border-color: #e7b9bb; background: var(--red-soft); color: var(--red); }
.table-pagination button:disabled { cursor: not-allowed; opacity: .4; }
.side-column { display: grid; gap: 18px; }
.whatsapp-card { position: relative; overflow: hidden; padding: 25px; border-radius: var(--radius); background: linear-gradient(150deg, #117c58, #0b5c43); color: #fff; box-shadow: 0 16px 30px rgba(11,92,67,.18); }
.whatsapp-card::after { content: ""; position: absolute; width: 160px; height: 160px; border: 30px solid rgba(255,255,255,.055); border-radius: 50%; right: -90px; top: -70px; }
.whatsapp-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.15); font-size: 20px; }
.whatsapp-card small { display: block; margin-top: 20px; color: rgba(255,255,255,.65); font-size: 9px; text-transform: uppercase; letter-spacing: .13em; }
.whatsapp-card h2 { margin: 4px 0 8px; font-size: 19px; }
.whatsapp-card p { margin: 0; color: rgba(255,255,255,.75); font-size: 11px; line-height: 1.6; }
.whatsapp-link { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 11px 13px; border-radius: 10px; color: #0d674a; background: #fff; text-decoration: none; font-size: 10px; font-weight: 900; }
.compact-whatsapp { margin: 0; gap: 7px; padding: 9px 11px; border: 1px solid #cde5da; background: #effaf5; }
.rules-card { padding: 23px; border-radius: var(--radius); box-shadow: 0 12px 30px rgba(64,43,31,.06); }
.rules-title { display: flex; align-items: center; gap: 11px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.rules-title > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-soft); font-weight: 900; }
.rules-title strong, .rules-title small { display: block; }
.rules-title strong { font-size: 13px; }
.rules-title small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.rules-card ul { list-style: none; margin: 4px 0 0; padding: 0; }
.rules-card li { display: flex; gap: 10px; padding: 13px 0 0; }
.rules-card li > span { flex: 0 0 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 900; }
.rules-card li.blocked > span { background: var(--amber-soft); color: var(--amber); }
.rules-card li strong, .rules-card li small { display: block; }
.rules-card li strong { font-size: 10px; }
.rules-card li small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.calendar-card { padding: 23px; border-radius: var(--radius); box-shadow: 0 12px 30px rgba(64,43,31,.06); }
.calendar-title { display: flex; align-items: center; gap: 11px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.calendar-title > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-soft); font-weight: 900; }
.calendar-title strong, .calendar-title small { display: block; }
.calendar-title strong { font-size: 15px; }
.calendar-title small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.calendar-navigation { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 7px; margin: 16px 0 12px; text-align: center; }
.calendar-navigation button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 23px; line-height: 1; }
.calendar-navigation button:hover { border-color: #e7b9bb; background: var(--red-soft); color: var(--red); }
.calendar-navigation strong { font-size: 13px; text-transform: capitalize; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 850; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; display: grid; min-height: 32px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 750; }
.calendar-day.is-outside { color: #c6bfba; }
.calendar-day.is-today { outline: 1px solid rgba(184,0,6,.38); color: var(--red); }
.calendar-day.has-appointments { background: var(--amber-soft); color: var(--amber); font-weight: 900; }
.calendar-day.is-holiday { background: var(--green-soft); color: var(--green); font-weight: 900; }
.calendar-day.is-holiday.has-appointments { background: var(--green-soft); color: var(--green); }
.calendar-day.has-appointments::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.calendar-legend { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 650; }
.calendar-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

.drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; pointer-events: none; }
.drawer.is-open { visibility: visible; pointer-events: auto; }
.drawer-backdrop, .modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(34,28,25,.5); opacity: 0; transition: opacity .16s; }
.drawer.is-open .drawer-backdrop, .modal.is-open .modal-backdrop { opacity: 1; }
.drawer-panel { position: absolute; right: 0; top: 0; height: 100%; width: min(680px, 100%); background: #fbf9f7; box-shadow: -25px 0 70px rgba(43,28,20,.2); transform: translateX(102%); transition: transform .3s cubic-bezier(.22,.7,.23,1); overflow-y: auto; }
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-close { flex: 0 0 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #6b6460; font-size: 24px; line-height: 1; }
#appointmentForm { padding: 25px 34px 110px; }
.appointment-steps { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; margin: 2px 0 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.appointment-steps::before { content: ""; position: absolute; top: 29px; left: calc(16.666% + 15px); right: calc(16.666% + 15px); height: 2px; border-radius: 99px; background: #e7e1dc; }
.appointment-step-indicator { position: relative; z-index: 1; display: flex; min-width: 0; align-items: center; flex-direction: column; gap: 7px; color: #9a918b; text-align: center; }
.appointment-step-indicator > span { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #ddd5cf; border-radius: 9px; background: #f8f5f2; box-shadow: 0 0 0 6px #fff; font-size: 11px; font-weight: 900; }
.appointment-step-indicator strong, .appointment-step-indicator small { display: block; white-space: nowrap; }
.appointment-step-indicator strong { font-size: 12px; }
.appointment-step-indicator small { margin-top: 1px; font-size: 9px; }
.appointment-step-indicator.is-active { color: var(--red); }
.appointment-step-indicator.is-active > span { border-color: var(--red); background: var(--red); color: #fff; }
.appointment-step-indicator.is-complete { color: var(--green); }
.appointment-step-indicator.is-complete > span { border-color: #bfe3d2; background: var(--green-soft); color: var(--green); }
.appointment-wizard-step { display: none; }
.appointment-wizard-step.is-active { display: block; }
.form-section { padding: 23px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.form-section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.form-section-title > span { flex: 0 0 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--red); font-size: 11px; font-weight: 900; }
.form-section-title strong, .form-section-title small { display: block; }
.form-section-title strong { font-size: 13px; }
.form-section-title small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid label { margin: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: 0; transition: .2s; }
.form-grid input, .form-grid select { height: 44px; padding: 0 12px; }
.form-grid textarea { padding: 11px 12px; resize: vertical; }
.optional { color: #a39a94; font-size: 8px; font-weight: 600; }
.availability-info { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 13px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.availability-info.is-error { background: var(--red-soft); color: var(--red); }
.availability-info.is-success { background: var(--green-soft); color: var(--green); }
.availability-info span { font-weight: 900; }
.availability-info p { margin: 0; font-size: 9px; font-weight: 750; }
.document-query-grid, .document-query-grid.has-issue-date { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lookup-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; margin-top: 16px; border: 1px solid rgba(184,0,6,.24); border-radius: 11px; background: var(--red-soft); color: var(--red); font-size: 11px; font-weight: 900; }
.lookup-btn:hover { background: #ffe7e8; border-color: rgba(184,0,6,.4); }
.lookup-btn:disabled { opacity: .65; cursor: wait; }
.lookup-btn.is-loading .spinner { display: inline-block; border-color: rgba(184,0,6,.25); border-top-color: var(--red); }
.document-lookup-status { min-height: 20px; margin: 9px 2px 0; color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.45; }
.document-lookup-status.is-loading { color: var(--blue); }
.document-lookup-status.is-error { color: var(--red); }
.document-lookup-status.is-success { color: var(--green); }
.document-preview { margin-top: 17px; border: 1px solid #bfe3d2; border-radius: 13px; overflow: hidden; background: #fbfffd; }
.document-preview.is-blocked { border-color: #efb8bb; background: #fffafa; }
.blocked-document-help { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 15px; background: #fff3f3; border-bottom: 1px solid #f0d7d8; }
.blocked-document-help strong, .blocked-document-help small { display: block; }
.blocked-document-help strong { color: var(--red-dark); font-size: 13px; }
.blocked-document-help small { margin-top: 3px; color: #7e6162; font-size: 12px; }
.blocked-whatsapp-btn { flex: 0 0 auto; padding: 10px 13px; border-radius: 10px; background: #167a57; color: #fff; text-decoration: none; font-size: 12px; font-weight: 850; }
.document-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 15px; border-bottom: 1px solid #dcebe4; }
.document-preview.is-blocked .document-preview-head { border-bottom-color: #f0d7d8; }
.document-preview-head strong, .document-preview-head small { display: block; }
.document-preview-head strong { font-size: 12px; }
.document-preview-head small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.document-preview-head > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 900; }
.document-preview.is-blocked .document-preview-head > span { background: var(--red-soft); color: var(--red); }
.preview-table-scroll { overflow-x: auto; }
.document-preview table { min-width: 610px; }
.document-preview th { background: rgba(246,243,239,.65); }
.document-preview td { padding-block: 11px; }
.preview-row-blocked { background: #fff3f3; }
.preview-status { display: inline-flex; padding: 4px 7px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 850; white-space: nowrap; }
.preview-status.blocked { color: var(--red); background: var(--red-soft); }
.confirmation-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 15px; border-top: 1px solid #dcebe4; color: #494541; font-size: 10px; line-height: 1.5; cursor: pointer; }
.confirmation-check input { flex: 0 0 17px; width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-grid article { padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbf9f7; }
.review-grid small, .review-grid strong { display: block; }
.review-grid small, .review-notes small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.review-grid strong { margin-top: 5px; font-size: 14px; line-height: 1.4; }
.review-documents { margin-top: 18px; }
.review-documents > strong { display: block; margin-bottom: 9px; font-size: 13px; }
.review-documents .preview-table-scroll { border: 1px solid var(--line); border-radius: 12px; }
.review-documents table { min-width: 610px; }
.review-notes { margin-top: 15px; padding: 13px 15px; border-radius: 12px; background: #f6f3ef; }
.review-notes p { margin: 5px 0 0; color: #5f5854; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.review-warning { display: flex; align-items: center; gap: 9px; margin: 15px 0 0; padding: 12px 14px; border-radius: 11px; background: var(--green-soft); color: #176f50; font-size: 12px; font-weight: 750; }
.review-warning span { flex: 0 0 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #fff; }
.remove-invoice-btn { padding: 6px 9px; border: 1px solid #efc7c9; border-radius: 8px; background: #fff; color: var(--red); font-size: 11px; font-weight: 850; white-space: nowrap; }
.remove-invoice-btn:hover { background: var(--red-soft); border-color: #dfa4a7; }
.form-error { min-height: 18px; margin: 0 3px 9px; color: #c4262e; font-size: 11px; font-weight: 700; }
.drawer-actions { position: fixed; right: 0; bottom: 0; width: min(680px, 100%); display: flex; justify-content: flex-end; gap: 10px; padding: 17px 34px; background: #fff; border-top: 1px solid var(--line); }
.secondary-btn, .confirm-btn { min-height: 45px; border-radius: 11px; padding: 0 18px; font-size: 11px; font-weight: 850; }
.secondary-btn { border: 1px solid var(--line); background: #fff; color: #5f5854; }
.confirm-btn { width: auto; margin: 0; }

/* O cadastro abre como uma janela central, mantendo o painel visível ao fundo. */
.appointment-modal { display: grid; place-items: center; padding: 28px; }
.appointment-modal-shell { position: relative; width: min(940px, 100%); max-height: calc(100vh - 56px); }
.appointment-modal .drawer-panel { position: relative; right: auto; top: auto; width: 100%; height: auto; max-height: calc(100vh - 56px); border-radius: 24px; transform: translateY(22px) scale(.98); opacity: 0; overflow-y: auto; }
.appointment-modal.is-open .drawer-panel { transform: none; opacity: 1; }
.appointment-modal #appointmentForm { padding: 18px 28px 0; }
.appointment-modal .modal-floating-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(43,28,20,.12);
    transform: translate(50%, -50%);
    line-height: 1;
    text-indent: 0;
}
.appointment-modal .modal-floating-close:hover { border-color: #dfa4a7; background: var(--red-soft); color: var(--red); }
.appointment-modal .modal-floating-close > span { display: block; transform: translateY(-2px); }
.appointment-modal .form-section:first-child .form-section-title { padding-right: 48px; }
.appointment-modal .drawer-actions { position: sticky; right: auto; bottom: 0; width: auto; margin: 0 -28px; padding: 16px 28px; z-index: 4; }

/* Formulário do agendamento com aparência mais leve e editorial. */
.appointment-modal .drawer-panel { background: #f7f5f2; }
.appointment-modal .appointment-steps { border-color: #eee9e5; box-shadow: 0 7px 22px rgba(66, 39, 25, .045); }
.appointment-modal .form-section { padding: 24px; border-color: #ebe6e2; border-radius: 15px; box-shadow: 0 4px 14px rgba(66, 39, 25, .035); }
.appointment-modal .form-section-title { align-items: flex-start; gap: 12px; margin-bottom: 21px; }
.appointment-modal .form-section-title > span { flex-basis: 29px; height: 29px; border: 1px solid #f1c9cb; border-radius: 9px; background: var(--red-soft); color: var(--red); }
.appointment-modal .form-section-title strong { color: #332f2d; font-size: 14px; font-weight: 800; }
.appointment-modal .form-section-title small { margin-top: 4px; color: #827a75; font-size: 11px; font-weight: 500; line-height: 1.45; }
.appointment-modal .form-grid { gap: 15px 14px; }
.appointment-modal .form-grid label, .appointment-modal .supplier-field > label { color: #625c58; font-size: 12px; font-weight: 700; }
.appointment-modal .form-grid input,
.appointment-modal .form-grid select,
.appointment-modal .form-grid textarea { margin-top: 6px; border-color: #d9d3ce; border-radius: 9px; background: #fff; font-size: 14px; font-weight: 450; box-shadow: none; }
.appointment-modal .form-grid input, .appointment-modal .form-grid select { height: 42px; padding-inline: 12px; }
.appointment-modal .form-grid textarea { min-height: 82px; padding: 10px 12px; line-height: 1.5; }
.appointment-modal .form-grid input:hover, .appointment-modal .form-grid select:hover, .appointment-modal .form-grid textarea:hover { border-color: #c7beb8; }
.appointment-modal .form-grid input:focus, .appointment-modal .form-grid select:focus, .appointment-modal .form-grid textarea:focus { border-color: #c96a6e; box-shadow: 0 0 0 3px rgba(184, 0, 6, .06); }
.appointment-modal .form-grid input::placeholder, .appointment-modal .form-grid textarea::placeholder { color: #b0a8a2; font-weight: 400; }
.appointment-modal .lookup-btn { min-height: 43px; margin-top: 16px; border-color: #ead3d4; border-radius: 9px; background: #fffafa; font-weight: 750; box-shadow: none; }
.appointment-modal .lookup-btn:hover { background: var(--red-soft); }
.appointment-modal .document-preview { border-color: #d2e7dd; border-radius: 15px; background: #fcfffd; }
.appointment-modal .document-preview-head { padding: 15px 16px; }
.appointment-modal .document-preview-head strong { font-size: 13px; font-weight: 800; }
.appointment-modal .document-preview-head small { font-size: 11px; font-weight: 500; }
.appointment-modal .document-preview td { padding-block: 10px; }
.appointment-modal .confirmation-check { padding: 15px 16px; background: #f8fcfa; font-size: 12px; font-weight: 550; }
.appointment-modal .drawer-actions { background: rgba(255, 255, 255, .96); box-shadow: 0 -8px 24px rgba(66, 39, 25, .045); }
.appointment-modal .secondary-btn, .appointment-modal .confirm-btn { min-height: 42px; border-radius: 9px; font-weight: 750; }
.appointment-modal .secondary-btn { border-color: #ded8d3; }
.appointment-modal .review-grid article { border-color: #e7e1dc; background: #fcfbfa; box-shadow: none; }

/* Redesenho 2.0 do modal: superfícies limpas, campos preenchidos e hierarquia clara. */
.appointment-modal-shell { width: min(1020px, 100%); }
.appointment-modal .drawer-panel { border: 1px solid rgba(255, 255, 255, .8); background: #fff; box-shadow: 0 30px 90px rgba(43, 28, 20, .24); }
.appointment-modal #appointmentForm { padding-top: 0; }
.appointment-modal .appointment-steps { position: sticky; top: 0; z-index: 5; margin: 0 -28px 0; padding: 20px 64px 18px; border: 0; border-bottom: 1px solid #eee9e5; border-radius: 24px 24px 0 0; background: rgba(255, 255, 255, .97); box-shadow: 0 7px 24px rgba(66, 39, 25, .04); backdrop-filter: blur(12px); }
.appointment-modal .appointment-steps::before { top: 35px; }
.appointment-modal .appointment-step-indicator > span { border-radius: 50%; box-shadow: 0 0 0 7px #fff; }
.appointment-modal .appointment-step-indicator strong { font-size: 12px; font-weight: 800; }
.appointment-modal .appointment-step-indicator small { color: #9c938d; font-size: 9px; font-weight: 500; }
.appointment-modal .appointment-wizard-step { padding-top: 0; }
.appointment-modal .form-section { margin: 0; padding: 28px 2px 24px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.appointment-modal .form-section:first-child .form-section-title { padding-right: 0; }
.appointment-modal .form-section-title { margin: 0 0 18px; padding-inline: 4px; align-items: center; }
.appointment-modal .form-section-title > span { flex-basis: 32px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #2f2b29; color: #fff; }
.appointment-modal .form-section-title strong { font-size: 16px; font-weight: 850; letter-spacing: -.015em; }
.appointment-modal .form-section-title small { margin-top: 2px; font-size: 12px; }
.document-query-surface, .delivery-form-surface { padding: 20px; border: 1px solid #eee9e5; border-radius: 16px; background: #f7f5f3; }
.appointment-modal .document-query-surface .form-grid, .appointment-modal .delivery-form-surface { gap: 17px; }
.appointment-modal .form-grid label, .appointment-modal .supplier-field > label { color: #615a56; font-size: 11px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.appointment-modal .form-grid input,
.appointment-modal .form-grid select,
.appointment-modal .form-grid textarea { border: 1px solid transparent; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(66, 39, 25, .06); color: #302d2b; text-transform: none; }
.appointment-modal .form-grid input, .appointment-modal .form-grid select { height: 46px; }
.appointment-modal .form-grid textarea { min-height: 88px; }
.appointment-modal .form-grid input:hover, .appointment-modal .form-grid select:hover, .appointment-modal .form-grid textarea:hover { border-color: #d8d0ca; }
.appointment-modal .form-grid input:focus, .appointment-modal .form-grid select:focus, .appointment-modal .form-grid textarea:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(184, 0, 6, .07); }
.appointment-modal .lookup-btn { width: auto; min-width: 270px; min-height: 44px; margin: 18px 0 0 auto; padding-inline: 18px; border: 0; border-radius: 10px; background: #302d2b; color: #fff; }
.appointment-modal .lookup-btn:hover { border: 0; background: var(--red); }
.appointment-modal .document-lookup-status { min-height: 0; margin: 10px 2px 0; font-size: 12px; font-weight: 650; }
.appointment-modal .document-lookup-status:empty { display: none; }
.appointment-modal .document-preview { margin-top: 18px; border-color: #e6e0db; border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(66, 39, 25, .04); }
.appointment-modal .document-preview-head { background: #fcfbfa; }
.appointment-modal .confirmation-check { border-top-color: #ece6e1; background: #fcfbfa; }
.appointment-modal .review-grid article { padding: 16px; border: 0; border-radius: 13px; background: #f6f4f2; }
.appointment-modal .review-documents .preview-table-scroll { border-color: #ebe5e0; }
.appointment-modal .review-notes { background: #f6f4f2; }
.appointment-modal .drawer-actions { margin-top: 4px; border-top-color: #eee9e5; box-shadow: 0 -10px 30px rgba(66, 39, 25, .05); }
.appointment-modal .secondary-btn { background: #f5f2f0; }
.appointment-modal .confirm-btn { min-width: 150px; }

/* Leitura mais confortável em todo o portal. */
body { font-size: 16px; }
.portal-label { font-size: 14px; }
.login-copy > p { font-size: 19px; }
.trust-item strong { font-size: 15px; }
.trust-item small, .access-note, .login-footer { font-size: 12px; }
.login-card > p, .welcome p { font-size: 16px; }
form label { font-size: 14px; }
.input-wrap input, .form-grid input, .form-grid select, .form-grid textarea { font-size: 14px; }
.field-error, .password-hint, .link-button { font-size: 12px; }
.email-contact-help { margin: 12px 0; padding: 13px; border: 1px solid #efc7c9; border-radius: 11px; background: #fff7f7; color: #7e3438; }
.email-contact-help strong { display: block; color: var(--red-dark); font-size: 13px; }
.email-contact-help p { margin: 5px 0 10px; font-size: 12px; line-height: 1.45; }
.email-contact-links { display: flex; flex-wrap: wrap; gap: 8px; }
.email-contact-links a { padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid #efc7c9; color: var(--red); font-size: 12px; font-weight: 800; text-decoration: none; }
.primary-btn, .primary-action, .secondary-btn, .confirm-btn, .lookup-btn { font-size: 13px; }
.user-chip strong, #userTopName { max-width: 100%; color: var(--ink); font-size: 19px; line-height: 1.15; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.user-chip small, #userTopType { font-size: 13px; line-height: 1.2; }
.logout-btn { font-size: 13px; }
.stat-card small { font-size: 11px; }
.stat-card strong { font-size: 25px; }
.section-head .eyebrow, .welcome .eyebrow { font-size: 12px; }
.section-head h2 { font-size: 25px; }
.filters input, .filters select { font-size: 12px; }
th { font-size: 11px; }
td { font-size: 13px; }
.cell-sub, .status-pill { font-size: 11px; }
.whatsapp-card small, .rules-title small, .rules-card li small { font-size: 11px; }
.whatsapp-card p, .whatsapp-link { font-size: 13px; }
.rules-title strong { font-size: 15px; }
.rules-card li strong { font-size: 13px; }
.form-section-title small { font-size: 12px; }
.form-section-title strong { font-size: 15px; }
.document-preview-head strong { font-size: 14px; }
.document-preview-head small, .document-preview-head > span, .preview-status, .confirmation-check { font-size: 12px; }
.form-error { font-size: 13px; }
.document-query-grid label { font-size: 15px; }
.document-query-grid input, .document-query-grid select { height: 52px; font-size: 16px; padding-inline: 14px; }
.document-query-grid .field-assist { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.4; }
.supplier-field { position: relative; }
.supplier-field > label { display: block; margin: 0; }
.supplier-search-control { position: relative; }
.supplier-search-control input { padding-right: 44px; }
.clear-supplier-btn { position: absolute; top: 50%; right: 9px; width: 34px; height: 34px; border: 0; border-radius: 9px; transform: translateY(-50%); background: #f3eeeb; color: #6e6661; font-size: 24px; line-height: 1; }
.clear-supplier-btn:hover { background: var(--red-soft); color: var(--red); }
.supplier-suggestions { position: absolute; top: 82px; right: 0; left: 0; z-index: 8; max-height: 235px; overflow-y: auto; padding: 6px; border: 1px solid #e6d8d2; border-radius: 11px; background: #fff; box-shadow: 0 13px 28px rgba(71, 45, 36, .16); }
.supplier-option { display: block; width: 100%; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.supplier-option:hover, .supplier-option:focus { background: var(--red-soft); outline: 0; }
.supplier-option strong, .supplier-option span { display: block; }
.supplier-option strong { font-size: 13px; }
.supplier-option span { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.supplier-empty { display: block; padding: 11px; color: var(--muted); font-size: 12px; font-weight: 650; }
.supplier-selected { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #28714e; font-size: 12px; }
.supplier-selected span { color: var(--muted); font-weight: 650; }
.supplier-selected strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; visibility: hidden; pointer-events: none; padding: 20px; }
.modal.is-open { visibility: visible; pointer-events: auto; }
.success-card { position: relative; width: min(460px, 100%); padding: 37px; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(43,28,20,.25); text-align: center; transform: translateY(15px) scale(.97); opacity: 0; transition: .25s; }
.modal.is-open .success-card { transform: none; opacity: 1; }
.success-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 19px; background: var(--green-soft); color: var(--green); font-size: 27px; font-weight: 900; }
.success-card h2 { margin: 7px 0 8px; font-size: 25px; letter-spacing: -.04em; }
.success-card > p { color: var(--muted); font-size: 12px; }
.protocol-box { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 3px 15px; margin: 24px 0 12px; padding: 15px 17px; border-radius: 13px; background: #f6f3ef; border: 1px dashed #d3c9c2; }
.protocol-box small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.protocol-box strong { color: var(--red); font-size: 20px; letter-spacing: .04em; }
.protocol-box button { grid-row: 1 / 3; grid-column: 2; align-self: center; border: 0; background: transparent; color: var(--red); font-size: 10px; font-weight: 850; }
.email-result { min-height: 17px; }
.success-actions { display: flex; gap: 9px; margin-top: 20px; }
.success-actions > * { flex: 1; margin: 0; justify-content: center; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 200; transform: translate(-50%, 25px); display: flex; align-items: center; gap: 10px; padding: 12px 17px; border-radius: 12px; color: #fff; background: #2c2927; box-shadow: 0 14px 35px rgba(0,0,0,.22); opacity: 0; visibility: hidden; transition: .25s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast span { color: #6fe0ae; font-weight: 900; }
.toast p { margin: 0; font-size: 11px; }

.reveal { animation: reveal .6s ease both; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-5px); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(5px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
    .login-layout { gap: 50px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .side-column { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .compact-whatsapp { display: none; }
}

@media (max-width: 820px) {
    .login-view { padding: 24px 22px 20px; }
    .login-layout { grid-template-columns: 1fr; padding: 55px 0 35px; }
    .login-copy { text-align: center; }
    .login-copy > p { margin-inline: auto; }
    .trust-row { justify-content: center; }
    .login-card { width: min(490px, 100%); margin: auto; }
    .login-footer { margin-top: 20px; }
    .brand img { width: 176px; }
    .brand.compact img { width: 135px; }
    .brand.compact .blim-partner-logo { width: 80px; }
    .brand.compact .ce-partner-logo { width: 98px; }
    .topbar { padding-inline: 18px; }
    .topbar .brand-divider, .topbar .portal-label, .compact-whatsapp { display: none; }
    .user-chip { padding: 0; max-width: min(360px, 43vw); }
    .user-chip strong, #userTopName { max-width: 100%; font-size: 16px; }
    .dashboard-content { padding-top: 32px; }
    .hero-row { align-items: center; }
    .section-head { align-items: flex-start; flex-direction: column; }
    .section-actions { width: 100%; flex-wrap: wrap; justify-content: stretch; }
    .filters { width: 100%; }
    .filters .search-field { flex: 1; }
    .filters input { width: 100%; }
    .form-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .document-query-grid, .document-query-grid.has-issue-date { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 580px) {
    .login-view { padding-inline: 17px; }
    .login-brand { gap: 12px; }
    .login-brand .partner-logo-lockup { gap: 7px; }
    .login-brand .blim-partner-logo { width: 88px; }
    .login-brand .ce-partner-logo { width: 104px; }
    .login-brand .portal-label { font-size: 9px; }
    .login-brand .brand-divider { height: 30px; }
    .login-layout { padding-top: 37px; }
    .login-copy h1 { font-size: 45px; }
    .login-copy > p { font-size: 14px; }
    .trust-row { gap: 15px; }
    .trust-item { text-align: left; }
    .trust-item small { display: none; }
    .login-card { padding: 31px 24px 25px; }
    .login-footer { flex-direction: column; gap: 7px; }
    .topbar { min-height: 67px; }
    .brand.compact img { width: 116px; }
    .partner-logo-lockup { gap: 7px; }
    .brand.compact .blim-partner-logo { width: 72px; }
    .brand.compact .ce-partner-logo { width: 88px; }
    .brand-cross { font-size: 14px; }
    .user-chip > span { display: none; }
    .topbar { flex-wrap: wrap; gap: 10px; }
    .topbar-actions { width: 100%; grid-template-columns: minmax(0, 1fr) auto; justify-content: stretch; }
    .user-chip { max-width: 100%; justify-self: end; }
    .user-chip strong, #userTopName { max-width: 100%; font-size: 14px; }
    .user-chip small, #userTopType { font-size: 11px; }
    .logout-btn { padding: 8px 10px; }
    .dashboard-content { padding-inline: 15px; }
    .hero-row { align-items: stretch; flex-direction: column; }
    .hero-actions, .primary-action { width: 100%; }
    .welcome h1 { font-size: 36px; }
    .stats-grid { gap: 9px; }
    .stat-card { padding: 14px 12px; gap: 9px; }
    .stat-icon { flex-basis: 34px; height: 34px; }
    .stat-card strong { font-size: 18px; }
    .appointments-card { padding: 19px 15px; }
    .table-pagination { align-items: stretch; flex-direction: column; text-align: center; }
    .table-pagination > div { justify-content: center; }
    .filters { align-items: stretch; flex-direction: column; }
    .filters select { width: 100%; }
    .section-actions, .dashboard-new-action { width: 100%; }
    .side-column { grid-template-columns: 1fr; }
    #appointmentForm { padding: 18px 15px 105px; }
    .form-section { padding: 18px 15px; }
    .form-grid, .form-grid.three, .document-query-grid, .document-query-grid.has-issue-date { grid-template-columns: 1fr; }
    .blocked-document-help { align-items: stretch; flex-direction: column; }
    .blocked-whatsapp-btn { text-align: center; }
    .drawer-actions { padding: 14px 15px; }
    .appointment-modal { padding: 10px; }
    .appointment-modal-shell { max-height: calc(100vh - 20px); }
    .appointment-modal .drawer-panel { max-height: calc(100vh - 20px); border-radius: 18px; }
    .appointment-modal .modal-floating-close { transform: translate(35%, -35%); }
    .appointment-modal #appointmentForm { padding: 16px 12px 0; }
    .appointment-modal .drawer-actions { margin: 0 -12px; padding: 13px 12px; }
    .appointment-modal .appointment-steps { margin: -16px -12px 0; padding: 14px 10px 12px; border-radius: 18px 18px 0 0; }
    .appointment-modal .appointment-steps::before { top: 29px; }
    .appointment-modal .form-section { padding: 20px 0; }
    .document-query-surface, .delivery-form-surface { padding: 14px; border-radius: 13px; }
    .appointment-modal .lookup-btn { width: 100%; min-width: 0; }
    .appointment-steps { gap: 6px; padding: 11px 9px; }
    .appointment-steps::before { top: 26px; left: calc(16.666% + 12px); right: calc(16.666% + 12px); }
    .appointment-step-indicator { justify-content: flex-start; gap: 6px; }
    .appointment-step-indicator > span { flex-basis: 27px; height: 27px; }
    .appointment-step-indicator small { display: none; }
    .appointment-step-indicator strong { font-size: 10px; }
    .review-grid { grid-template-columns: 1fr; }
    .success-card { padding: 30px 21px; }
    .success-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.registration-notice {
    margin: 14px 0;
    padding: 13px 15px;
    border: 1px solid rgba(31, 143, 93, .24);
    border-radius: 12px;
    color: #16633f;
    background: rgba(31, 143, 93, .09);
    font-size: .9rem;
    line-height: 1.5;
    text-align: center;
}
