@import url('./global.css');

:root {
    --font-ui: "Segoe UI", Arial, sans-serif;
    --font-display: "Segoe UI", Arial, sans-serif;
    --ink: #122238;
    --muted: #607084;
    --paper: #f6f8f6;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --line: rgba(18, 34, 56, 0.12);
    --navy: #102a43;
    --navy-2: #173f5f;
    --aqua: #1c8f8a;
    --mint: #9dd9c5;
    --gold: #d7a748;
    --orange: #d46f3d;
    --danger: #b54747;
    --green: #247c52;
    --shadow: 0 24px 80px rgba(16, 42, 67, 0.16);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-ui);
    background:
        radial-gradient(circle at 12% 14%, rgba(157, 217, 197, 0.55), transparent 28rem),
        radial-gradient(circle at 88% 4%, rgba(215, 167, 72, 0.28), transparent 24rem),
        linear-gradient(145deg, #eef5f2 0%, #f9faf5 42%, #edf2f7 100%);
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
canvas,
video {
    max-width: 100%;
    height: auto;
}

main,
section,
article,
aside,
div,
form {
    min-width: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(16, 42, 67, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 42, 67, 0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
}

a {
    color: inherit;
}

.shell {
    width: min(1560px, calc(100% - clamp(12px, 3vw, 32px)));
    margin: 0 auto;
    padding: clamp(12px, 2vw, 24px) 0 clamp(32px, 5vw, 56px);
}

.hero {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    border-radius: var(--radius-xl);
    min-height: clamp(300px, 38vw, 360px);
    color: #fff;
    box-shadow: var(--shadow);
    background:
        linear-gradient(105deg, rgba(10, 32, 50, 0.96) 0%, rgba(16, 58, 76, 0.84) 47%, rgba(16, 42, 67, 0.28) 100%),
        url("mantevida-hospital-l2-norte.jpeg") center right / cover no-repeat;
    isolation: isolate;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -32% 44%;
    height: 300px;
    border-radius: 999px;
    background: rgba(157, 217, 197, 0.22);
    filter: blur(6px);
    transform: rotate(-10deg);
    z-index: -1;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
    gap: clamp(18px, 2.4vw, 28px);
    align-items: end;
    padding: clamp(22px, 3vw, 34px);
}

.hero-grid > * {
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    text-decoration: none;
}

a.brand {
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

a.brand:hover {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

a.brand:focus-visible {
    outline: 3px solid rgba(157, 217, 197, 0.7);
    outline-offset: 3px;
}

.brand img {
    width: 132px;
    max-height: 36px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.hero h1 {
    max-width: 780px;
    margin: 34px 0 16px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 5.4rem);
    line-height: 0.92;
    letter-spacing: -0.075em;
    overflow-wrap: anywhere;
}

.hero-copy {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.hero-chip,
.soft-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.hero-chip {
    color: #ecfff7;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.hero-panel {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    background: rgba(7, 24, 38, 0.48);
    backdrop-filter: blur(18px);
}

.hero-panel .eyebrow {
    color: var(--mint);
}

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.mini-metric {
    container-type: inline-size;
    min-height: 104px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.mini-metric strong {
    display: block;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 1.42rem;
    font-size: clamp(1.22rem, 9cqw, 1.42rem);
    line-height: 1;
    letter-spacing: -0.045em;
    white-space: nowrap;
}

.mini-metric span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
}

.toolbar {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -28px clamp(0px, 2vw, 20px) 26px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 16px 50px rgba(16, 42, 67, 0.12);
    backdrop-filter: blur(18px);
    max-width: 100%;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.toolbar-title strong {
    display: block;
    overflow-wrap: anywhere;
}

.toolbar-title span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 7px rgba(215, 167, 72, 0.18);
}

.status-dot.ok {
    background: var(--green);
    box-shadow: 0 0 0 7px rgba(36, 124, 82, 0.16);
}

.status-dot.fail {
    background: var(--danger);
    box-shadow: 0 0 0 7px rgba(181, 71, 71, 0.14);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font: 800 0.9rem/1 var(--font-ui);
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--aqua), var(--navy-2));
    box-shadow: 0 12px 26px rgba(28, 143, 138, 0.26);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.button:hover,
button.button:hover {
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 18px 38px rgba(16, 42, 67, 0.22);
}

.button.secondary {
    color: var(--ink);
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.button.danger {
    background: linear-gradient(135deg, #b42318, #7a271a);
    box-shadow: 0 12px 26px rgba(180, 35, 24, 0.2);
}

.button.success {
    background: linear-gradient(135deg, #247c52, #1c8f8a);
    box-shadow: 0 12px 26px rgba(36, 124, 82, 0.2);
}

.button.compact {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.78rem;
}

.inline-action {
    display: inline-flex;
    margin: 0;
}

.muted-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.layout {
    display: grid;
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 18px 60px rgba(16, 42, 67, 0.11);
    backdrop-filter: blur(18px);
    max-width: 100%;
}

.card.solid {
    background: var(--panel-strong);
}

.filters {
    position: sticky;
    top: 104px;
    padding: 26px;
    min-width: 0;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--aqua);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.section-head h2,
.section-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.section-head p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.filter-grid {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.field label {
    color: #30445b;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(18, 34, 56, 0.16);
    border-radius: 16px;
    color: var(--ink);
    font: 750 1rem/1.25 var(--font-ui);
    background: rgba(255, 255, 255, 0.84);
    outline: none;
    transition: border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field select {
    appearance: none;
    padding-right: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--aqua) 50%),
        linear-gradient(135deg, var(--aqua) 50%, transparent 50%);
    background-position:
        calc(100% - 24px) 23px,
        calc(100% - 18px) 23px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.field textarea {
    min-height: 132px;
    resize: vertical;
}

.field select option {
    white-space: normal;
}

.field input::placeholder {
    color: rgba(96, 112, 132, 0.68);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(28, 143, 138, 0.72);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(28, 143, 138, 0.12);
}

.check-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(18, 34, 56, 0.12);
    border-radius: 18px;
    color: #30445b;
    font-weight: 800;
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.72);
}

.check-line input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: var(--aqua);
}

.button:disabled,
button.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.25);
    transform: none;
    box-shadow: none;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 34px);
    background: rgba(10, 32, 50, 0.62);
    backdrop-filter: blur(10px);
}

.confirm-modal-card {
    width: min(760px, 100%);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: clamp(18px, 3vw, 26px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.field small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.split.wide-fields {
    grid-template-columns: 1fr;
}

.filter-actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.filter-actions .button {
    min-height: 50px;
}

.import-action-bar {
    grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.2fr);
    align-items: stretch;
}

.import-action-bar .button {
    min-height: 58px;
}

.button.lookup-action {
    color: #10384e;
    border: 1px solid rgba(28, 143, 138, 0.42);
    background: linear-gradient(135deg, #ffffff, #e8f8f3);
    box-shadow: 0 10px 24px rgba(28, 143, 138, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.button.procedure-action {
    min-height: 62px;
    padding-inline: 24px;
    font-size: 0.98rem;
    background: linear-gradient(135deg, #1c8f8a, #d7a748 54%, #12365b);
    box-shadow: 0 16px 34px rgba(215, 167, 72, 0.32), 0 10px 26px rgba(18, 54, 91, 0.16);
}

.button.procedure-action:not(:disabled) {
    transform: translateY(-1px);
}

.button.lookup-action:disabled,
.button.procedure-action:disabled {
    box-shadow: none;
    transform: none;
}

@media (max-width: 720px) {
    .import-action-bar {
        grid-template-columns: 1fr;
    }
}

.note {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(215, 167, 72, 0.3);
    border-radius: 18px;
    color: #665128;
    font-size: 0.88rem;
    line-height: 1.5;
    background: rgba(255, 247, 225, 0.78);
    overflow-wrap: anywhere;
}

.content {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.message {
    padding: 18px 20px;
    border-radius: 22px;
    line-height: 1.55;
    border: 1px solid rgba(18, 34, 56, 0.1);
    background: #fff;
    box-shadow: 0 14px 42px rgba(16, 42, 67, 0.1);
    overflow-wrap: anywhere;
}

.message.error {
    color: #7a2727;
    border-color: rgba(181, 71, 71, 0.18);
    background: #fff3f1;
}

.message.info {
    color: #29435d;
    border-color: rgba(28, 143, 138, 0.18);
    background: #f0fbf7;
}

.message.ok {
    color: #1a5c35;
    border-color: rgba(34, 139, 84, 0.2);
    background: #f0faf4;
}

.message.warning {
    color: #7a4f00;
    border-color: rgba(200, 140, 0, 0.25);
    background: #fffbec;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 42px);
}

.auth-panel {
    width: min(100%, 1180px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px);
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.auth-hero {
    min-height: 620px;
    display: flex;
    align-items: flex-end;
    padding: clamp(24px, 4vw, 42px);
    color: #fff;
    background:
        linear-gradient(115deg, rgba(10, 32, 50, 0.96) 0%, rgba(16, 58, 76, 0.86) 54%, rgba(16, 42, 67, 0.38) 100%),
        url("mantevida-hospital-l2-norte.jpeg") center / cover no-repeat;
}

.auth-hero-content {
    display: grid;
    gap: 18px;
    max-width: 720px;
}

.auth-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.35rem, 5vw, 5.2rem);
    line-height: 0.92;
    letter-spacing: -0.07em;
}

.auth-hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
}

.auth-form {
    display: grid;
    align-content: center;
    gap: 22px;
    padding: clamp(24px, 4vw, 42px);
}

.auth-form .brand {
    color: var(--ink);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.88);
}

.auth-form .brand img {
    filter: none;
}

.auth-form .brand span {
    color: var(--muted);
}

.auth-form .button {
    width: 100%;
    min-height: 54px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}

.module-tile {
    display: grid;
    gap: 18px;
    min-height: 230px;
    padding: 22px;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.module-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(28, 143, 138, 0.35);
    box-shadow: 0 26px 70px rgba(16, 42, 67, 0.16);
}

.module-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.module-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(145deg, var(--navy-2), var(--aqua));
}

.module-tile h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.2vw, 2.1rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.module-tile p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.module-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    color: var(--aqua);
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.list-page {
    display: grid;
    gap: 22px;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 14px;
}

.summary-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.summary-item span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.summary-item strong {
    display: block;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 1.6rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge.ok {
    color: #14583b;
    background: rgba(157, 217, 197, 0.45);
}

.badge.fail {
    color: #7a2727;
    background: #fff3f1;
}

.table-tools {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.table-count {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

[hidden] {
    display: none !important;
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
}

.pagination-size {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.pagination-select {
    min-height: 38px;
    min-width: 96px;
    padding: 7px 32px 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: 800 0.86rem/1.2 var(--font-ui);
    background: #fff;
}

.pagination-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.pagination-button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid rgba(28, 143, 138, 0.32);
    border-radius: 8px;
    color: #10384e;
    font: 800 0.82rem/1.2 var(--font-ui);
    background: #fff;
    cursor: pointer;
}

.pagination-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.pagination-status {
    min-width: 92px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 28px;
    position: relative;
    padding: 0 18px 0 0;
    border: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    background: transparent;
    cursor: pointer;
}

.sort-button::before,
.sort-button::after {
    content: "";
    position: absolute;
    right: 0;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    color: rgba(96, 112, 132, 0.62);
    opacity: 0.72;
}

.sort-button::before {
    top: calc(50% - 8px);
    border-bottom: 5px solid currentColor;
}

.sort-button::after {
    top: calc(50% + 2px);
    border-top: 5px solid currentColor;
}

.sort-button[aria-sort="ascending"]::before,
.sort-button[aria-sort="descending"]::after {
    color: var(--aqua);
    opacity: 1;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 16px;
}

.kpi {
    container-type: inline-size;
    position: relative;
    overflow: hidden;
    min-height: 166px;
    padding: 20px;
    border-radius: 26px;
    color: #fff;
    background: var(--navy);
    box-shadow: 0 20px 55px rgba(16, 42, 67, 0.16);
}

.kpi::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -70px;
    bottom: -90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.kpi.produzido {
    background: linear-gradient(145deg, #143f5d, #1c8f8a);
}

.kpi.faturado {
    background: linear-gradient(145deg, #12365b, #247c52);
}

.kpi.afaturar {
    background: linear-gradient(145deg, #554017, #d7a748);
}

.kpi.glosa {
    background: linear-gradient(145deg, #6f2d2d, #d46f3d);
}

.kpi.divergencia {
    background: linear-gradient(145deg, #3a315f, #9a5f98);
}

.kpi span {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.kpi strong {
    position: relative;
    z-index: 1;
    display: block;
    margin: 16px 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.36rem, 2vw, 2.65rem);
    font-size: clamp(1.36rem, 13cqw, 2.65rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.kpi small {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 18px;
}

.panel-pad {
    padding: 22px;
}

.bars {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    gap: 8px;
}

.bar-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
    min-width: 0;
}

.bar-top strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.bar-track {
    overflow: hidden;
    height: 13px;
    border-radius: 999px;
    background: rgba(18, 34, 56, 0.08);
}

.bar-fill {
    height: 100%;
    min-width: 5px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--aqua), var(--gold));
    transform-origin: left center;
    animation: growBar 700ms ease both;
}

.mix-list {
    display: grid;
    gap: 12px;
}

.mix-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border-radius: 18px;
    background: rgba(18, 34, 56, 0.045);
}

.mix-item strong {
    display: block;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.mix-item span {
    color: var(--muted);
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.soft-chip {
    color: #16483f;
    background: rgba(157, 217, 197, 0.35);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2px 0 16px;
    min-width: 0;
}

.tab-button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(18, 34, 56, 0.12);
    border-radius: 999px;
    color: var(--muted);
    font: 900 0.86rem/1 var(--font-ui);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tab-button.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--navy-2), var(--aqua));
}

.band {
    display: none;
}

.band.active {
    display: block;
    animation: reveal 320ms ease both;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fff;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.table-wrap.wide table {
    min-width: 1360px;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(18, 34, 56, 0.08);
    text-align: left;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #43546a;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #f7faf9;
}

td {
    color: #24384d;
    font-size: 0.92rem;
}

tr:hover td {
    background: rgba(157, 217, 197, 0.12);
}

.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.nowrap {
    white-space: nowrap;
}

.detail-cell {
    min-width: 280px;
    line-height: 1.4;
}

.empty {
    padding: 34px;
    color: var(--muted);
    text-align: center;
}

.footer {
    margin-top: 26px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
    text-align: center;
}

@keyframes growBar {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 1320px) {
    .layout {
        grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
        gap: 22px;
    }

    .filters {
        padding: 22px;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .auth-panel {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: 420px;
    }

    .hero-grid,
    .layout,
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        position: static;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .filter-grid > .field,
    .filter-grid > .note {
        grid-column: span 2;
    }

    .filter-grid > .split {
        grid-column: span 2;
    }

    .split.wide-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
        margin: 14px 0 20px;
    }

    .toolbar-title strong {
        white-space: normal;
    }

    .actions {
        justify-content: stretch;
    }

    .actions .button {
        flex: 1 1 160px;
    }

    .tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tab-button {
        width: 100%;
        border-radius: 16px;
        padding: 10px 12px;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    table {
        border-collapse: separate;
        border-spacing: 0;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    tr {
        overflow: hidden;
        margin-bottom: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 12px 32px rgba(16, 42, 67, 0.08);
    }

    td {
        display: grid;
        grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
        align-items: start;
        gap: 12px;
        min-height: 44px;
        padding: 12px 14px;
        border-bottom: 1px solid rgba(18, 34, 56, 0.08);
        text-align: right;
        overflow-wrap: anywhere;
    }

    td::before {
        content: attr(data-label);
        color: #607084;
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-align: left;
        text-transform: uppercase;
    }

    td:last-child {
        border-bottom: 0;
    }

    td.empty {
        display: block;
        text-align: center;
    }

    td.empty::before {
        content: none;
    }

    td:first-child {
        background: rgba(157, 217, 197, 0.16);
        font-weight: 800;
    }

    .num,
    .nowrap {
        white-space: normal;
    }

    tr:hover td {
        background: transparent;
    }

    tr:hover td:first-child {
        background: rgba(157, 217, 197, 0.16);
    }
}

@media (max-width: 720px) {
    .table-tools {
        grid-template-columns: 1fr;
    }

    .table-count {
        justify-content: flex-start;
    }

    .table-pagination {
        align-items: stretch;
    }

    .pagination-size,
    .pagination-actions {
        width: 100%;
    }

    .pagination-select,
    .pagination-button {
        flex: 1;
    }

    .shell {
        width: min(100% - 24px, 1480px);
        padding-top: 12px;
    }

    .hero {
        border-radius: 24px;
    }

    .hero-grid {
        padding: 22px;
    }

    .hero h1 {
        margin-top: 24px;
    }

    .button,
    button.button {
        width: 100%;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .actions .button {
        width: 100%;
        min-width: 0;
        flex: initial;
    }

    .kpis,
    .mini-metrics,
    .filter-grid,
    .split {
        grid-template-columns: 1fr;
    }

    .filter-grid > .field,
    .filter-grid > .split,
    .filter-grid > .note {
        grid-column: span 1;
    }

    .tabs {
        grid-template-columns: 1fr;
    }

    .card,
    .kpi {
        border-radius: 22px;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        padding: 10px;
    }

    .auth-panel {
        border-radius: 24px;
    }

    .auth-hero,
    .auth-form {
        padding: 18px;
    }

    .auth-hero {
        min-height: 360px;
    }

    .shell {
        width: min(100% - 10px, 1560px);
    }

    .hero-grid,
    .filters,
    .panel-pad {
        padding: 18px;
    }

    .kpi,
    .mini-metric {
        padding: 16px;
    }

    .toolbar {
        padding: 10px;
        border-radius: 18px;
    }

    .toolbar-title {
        align-items: flex-start;
    }

    .status-dot {
        flex: 0 0 14px;
        margin-top: 4px;
    }

    .brand {
        width: 100%;
        justify-content: center;
        border-radius: 18px;
    }

    .brand span {
        display: none;
    }

    .hero h1 {
        font-size: clamp(1.85rem, 11vw, 2.7rem);
        letter-spacing: -0.055em;
    }

    .kpi strong,
    .mini-metric strong {
        font-size: clamp(1.32rem, 7vw, 1.62rem);
        letter-spacing: -0.045em;
        white-space: nowrap;
    }

    .hero-copy {
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .hero-meta {
        gap: 8px;
    }

    .hero-chip,
    .soft-chip {
        width: 100%;
        justify-content: center;
        border-radius: 14px;
        text-align: center;
    }

    .field input,
    .field select {
        min-height: 50px;
        font-size: 0.95rem;
    }

    .mix-item {
        grid-template-columns: 1fr;
    }

    td {
        grid-template-columns: 1fr;
        text-align: left;
    }

    td::before {
        margin-bottom: -4px;
    }
}

/* Ajustes finais para que valores longos sejam exibidos sem cortes. */
.hero,
.hero-panel,
.toolbar,
.card,
.panel-pad,
.filters,
.module-tile,
.summary-item,
.message,
.note,
.field,
.kpi,
.mini-metric,
.mix-item,
.table-wrap,
th,
td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero {
    min-height: auto;
}

.hero-grid {
    align-items: stretch;
}

.brand,
.hero-meta,
.toolbar-title,
.actions,
.module-tile-head,
.bar-top,
.mix-item {
    flex-wrap: wrap;
}

.brand img {
    flex: 0 1 132px;
    min-width: 88px;
}

.brand span,
.hero-chip,
.soft-chip,
.badge,
.module-link,
.table-count,
.sort-button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
}

.hero-chip,
.soft-chip,
.badge {
    height: auto;
    text-align: center;
}

.button,
button.button,
.tab-button {
    height: auto;
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.field input,
.field select {
    height: auto;
    min-height: 52px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.field select {
    background-position:
        calc(100% - 24px) center,
        calc(100% - 18px) center;
}

.mini-metric {
    min-height: auto;
}

.mini-metric strong,
.kpi strong,
.summary-item strong {
    white-space: normal;
    line-height: 1.08;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kpi {
    min-height: auto;
}

.kpi strong {
    font-size: clamp(1.24rem, 9cqw, 2.25rem);
}

.bar-top {
    align-items: flex-start;
}

.bar-top strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

table {
    table-layout: auto;
}

th,
td {
    max-width: 420px;
    min-width: 0;
}

.num,
.nowrap {
    white-space: normal;
}

.table-wrap {
    overflow-y: visible;
}

.table-wrap tr,
.table-wrap th,
.table-wrap td {
    overflow: visible;
    text-overflow: clip;
}

.actions .button,
.filter-actions .button {
    max-width: 100%;
}

.field textarea,
textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.table-wrap td > *,
.table-wrap th > * {
    max-width: 100%;
}

.detail-cell {
    min-width: 0;
}

@media (min-width: 901px) {
    .table-wrap {
        overflow-x: auto;
    }

    table {
        min-width: 100%;
    }

    th {
        max-width: none;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .num,
    .nowrap {
        white-space: nowrap;
    }

    .table-wrap.wide table {
        min-width: 1120px;
    }
}

/* Responsividade global: paginas e conteudos fluidos no zoom padrao do navegador. */
html,
body,
.shell,
.auth-shell,
.auth-panel,
.hero,
.hero-grid,
.hero-panel,
.toolbar,
.toolbar-title,
.actions,
.layout,
.content,
.card,
.panel-pad,
.filters,
.filter-grid,
.split,
.field,
.kpis,
.kpi,
.mini-metrics,
.mini-metric,
.summary-strip,
.summary-item,
.menu-grid,
.module-tile,
.message,
.note,
.table-wrap,
.table-tools,
.table-pagination {
    max-width: 100%;
}

.shell,
.auth-shell,
.hero-grid,
.toolbar,
.layout,
.content,
.card,
.panel-pad,
.filters,
.filter-grid,
.split,
.field,
.kpis,
.kpi,
.mini-metrics,
.mini-metric,
.summary-strip,
.summary-item,
.menu-grid,
.module-tile,
.message,
.note,
.table-tools,
.table-pagination {
    min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
small,
span,
strong,
em,
a,
li,
dt,
dd,
.hero-copy,
.toolbar-title,
.section-head,
.section-title,
.field,
.message,
.note,
.kpi,
.mini-metric,
.summary-item,
.module-tile,
.table-count,
.pagination-size,
.pagination-status {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.field input,
.field select,
.field textarea,
input,
select,
textarea {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.button,
button.button,
.tab-button,
.pagination-button,
.pagination-select,
.badge,
.hero-chip,
.soft-chip,
.source-pill,
.audit-action {
    max-width: 100%;
    min-width: 0;
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.table-wrap table {
    width: 100%;
    min-width: max(100%, 980px);
    table-layout: auto;
}

.table-wrap.wide table {
    min-width: max(100%, 1360px);
}

.table-wrap th,
.table-wrap td {
    min-width: 0;
    max-width: none;
    vertical-align: top;
}

.table-wrap th {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.table-wrap td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-wrap td > *,
.table-wrap th > * {
    max-width: 100%;
    min-width: 0;
}

.table-wrap .num,
.table-wrap .nowrap {
    white-space: nowrap;
}

.detail-cell,
.snippet,
.snippet-text,
.audit-text,
pre,
code {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 900px) {
    .table-wrap {
        overflow: visible;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap th,
    .table-wrap td {
        max-width: 100%;
    }

    .table-wrap .num,
    .table-wrap .nowrap {
        white-space: normal;
    }
}

/* Tipografia compacta global para encaixe no zoom padrao do navegador (100%). */
body {
    font-size: 14px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
small,
span,
strong,
em,
a,
li,
dt,
dd,
button,
input,
select,
textarea,
th,
td {
    letter-spacing: 0 !important;
}

.hero h1,
.auth-hero h1 {
    font-size: 3rem !important;
    line-height: 1 !important;
}

.hero-copy,
.auth-hero p {
    font-size: 0.94rem !important;
    line-height: 1.5 !important;
}

.section-head h2,
.section-title,
.module-tile h2 {
    font-size: 1.28rem !important;
    line-height: 1.08 !important;
}

.section-head p,
.toolbar-title span,
.module-tile p,
.note,
.message,
.field small,
.kpi small,
.mini-metric span,
.summary-item span,
.table-count,
.pagination-size,
.pagination-status,
.muted-action {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
}

.toolbar-title strong,
.module-link,
.field label,
.eyebrow {
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
}

.button,
button.button,
.tab-button,
.pagination-button {
    font-size: 0.76rem !important;
    line-height: 1.18 !important;
}

.button.compact {
    font-size: 0.7rem !important;
}

.field input,
.field select,
.field textarea,
input,
select,
textarea {
    font-size: 0.86rem !important;
    line-height: 1.22 !important;
}

.hero-chip,
.soft-chip,
.badge,
.source-pill,
.audit-action {
    font-size: 0.68rem !important;
    line-height: 1.18 !important;
}

.mini-metric strong,
.summary-item strong {
    font-size: 1.08rem !important;
    line-height: 1.05 !important;
}

.kpi strong {
    font-size: 1.52rem !important;
    line-height: 1.05 !important;
}

.module-icon {
    font-size: 0.98rem !important;
}

.table-wrap table {
    min-width: max(100%, 900px) !important;
}

.table-wrap.wide table {
    min-width: max(100%, 1240px) !important;
}

.table-wrap th {
    font-size: 0.62rem !important;
    line-height: 1.12 !important;
}

.table-wrap td {
    font-size: 0.78rem !important;
    line-height: 1.28 !important;
}

.detail-cell,
.snippet,
.snippet-text,
.audit-text {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
}

@media (max-width: 900px) {
    .hero h1,
    .auth-hero h1 {
        font-size: 2.1rem !important;
    }

    .table-wrap td::before {
        font-size: 0.64rem !important;
        line-height: 1.2 !important;
    }
}

/* Densidade compacta final para uso confortavel em zoom 100%. */
:root {
    --shadow: 0 12px 34px rgba(16, 42, 67, 0.12);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 10px;
}

body {
    font-size: 13px !important;
}

.shell {
    width: min(1680px, calc(100% - 18px)) !important;
    padding-top: 8px !important;
    padding-bottom: 20px !important;
}

.hero {
    border-radius: 18px !important;
}

.hero-grid {
    gap: 12px !important;
    padding: 16px !important;
}

.hero h1,
.auth-hero h1 {
    margin: 16px 0 8px !important;
    font-size: 2.25rem !important;
    line-height: 1.02 !important;
}

.hero-copy,
.auth-hero p {
    font-size: 0.82rem !important;
    line-height: 1.38 !important;
}

.hero-meta {
    gap: 6px !important;
    margin-top: 14px !important;
}

.brand {
    gap: 8px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
}

.brand img {
    width: 104px !important;
    max-height: 28px !important;
}

.brand span {
    font-size: 0.66rem !important;
}

.hero-panel {
    padding: 14px !important;
    border-radius: 14px !important;
}

.mini-metrics {
    gap: 8px !important;
    margin-top: 10px !important;
}

.mini-metric,
.kpi,
.summary-item {
    min-height: 0 !important;
    padding: 10px !important;
    border-radius: 12px !important;
}

.mini-metric strong,
.summary-item strong {
    margin-top: 4px !important;
    font-size: 0.96rem !important;
}

.kpi strong {
    font-size: 1.2rem !important;
}

.toolbar {
    top: 6px !important;
    gap: 8px !important;
    margin: -12px 8px 14px !important;
    padding: 8px !important;
    border-radius: 14px !important;
}

.toolbar-title {
    gap: 8px !important;
}

.toolbar-title strong {
    font-size: 0.78rem !important;
    line-height: 1.15 !important;
}

.toolbar-title span {
    font-size: 0.68rem !important;
    line-height: 1.2 !important;
}

.status-dot {
    width: 9px !important;
    height: 9px !important;
    box-shadow: 0 0 0 4px rgba(215, 167, 72, 0.16) !important;
}

.status-dot.ok {
    box-shadow: 0 0 0 4px rgba(36, 124, 82, 0.14) !important;
}

.status-dot.fail {
    box-shadow: 0 0 0 4px rgba(181, 71, 71, 0.12) !important;
}

.actions,
.filter-actions,
.pagination-actions {
    gap: 6px !important;
}

.button,
button.button,
.tab-button,
.pagination-button,
.auth-form .button,
.filter-actions .button,
.import-action-bar .button,
.button.procedure-action,
.button.lookup-action {
    min-height: 32px !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    font-size: 0.68rem !important;
    line-height: 1.12 !important;
    box-shadow: none !important;
}

.button.compact {
    min-height: 28px !important;
    padding: 5px 8px !important;
    font-size: 0.64rem !important;
}

.layout {
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr) !important;
    gap: 14px !important;
}

.content,
.list-page {
    gap: 12px !important;
}

.card {
    border-radius: 14px !important;
    box-shadow: 0 8px 22px rgba(16, 42, 67, 0.08) !important;
}

.panel-pad,
.filters,
.auth-form,
.confirm-modal-card,
.module-tile {
    padding: 14px !important;
}

.filters {
    top: 72px !important;
}

.section-head {
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.section-head h2,
.section-title,
.module-tile h2 {
    font-size: 1.05rem !important;
    line-height: 1.08 !important;
}

.section-head p,
.note,
.message,
.field small,
.kpi small,
.mini-metric span,
.summary-item span,
.table-count,
.pagination-size,
.pagination-status {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
}

.filter-grid {
    gap: 10px !important;
}

.field {
    gap: 4px !important;
}

.field label,
.eyebrow,
.module-link {
    font-size: 0.62rem !important;
    line-height: 1.16 !important;
}

.field input,
.field select,
.field textarea,
input,
select,
textarea {
    min-height: 36px !important;
    padding: 7px 10px !important;
    border-radius: 9px !important;
    font-size: 0.74rem !important;
    line-height: 1.18 !important;
}

.field select {
    padding-right: 32px !important;
    background-position:
        calc(100% - 18px) center,
        calc(100% - 13px) center !important;
}

.field textarea,
textarea {
    min-height: 86px !important;
}

.split {
    gap: 8px !important;
}

.note,
.message,
.check-line {
    padding: 10px !important;
    border-radius: 10px !important;
}

.check-line {
    gap: 8px !important;
}

.check-line input,
.row-check input,
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 16px !important;
    height: 16px !important;
    min-height: unset !important;
    padding: 0 !important;
    border-radius: 3px !important;
    background: none !important;
    font-size: inherit !important;
    line-height: normal !important;
    cursor: pointer;
}

.hero-chip,
.soft-chip,
.badge,
.source-pill,
.audit-action {
    min-height: 22px !important;
    padding: 4px 7px !important;
    border-radius: 8px !important;
    font-size: 0.58rem !important;
    line-height: 1.1 !important;
}

.module-tile {
    gap: 10px !important;
    min-height: 150px !important;
}

.module-icon {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    font-size: 0.78rem !important;
}

.menu-grid,
.summary-strip,
.kpis {
    gap: 10px !important;
}

.summary-strip {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)) !important;
}

.table-wrap {
    border-radius: 10px !important;
}

.table-wrap table {
    min-width: max(100%, 760px) !important;
}

.table-wrap.wide table {
    min-width: max(100%, 1040px) !important;
}

.table-wrap th,
.table-wrap td {
    padding: 7px 8px !important;
}

.table-wrap th {
    font-size: 0.54rem !important;
    line-height: 1.08 !important;
}

.table-wrap td {
    font-size: 0.68rem !important;
    line-height: 1.18 !important;
}

.detail-cell,
.snippet,
.snippet-text,
.audit-text {
    font-size: 0.68rem !important;
    line-height: 1.28 !important;
}

.table-pagination {
    gap: 8px !important;
    margin-top: 8px !important;
    padding: 8px !important;
    border-radius: 10px !important;
}

.pagination-select {
    min-height: 30px !important;
    min-width: 76px !important;
    padding: 5px 22px 5px 8px !important;
    font-size: 0.68rem !important;
}

.pagination-status {
    min-width: 70px !important;
}

.auth-shell {
    padding: 10px !important;
}

.auth-panel {
    width: min(100%, 980px) !important;
    border-radius: 18px !important;
}

.auth-hero {
    min-height: 420px !important;
    padding: 20px !important;
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: 1fr !important;
    }

    .filters {
        position: static !important;
    }
}

@media (max-width: 900px) {
    .shell {
        width: min(100% - 10px, 1680px) !important;
    }

    .hero h1,
    .auth-hero h1 {
        font-size: 1.75rem !important;
    }

    .toolbar {
        margin: 8px 0 12px !important;
    }

    .table-wrap td {
        padding: 8px !important;
        font-size: 0.72rem !important;
    }

    .table-wrap td::before {
        font-size: 0.58rem !important;
    }
}

.auth-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.auth-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
}

video.auth-hero-bg {
    aspect-ratio: auto;
    background: #102a43;
}

.auth-hero-has-media {
    background: #102a43;
}

.auth-hero-has-media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(10, 32, 50, 0.92) 0%, rgba(16, 58, 76, 0.74) 52%, rgba(16, 42, 67, 0.32) 100%);
}

.auth-hero-has-media.auth-hero-overlay-light::before {
    background: linear-gradient(115deg, rgba(10, 32, 50, 0.72) 0%, rgba(16, 58, 76, 0.48) 56%, rgba(16, 42, 67, 0.16) 100%);
}

.auth-hero-has-media.auth-hero-overlay-strong::before {
    background: linear-gradient(115deg, rgba(8, 22, 38, 0.97) 0%, rgba(11, 40, 58, 0.86) 56%, rgba(16, 42, 67, 0.48) 100%);
}

.auth-hero-content {
    position: relative;
    z-index: 1;
}

.site-config-form {
    display: grid;
    gap: 14px;
}

.site-config-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.site-config-preview-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.login-media-preview {
    min-height: 220px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(16, 42, 67, 0.08);
}

.login-media-preview img,
.login-media-preview video {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

.login-media-preview video {
    aspect-ratio: auto;
}

.login-media-default {
    display: grid;
    place-content: end start;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 220px;
    padding: 18px;
    color: #fff;
    background:
        linear-gradient(115deg, rgba(10, 32, 50, 0.95) 0%, rgba(16, 58, 76, 0.78) 56%, rgba(16, 42, 67, 0.28) 100%),
        url("mantevida-hospital-l2-norte.jpeg") center / cover no-repeat;
}

.login-media-default span {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.82;
}

.login-media-default strong {
    font-size: 1.35rem;
    line-height: 1;
}

.check-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.check-row input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--aqua);
}

.site-config-actions {
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .site-config-preview-grid {
        grid-template-columns: 1fr;
    }

    .login-media-preview,
    .login-media-default {
        min-height: 180px;
    }
}

/* ── info-tip: botao de instrucoes de uso ─────────────────────────────── */
.info-tip {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    margin-left: 6px;
}
.info-tip-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(28, 143, 138, .1);
    color: var(--aqua);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    border: 1.5px solid var(--aqua);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    transition: background .15s;
}
.info-tip-btn:hover,
.info-tip-btn:focus {
    background: rgba(28, 143, 138, .22);
    outline: none;
}
.info-tip-content {
    display: none !important;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--navy-2);
    color: #fff;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.55;
    padding: 10px 14px;
    border-radius: 10px;
    width: 290px;
    max-width: min(290px, calc(100vw - 32px));
    z-index: 300;
    white-space: normal;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
    pointer-events: none;
    text-align: left;
}
[hidden].info-tip-content {
    display: none !important;
}

/* ── UX improvements ──────────────────────────────────────────────────── */

/* Messages — left-border accent for instant type recognition */
.message.error   { border-left: 4px solid #c0392b; }
.message.info    { border-left: 4px solid var(--aqua); }
.message.ok      { border-left: 4px solid #247c52; }
.message.warning { border-left: 4px solid #c88c00; }

/* Forms — better placeholder contrast */
.field input::placeholder {
    color: rgba(96, 112, 132, 0.88);
}

/* Forms — inline validation error state */
.field.error input,
.field.error select,
.field.error textarea {
    border-color: rgba(192, 57, 43, 0.55);
    background: #fff8f7;
    box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.08);
}
.field .field-error {
    color: #9b2335;
    font-size: 0.76rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Tables — more visible row hover */
tr:hover td {
    background: rgba(28, 143, 138, 0.08) !important;
}

/* Tables — subtle alternating rows */
tbody tr:nth-child(even) td {
    background: rgba(247, 250, 249, 0.65);
}

/* Tables — better empty state */
.empty {
    padding: 52px 34px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Buttons — disabled and loading states */
.button:disabled,
button.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
    pointer-events: none;
}
.button.loading,
button.button.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
    transform: none !important;
}

/* Module tiles — keyboard focus ring */
.module-tile:focus-visible {
    outline: 3px solid var(--aqua);
    outline-offset: 3px;
}

/* Forms — submit button area spacing */
.filter-actions {
    margin-top: 8px;
}
