:root {
    --casdata-blue: #123b73;
    --casdata-blue-deep: #0b2850;
    --casdata-orange: #f47b20;
    --ink: #172b4d;
    --muted: #6b7a90;
    --line: #e4eaf2;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --shadow-sm: 0 6px 18px rgba(17, 45, 82, 0.06);
    --shadow-md: 0 16px 40px rgba(17, 45, 82, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--surface-soft);
}

body {
    background: var(--surface-soft);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
}

a {
    color: var(--casdata-blue);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    color: var(--ink);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

h2 {
    color: var(--ink);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

code {
    background: #eef3f9;
    border-radius: 0.35rem;
    color: var(--casdata-blue);
    font-size: 0.82em;
    padding: 0.18rem 0.35rem;
}

button,
.button-link {
    align-items: center;
    background: var(--casdata-blue);
    border: 1px solid var(--casdata-blue);
    border-radius: 0.55rem;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 0.45rem;
    justify-content: center;
    padding: 0.68rem 1rem;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover,
.button-link:hover {
    background: var(--casdata-blue-deep);
    border-color: var(--casdata-blue-deep);
    box-shadow: 0 8px 18px rgba(18, 59, 115, 0.2);
    color: white;
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

button.secondary,
.button-link.secondary {
    background: var(--surface);
    border-color: #cbd6e4;
    color: var(--ink);
}

button.secondary:hover,
.button-link.secondary:hover {
    background: #f3f6fa;
    border-color: #9fb3ca;
    color: var(--ink);
}

button.danger-outline,
.button-link.danger-outline {
    background: var(--surface);
    border-color: #e6aaa5;
    color: #b42318;
}

button.danger-outline:hover,
.button-link.danger-outline:hover {
    background: #fff0f0;
    border-color: #d92d20;
    color: #8f1c14;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    background: linear-gradient(180deg, var(--casdata-blue-deep) 0%, #12396b 100%);
    color: #dce8f7;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    padding: 1.6rem 1rem 1rem;
    position: fixed;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 180ms ease, padding 180ms ease;
    width: 248px;
    z-index: 10;
}

.app-sidebar::-webkit-scrollbar {
    width: 0.4rem;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(220, 232, 247, 0.35);
    border-radius: 999px;
}

.sidebar-header {
    display: grid;
    gap: 0.85rem;
}

.brand {
    align-items: center;
    background: #ffffff;
    display: flex;
    height: 5.7rem;
    min-height: 5.7rem;
    overflow: hidden;
    padding: 0.1rem 0.55rem 1rem;
    border-radius: 0.75rem;
}

.brand img {
    height: 100%;
    max-height: none;
    object-fit: contain;
    width: 100%;
}

.sidebar-toggle {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #dce8f7;
    justify-content: flex-start;
    padding: 0.55rem 0.7rem;
    width: 100%;
}

.sidebar-toggle-icon {
    align-items: center;
    display: inline-flex;
    font-size: 1.45rem;
    height: 1.2rem;
    justify-content: center;
    line-height: 1;
    width: 1.15rem;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-toggle-label {
    font-size: 0.78rem;
    font-weight: 700;
}

.sidebar-caption,
.topbar-kicker,
.eyebrow {
    color: #8ca5c4;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.sidebar-caption {
    border-top: 1px solid rgba(220, 232, 247, 0.14);
    padding: 1.4rem 0.7rem 0.7rem;
}

.app-nav {
    display: grid;
    gap: 0.25rem;
}

.app-nav a,
.app-nav .link-button,
.login-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    color: #c8d7ea;
    display: flex;
    font-size: 0.9rem;
    gap: 0.7rem;
    padding: 0.65rem 0.7rem;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.app-nav a:hover,
.app-nav .link-button:hover,
.login-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: none;
}

.nav-icon {
    align-items: center;
    color: #9db9dc;
    display: inline-flex;
    font-size: 1.05rem;
    justify-content: center;
    min-width: 1.15rem;
}

.nav-divider {
    border-top: 1px solid rgba(220, 232, 247, 0.13);
    margin: 0.75rem 0.7rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(220, 232, 247, 0.14);
    display: grid;
    gap: 0.8rem;
    margin-top: auto;
    padding: 1rem 0.35rem 0;
}

.sidebar-footer form {
    display: block;
}

.environment-badge,
.topbar-status {
    align-items: center;
    color: #a9bdd6;
    display: inline-flex;
    font-size: 0.72rem;
    gap: 0.45rem;
}

.environment-badge span,
.topbar-status span {
    background: #5ed39b;
    border-radius: 50%;
    height: 0.45rem;
    width: 0.45rem;
}

.app-main {
    margin-left: 248px;
    min-width: 0;
    transition: margin-left 180ms ease, width 180ms ease;
    width: calc(100% - 248px);
}

.menu-recolhido .app-sidebar {
    width: 84px;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
}

.menu-recolhido .app-main {
    margin-left: 84px;
    width: calc(100% - 84px);
}

.menu-recolhido .brand {
    justify-content: center;
    height: 3.8rem;
    min-height: 3.8rem;
    padding-left: 0;
    padding-right: 0;
}

.menu-recolhido .brand img {
    height: 2.6rem;
    max-height: 2.6rem;
    object-fit: cover;
    object-position: left center;
    width: 2.6rem;
}

.menu-recolhido .sidebar-caption,
.menu-recolhido .sidebar-footer,
.menu-recolhido .app-nav a > span:not(.nav-icon),
.menu-recolhido .sidebar-toggle-label,
.menu-recolhido .login-link {
    display: none;
}

.menu-recolhido .sidebar-toggle,
.menu-recolhido .app-nav a {
    justify-content: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

.app-topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 4.8rem;
    padding: 0.85rem clamp(1.25rem, 4vw, 3.5rem);
}

.app-topbar strong {
    color: var(--ink);
    display: block;
    font-size: 1.05rem;
    margin-top: 0.2rem;
}

.topbar-kicker {
    color: var(--casdata-orange);
    font-size: 0.61rem;
}

.topbar-status {
    color: var(--muted);
}

.app-content {
    margin: 0 auto;
    max-width: 1440px;
    padding: clamp(1.5rem, 4vw, 3.25rem);
}

.page-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-heading > div:first-child {
    min-width: 0;
}

.page-heading h1,
.page-heading p {
    overflow-wrap: normal;
    word-break: normal;
}

.page-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.page-heading h1 {
    margin-bottom: 0.55rem;
}

.page-heading p,
.info-message {
    color: var(--muted);
    margin-bottom: 0;
}

.hero-panel {
    align-items: center;
    background: radial-gradient(circle at 90% 10%, rgba(244, 123, 32, 0.18), transparent 30%), linear-gradient(120deg, #0d315e, #164a86);
    border-radius: 1.2rem;
    box-shadow: var(--shadow-md);
    color: white;
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    min-height: 280px;
    overflow: hidden;
    padding: clamp(1.75rem, 5vw, 4rem);
    position: relative;
}

.hero-copy {
    max-width: 650px;
    position: relative;
    z-index: 1;
}

.hero-copy h1 {
    color: white;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    max-width: 620px;
    margin: 0.7rem 0 1rem;
}

.hero-copy p {
    color: #c9dbef;
    font-size: 1.05rem;
    margin-bottom: 1.7rem;
}

.hero-panel .eyebrow {
    color: #f5a365;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.button-link.ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.hero-mark {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.86);
    display: flex;
    flex-direction: column;
    height: 180px;
    justify-content: center;
    margin-right: 5%;
    transform: rotate(-12deg);
    width: 180px;
}

.hero-mark span {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.1em;
}

.hero-mark strong {
    color: #f5a365;
    font-size: 2rem;
}

.section-heading {
    margin-bottom: 1.2rem;
}

.section-heading h2 {
    margin: 0.45rem 0 0;
}

.navigation-card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.navigation-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.55rem;
    min-height: 180px;
    padding: 1.25rem;
    position: relative;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.navigation-card:hover {
    border-color: #b7cbe4;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.navigation-card .card-icon {
    align-items: center;
    background: #edf4fc;
    border-radius: 0.6rem;
    color: var(--casdata-blue);
    display: inline-flex;
    font-size: 1.3rem;
    height: 2.4rem;
    justify-content: center;
    width: 2.4rem;
}

.navigation-card strong {
    color: var(--ink);
    font-size: 1rem;
}

.navigation-card > span:not(.card-icon) {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.navigation-card b {
    bottom: 1.2rem;
    color: var(--casdata-orange);
    position: absolute;
    right: 1.25rem;
}

.form-card,
.success-card,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.85rem;
    max-width: 680px;
    padding: 1.5rem;
}

.filter-card {
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.4rem;
    padding: 1rem;
}

.filter-card label {
    color: var(--muted);
    display: grid;
    flex: 1 1 20rem;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.4rem;
}

.form-card h2 {
    margin-bottom: 0.3rem;
}

.empty-state {
    background: var(--surface-soft);
    border: 1px dashed #c7d4e4;
    border-radius: 0.7rem;
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem;
}

.empty-state span {
    color: var(--muted);
    font-size: 0.86rem;
}

.modal-backdrop {
    align-items: center;
    background: rgba(7, 21, 40, 0.66);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1.25rem;
    position: fixed;
    z-index: 80;
}

.modal-dialog {
    animation: modal-enter 180ms ease-out;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 1rem;
    box-shadow: 0 24px 70px rgba(4, 17, 34, 0.35);
    max-height: min(92vh, 860px);
    max-width: 760px;
    overflow: auto;
    width: min(100%, 760px);
}

.modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.35rem 1.5rem 1.1rem;
}

.modal-header h2 {
    margin: 0.35rem 0 0.25rem;
}

.modal-header p {
    color: var(--muted);
    font-size: 0.86rem;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

.modal-close:hover {
    background: #f1f5f9;
    border-color: var(--line);
    box-shadow: none;
    color: var(--ink);
    transform: none;
}

.modal-body {
    padding: 1.35rem 1.5rem 1.5rem;
}

.modal-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-form-grid label {
    color: var(--muted);
    display: grid;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.42rem;
    min-width: 0;
}

.modal-form-grid .field-span-2 {
    grid-column: span 2;
}

.modal-form-grid .error-message {
    margin: 0;
}

.modal-footer {
    border-top: 1px solid var(--line);
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 1.35rem;
    padding-top: 1.1rem;
}

.installation-code-card {
    background: linear-gradient(135deg, #effaf4, #ffffff);
    border: 1px solid #b7e3c9;
    border-radius: 0.9rem;
    padding: 1.2rem;
}

.installation-code-card h2 {
    color: #146c43;
    font-size: 1.35rem;
    margin: 0.4rem 0;
}

.installation-code-card p {
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 1rem;
}

.installation-code {
    background: #12345a;
    border-radius: 0.65rem;
    color: #ffffff;
    display: block;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
    padding: 0.95rem 1rem;
    user-select: all;
}

.installation-code-meta {
    font-size: 0.8rem;
    margin-top: 1rem !important;
}

@keyframes modal-enter {
    from { opacity: 0; transform: translateY(0.8rem) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.form-card label,
.auth-card label {
    color: var(--muted);
    display: grid;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 0.4rem;
}

input,
select,
textarea {
    background: var(--surface);
    border: 1px solid #cbd6e4;
    border-radius: 0.5rem;
    color: var(--ink);
    font: inherit;
    min-height: 2.65rem;
    padding: 0.6rem 0.7rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6e9dcc;
    box-shadow: 0 0 0 3px rgba(61, 126, 190, 0.14);
    outline: none;
}

.data-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-collapse: separate;
    border-radius: 0.8rem;
    border-spacing: 0;
    box-shadow: var(--shadow-sm);
    display: block;
    max-width: 100%;
    overflow-x: auto;
    table-layout: fixed;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 1rem;
    text-align: left;
    overflow-wrap: normal;
    vertical-align: top;
    white-space: normal;
}

.data-table td > select,
.data-table td > input,
.data-table td details,
.data-table td ul {
    max-width: 100%;
}

.data-table td ul {
    margin: 0.6rem 0 0;
    padding-left: 1.1rem;
}

.data-table td code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.data-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: #fbfdff;
}

.operation-list {
    display: grid;
    gap: 1rem;
}

.operation-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.operation-card-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
}

.operation-card-title {
    min-width: 0;
}

.operation-card-title h3 {
    color: var(--casdata-blue);
    font-size: 1.05rem;
    margin: 0.2rem 0;
}

.operation-card-title p {
    color: var(--muted);
    margin: 0;
    overflow-wrap: anywhere;
}

.operation-card-title code {
    font-size: 0.82rem;
}

.operation-eyebrow {
    color: var(--muted);
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
}

.operation-badges {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.status-badge,
.type-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.34rem 0.65rem;
    white-space: nowrap;
}

.status-badge.sucesso { background: #e9f8ef; color: #087c46; }
.status-badge.erro { background: #feeceb; color: #b42318; }
.status-badge.aviso { background: #fff5dd; color: #986000; }
.status-badge.info { background: #e8f2ff; color: #125ca9; }
.status-badge.neutro { background: #eef2f6; color: #536273; }

.type-badge {
    background: #eef3fa;
    color: var(--casdata-blue);
}

.operation-grid {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.operation-field {
    border-right: 1px solid var(--line);
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.85rem 1.2rem;
}

.operation-field:last-child {
    border-right: 0;
}

.operation-field span,
.operation-destination > span,
.load-metric span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.operation-field strong,
.operation-field code {
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.operation-field code {
    user-select: all;
}

.operation-destination {
    background: #f8fafc;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0.28rem;
    padding: 0.85rem 1.2rem;
}

.operation-destination code {
    color: var(--casdata-blue);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.operation-destination small {
    color: var(--muted);
}

.load-metrics {
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.load-metric {
    border-right: 1px solid var(--line);
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem 1.2rem;
}

.load-metric:last-child {
    border-right: 0;
}

.load-metric strong {
    color: var(--casdata-blue);
    font-size: 1.25rem;
}

.load-metric.sucesso strong { color: #087c46; }
.load-metric.erro strong { color: #b42318; }

.load-operation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operation-detail {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 0.3rem;
    padding: 0.85rem 1.2rem;
}

.operation-detail strong {
    font-size: 0.78rem;
}

.operation-detail span {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.operation-detail.erro { background: #fff4f3; color: #9f2118; }
.operation-detail.aviso { background: #fff9ea; color: #805400; }
.operation-detail.sucesso { background: #effaf4; color: #146c43; }
.operation-detail.info { background: #f0f6ff; color: #164f88; }
.operation-detail.neutro { background: #f8fafc; color: var(--ink); }

.operation-card-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
    padding: 0.85rem 1.2rem;
}

.collector-operation-grid,
.schedule-operation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operation-source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.operation-source-list code {
    background: #eaf1f8;
    border-radius: 0.4rem;
    color: var(--casdata-blue);
    overflow-wrap: anywhere;
    padding: 0.3rem 0.45rem;
}

.schedule-history-list {
    display: grid;
    gap: 0.75rem;
}

.schedule-history-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(12rem, 1fr) auto minmax(15rem, 2fr);
    padding: 0.9rem 1rem;
}

.schedule-history-card > div {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.schedule-history-card > div span,
.schedule-history-card > div small {
    color: var(--muted);
    font-size: 0.74rem;
}

.schedule-history-card p {
    margin: 0;
    overflow-wrap: anywhere;
}

.danger-button {
    background: #b42318;
}

.danger-button:hover {
    background: #8f1c14;
}

.actions {
    display: flex;
    gap: 0.55rem;
}

.actions a {
    align-items: center;
    display: inline-flex;
    font-weight: 700;
    text-decoration: none;
}

.credential-list {
    display: grid;
    gap: 1rem;
}

.credential-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.credential-card-heading {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-bottom: 0.9rem;
}

.credential-card h3 {
    color: var(--ink);
    font-size: 1.05rem;
    margin: 0.25rem 0 0;
}

.credential-status {
    background: #e8f8ef;
    border-radius: 999px;
    color: #137a45;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
}

.credential-status.revogada {
    background: #fff0f0;
    color: #b42318;
}

.credential-details {
    display: grid;
    gap: 0.9rem 1.2rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credential-details div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.credential-details span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.credential-details code,
.credential-details strong {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.credential-actions {
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 1rem;
}

.credential-actions button {
    min-width: 9rem;
}

.credential-once-card {
    max-width: none;
    width: 100%;
}

.credential-once-grid {
    display: grid;
    gap: 0.9rem 1.2rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credential-once-grid div,
.credential-password {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}

.credential-once-grid span,
.credential-password > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.credential-once-grid code,
.credential-once-grid strong {
    overflow-wrap: anywhere;
}

.catalogo-toolbar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.catalogo-toolbar label {
    color: var(--muted);
    display: grid;
    font-size: 0.8rem;
    font-weight: 800;
    gap: 0.4rem;
}

.catalogo-toolbar-panel {
    background: linear-gradient(135deg, #f8fbff, #eef5fc);
    border: 1px solid #d9e6f3;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.2rem;
    padding: 1rem;
}

.catalog-version-field {
    flex: 1 1 22rem;
}

.catalog-search-field {
    flex: 1 1 18rem;
}

.catalog-filter-result {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 2.55rem;
    padding: 0 0.25rem;
    white-space: nowrap;
}

.catalogo-summary-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: minmax(17rem, 1.6fr) repeat(3, minmax(10rem, 1fr));
    margin-bottom: 1.25rem;
}

.catalogo-summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem 1.1rem;
}

.catalogo-summary-feature {
    background: linear-gradient(135deg, #eef6ff, #ffffff);
    border-color: #cbdff4;
}

.catalogo-summary-card strong {
    color: var(--casdata-blue);
    font-size: 1.22rem;
    overflow-wrap: anywhere;
}

.catalogo-summary-card small {
    color: var(--muted);
    font-size: 0.78rem;
}

.summary-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.catalog-status {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.45rem;
}

.catalog-status span {
    background: #1d9b61;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #e4f7ed;
    height: 0.45rem;
    width: 0.45rem;
}

.catalog-table-shell {
    min-width: 0;
    overflow-x: visible;
    padding-bottom: 0.15rem;
}

.catalog-table {
    display: table;
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.catalog-table th,
.catalog-table td {
    padding: 1rem 0.85rem;
    min-width: 0;
}

.catalog-table th:first-child,
.catalog-table td:first-child {
    text-align: center;
    width: 5.8rem;
}

.catalog-table-name {
    color: var(--ink);
    display: block;
    font-size: 0.95rem;
    max-width: 14rem;
    overflow-wrap: anywhere;
}

.catalog-schema {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.82rem;
}

.catalog-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.3rem 0.55rem;
}

.catalog-badge.is-positive {
    background: #e7f8ef;
    color: #137044;
}

.catalog-badge.is-muted {
    background: #f1f4f8;
    color: #64748b;
}

.strategy-editor {
    display: grid;
    gap: 0.65rem;
    min-width: 20rem;
}

.strategy-detail-row td {
    background: #f8fbff;
    border-bottom: 1px solid #dfeaf5;
    padding: 0.7rem 0.65rem 0.9rem;
}

.strategy-editor-inline {
    align-items: end;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: minmax(7rem, 10rem) minmax(7rem, 10rem) minmax(6rem, 8rem) minmax(8rem, 11rem) 8.5rem;
    justify-content: space-between;
    min-width: 0;
    width: 100%;
}

.strategy-editor-inline .strategy-options {
    display: contents;
    min-width: 0;
}

.strategy-editor-inline .strategy-type-field {
    display: grid;
    grid-column: 4;
    gap: 0.3rem;
    min-width: 0;
}

.strategy-editor-inline .strategy-actions {
    grid-column: 5;
    min-width: 0;
    white-space: nowrap;
}

.strategy-options.is-empty {
    display: none;
}

.strategy-editor-inline.is-complete {
    grid-template-columns: minmax(0, 1fr) 8.5rem;
}

.strategy-editor-inline.is-complete .strategy-type-field {
    grid-column: 1;
}

.strategy-editor-inline.is-complete .strategy-actions {
    grid-column: 2;
}

.strategy-current-badge {
    background: #edf4fb;
    border-radius: 999px;
    color: var(--casdata-blue);
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 0.35rem 0.55rem;
}

.strategy-select,
.strategy-options label {
    color: var(--muted);
    display: grid;
    font-size: 0.72rem;
    font-weight: 800;
    gap: 0.35rem;
}

.strategy-options {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strategy-options input,
.strategy-options select,
.strategy-select select {
    min-width: 0;
    width: 100%;
}

.strategy-hint {
    color: #8a5b00;
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
}

.strategy-actions {
    display: flex;
    justify-content: flex-start;
}

.strategy-actions button {
    box-sizing: border-box;
    font-size: 0.66rem;
    padding: 0.52rem 0.45rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.columns-modal-summary {
    align-items: center;
    background: linear-gradient(135deg, #eef6ff, #ffffff);
    border: 1px solid #d5e5f5;
    border-radius: 0.8rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.9rem 1rem;
}

.columns-modal-summary div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.columns-modal-summary strong {
    color: var(--casdata-blue);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}

.columns-modal-list {
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    margin-top: 1rem;
    max-height: 48vh;
    overflow: auto;
}

.column-modal-item {
    align-items: center;
    border-bottom: 1px solid #edf1f6;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    padding: 0.8rem 0.9rem;
}

.column-modal-item:last-child {
    border-bottom: 0;
}

.column-order {
    align-items: center;
    background: #edf4fb;
    border-radius: 50%;
    color: var(--casdata-blue);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    height: 1.65rem;
    justify-content: center;
    width: 1.65rem;
}

.column-modal-name {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.column-modal-name code {
    color: var(--ink);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.column-modal-name span {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.column-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-end;
}

.column-badge {
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 900;
    padding: 0.28rem 0.45rem;
}

.column-badge-primary {
    background: #fff1d6;
    color: #9a5b00;
}

.column-badge-foreign {
    background: #eee9ff;
    color: #6246a8;
}

.columns-modal-note {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
    margin: 0.9rem 0 0;
}

.column-view-button {
    align-items: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--casdata-blue);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.4rem;
    padding: 0.25rem 0;
    white-space: nowrap;
}

.column-view-button:hover {
    background: transparent;
    box-shadow: none;
    color: var(--casdata-orange);
    transform: none;
}

.column-view-icon {
    font-size: 0.9rem;
}

.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.3rem;
    padding: 1.1rem;
}

.summary-card strong {
    color: var(--casdata-blue);
    font-size: 1.6rem;
    letter-spacing: -0.04em;
}

.summary-card span,
.form-card small {
    color: var(--muted);
    font-size: 0.8rem;
}

.coletor-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.42rem;
    padding: 0.32rem 0.62rem;
    white-space: nowrap;
}

.coletor-status i {
    background: currentColor;
    border-radius: 50%;
    height: 0.42rem;
    width: 0.42rem;
}

.coletor-status.ativo { background: #e9f8ef; color: #087c46; }
.coletor-status.ocupado { background: #e8f2ff; color: #125ca9; }
.coletor-status.pausado,
.coletor-status.degradado { background: #fff5dd; color: #9a6200; }
.coletor-status.offline,
.coletor-status.bloqueado,
.coletor-status.inativo { background: #feeceb; color: #c52d27; }

.table-subtext {
    color: var(--muted);
    display: block;
    font-size: 0.74rem;
    font-weight: 500;
    margin-top: 0.2rem;
}

.source-code {
    display: block;
    margin: 0.18rem 0;
    white-space: nowrap;
}

.resultado-agendamento {
    border-radius: 0.5rem;
    display: grid;
    font-size: 0.8rem;
    gap: 0.15rem;
    padding: 0.45rem 0.55rem;
}

.resultado-agendamento.compacto {
    display: inline-block;
}

.resultado-agendamento.sucesso,
.alerta-severidade.sucesso,
.alerta-texto.sucesso { background: #eaf8f0; color: #18734b; }

.resultado-agendamento.erro,
.alerta-severidade.erro,
.alerta-texto.erro { background: #fff0f0; color: #b42318; }

.resultado-agendamento.aviso,
.alerta-severidade.aviso,
.alerta-texto.aviso { background: #fff7e5; color: #986000; }

.alerta-severidade {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.28rem 0.55rem;
}

.alerta-texto {
    border-radius: 0.35rem;
    display: inline-block;
    padding: 0.22rem 0.35rem;
}

.success-message,
.error-message,
.info-message {
    border-radius: 0.55rem;
    margin: 1rem 0;
    padding: 0.75rem 0.9rem;
}

.toast-host {
    bottom: 1.4rem;
    display: grid;
    justify-items: end;
    left: 1.4rem;
    pointer-events: none;
    position: fixed;
    right: 1.4rem;
    z-index: 100;
}

.toast {
    align-items: flex-start;
    animation: toast-enter 220ms ease-out;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid;
    border-radius: 0.75rem;
    box-shadow: 0 18px 42px rgba(15, 38, 68, 0.2);
    display: flex;
    gap: 0.75rem;
    max-width: min(34rem, 100%);
    min-width: min(24rem, 100%);
    padding: 0.9rem 0.85rem;
    pointer-events: auto;
}

.toast-sucesso {
    border-left-color: #1d9b61;
}

.toast-erro {
    border-left-color: #d92d20;
}

.toast-mark {
    align-items: center;
    background: #eaf8f0;
    border-radius: 50%;
    color: #18734b;
    display: inline-flex;
    flex: 0 0 1.7rem;
    font-weight: 900;
    height: 1.7rem;
    justify-content: center;
    width: 1.7rem;
}

.toast-erro .toast-mark {
    background: #fff0f0;
    color: #b42318;
}

.toast-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.toast-copy strong {
    color: var(--ink);
    font-size: 0.88rem;
}

.toast-copy span {
    color: var(--muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.toast-close {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    margin-left: auto;
    padding: 0.1rem 0.25rem;
}

.toast-close:hover {
    background: #f1f5f9;
    box-shadow: none;
    color: var(--ink);
    transform: none;
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(0.65rem); }
    to { opacity: 1; transform: translateY(0); }
}

.success-message {
    background: #eaf8f0;
    color: #18734b;
}

.error-message {
    background: #fff0f0;
    color: #b42318;
}

.info-message {
    background: #edf5fd;
    color: #516983;
}

.auth-page {
    align-items: center;
    background: radial-gradient(circle at 15% 15%, rgba(244, 123, 32, 0.12), transparent 28%), linear-gradient(135deg, #eef5fc, #f8fafc);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    border-radius: 1rem;
    max-width: 430px;
    width: min(100% - 2rem, 430px);
}

.auth-card form {
    display: grid;
    gap: 0.65rem;
}

.auth-card label:not(.checkbox-label) {
    margin-top: 0.25rem;
}

.auth-card label.checkbox-label {
    align-items: center;
    display: flex;
    flex-direction: row;
    font-weight: 600;
    gap: 0.5rem;
    margin: 0.2rem 0;
}

.auth-card label.checkbox-label input {
    flex: 0 0 auto;
    margin: 0;
}

.auth-logo {
    align-self: center;
    height: 5rem;
    object-fit: contain;
    width: 100%;
}

.product-name {
    color: var(--casdata-blue);
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0;
    text-align: center;
}

.checkbox-label {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.checkbox-label input {
    min-height: auto;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid,
.validation-message {
    color: #b42318;
}

.blazor-error-boundary {
    background: #b42318;
    color: white;
    padding: 1rem 1rem 1rem 3.7rem;
}

@media (max-width: 1100px) {
    .navigation-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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

    .catalog-table {
        background: transparent;
        border: 0;
        box-shadow: none;
        display: block;
        min-width: 0;
    }

    .catalog-table thead {
        display: none;
    }

    .catalog-table tbody,
    .catalog-table tr,
    .catalog-table td {
        display: block;
        width: 100%;
    }

    .catalog-table tr {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 0.9rem;
        box-shadow: var(--shadow-sm);
        margin-bottom: 0.9rem;
        overflow: hidden;
    }

    .catalog-table td,
    .catalog-table td:first-child {
        align-items: center;
        border-bottom: 1px solid #edf1f6;
        display: grid;
        gap: 0.75rem;
        grid-template-columns: 8rem minmax(0, 1fr);
        min-height: 3.1rem;
        padding: 0.75rem 0.9rem;
        text-align: left;
        width: 100%;
    }

    .catalog-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .catalog-table td:last-child {
        border-bottom: 0;
    }

    .catalog-table td:first-child input {
        justify-self: start;
    }

    .strategy-editor {
        min-width: 0;
    }

    .strategy-detail-row {
        border-radius: 0 0 0.9rem 0.9rem !important;
        margin-bottom: 0.9rem !important;
    }

    .catalog-main-row {
        border-radius: 0.9rem 0.9rem 0 0 !important;
        margin-bottom: 0 !important;
    }

    .strategy-detail-row td {
        display: block !important;
        padding: 0.9rem !important;
    }

    .strategy-detail-row td::before {
        display: none;
    }

    .strategy-editor-inline {
        align-items: stretch;
        display: grid;
        gap: 0.8rem;
        grid-template-columns: 1fr;
    }

    .strategy-editor-inline .strategy-options,
    .strategy-editor-inline .strategy-type-field,
    .strategy-editor-inline .strategy-actions {
        min-width: 0;
        width: 100%;
    }

    .strategy-editor-inline .strategy-type-field,
    .strategy-editor-inline .strategy-actions,
    .strategy-editor-inline.is-complete .strategy-type-field,
    .strategy-editor-inline.is-complete .strategy-actions {
        grid-column: auto;
    }

    .strategy-options {
        grid-template-columns: 1fr;
    }

    .column-view-button {
        justify-self: start;
    }

    .columns-modal-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .column-modal-item {
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .column-modal-badges {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .catalog-table th,
    .catalog-table td {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .strategy-detail-row td {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .strategy-editor-inline {
        gap: 0.3rem;
        grid-template-columns: minmax(6rem, 8rem) minmax(6rem, 8rem) minmax(5rem, 7rem) minmax(7rem, 9rem) 7.5rem;
    }

    .strategy-editor-inline .strategy-type-field {
        min-width: 7rem;
    }

    .strategy-actions button {
        font-size: 0.61rem;
        padding-left: 0.32rem;
        padding-right: 0.32rem;
    }

    .strategy-editor-inline.is-complete {
        grid-template-columns: minmax(0, 1fr) 7.5rem;
    }
}

@media (max-width: 760px) {
    .app-sidebar {
        height: auto;
        max-height: none;
        min-height: auto;
        overflow: visible;
        padding: 0.8rem;
        position: static;
        width: 100%;
    }

    .app-shell {
        display: block;
    }

    .app-main {
        margin-left: 0;
        width: 100%;
    }

    .menu-recolhido .app-sidebar {
        width: 100%;
    }

    .menu-recolhido .app-main {
        margin-left: 0;
        width: 100%;
    }

    .menu-recolhido .brand img {
        height: auto;
        object-fit: contain;
        width: 100%;
    }

    .brand {
        padding-bottom: 0.8rem;
    }

    .sidebar-caption,
    .sidebar-footer,
    .nav-divider {
        display: none;
    }

    .app-nav {
        display: flex;
        flex-wrap: wrap;
    }

    .app-nav a {
        padding: 0.5rem;
    }

    .sidebar-toggle {
        justify-content: center;
    }

    .sidebar-toggle-label {
        display: inline;
    }

    .menu-recolhido .app-nav a > span:not(.nav-icon),
    .menu-recolhido .sidebar-toggle-label,
    .menu-recolhido .login-link {
        display: inline;
    }

    .app-topbar {
        display: none;
    }

    .app-content {
        padding: 1.25rem;
    }

    .hero-panel {
        min-height: 320px;
    }

    .hero-mark {
        display: none;
    }

    .page-heading {
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions button {
        flex: 1;
    }

    .page-actions .button-link {
        flex: 1;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.7rem 0.55rem;
    }

    .operation-card-header {
        display: grid;
    }

    .operation-badges {
        justify-content: flex-start;
    }

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

    .operation-field:nth-child(2n) {
        border-right: 0;
    }

    .operation-field:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .job-operation-grid .operation-field:last-child {
        border-right: 0;
        grid-column: 1 / -1;
    }

    .load-metrics {
        grid-template-columns: 1fr;
    }

    .load-metric,
    .load-metric:last-child {
        border-bottom: 1px solid var(--line);
        border-right: 0;
    }

    .load-metric:last-child {
        border-bottom: 0;
    }

    .operation-card-actions,
    .operation-card-actions button {
        width: 100%;
    }

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

    .schedule-history-card {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .credential-card-heading {
        flex-direction: column;
    }

    .credential-details {
        grid-template-columns: 1fr;
    }

    .credential-once-grid {
        grid-template-columns: 1fr;
    }

    .filter-card > button,
    .filter-card > .loading-inline {
        width: 100%;
    }

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

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-form-grid .field-span-2 {
        grid-column: auto;
    }

    .modal-header,
    .modal-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .catalogo-summary-grid {
        grid-template-columns: 1fr;
    }

    .catalog-filter-result {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .navigation-card-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .toast-host {
        bottom: 0.8rem;
        left: 0.8rem;
        right: 0.8rem;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}
