:root {
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --bg-color: #f5f7fb;
    --text-color: #102a43;
    --card-bg: #ffffff;
    --card-shadow: rgba(15, 23, 42, 0.08);
    --border-color: #e2e8f0;
    --muted-color: #475569;
    --nav-hover-bg: #e0ecff;
    --nav-hover-color: #1d4ed8;
    --accent-color: #2563eb;
    --accent-strong: #1d4ed8;
    --primary-button-text: #ffffff;
    --secondary-button-border: #94a3b8;
    --header-gradient: linear-gradient(135deg, #2563eb, #1d4ed8);
    --status-active-bg: #dcfce7;
    --status-active-color: #15803d;
    --status-inactive-bg: #fee2e2;
    --status-inactive-color: #b91c1c;
    --feedback-success: #16a34a;
    --feedback-error: #dc2626;
    --login-bg: url('/assets/img/background-login-thema-blue.png');
}

[data-theme='dark'] {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: #1e293b;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --border-color: #334155;
    --muted-color: #cbd5f5;
    --nav-hover-bg: rgba(59, 130, 246, 0.2);
    --nav-hover-color: #93c5fd;
    --accent-color: #38bdf8;
    --accent-strong: #0ea5e9;
    --secondary-button-border: #475569;
    --header-gradient: linear-gradient(135deg, #0f172a, #1e293b);
    --status-active-bg: #166534;
    --status-active-color: #bbf7d0;
    --status-inactive-bg: #7f1d1d;
    --status-inactive-color: #fecaca;
    --feedback-success: #22c55e;
    --feedback-error: #f87171;
    --login-bg: url('/assets/img/background-login-thema-dark.png');
}

[data-theme='redlight'] {
    --bg-color: #fff7f7;
    --text-color: #3c0d0d;
    --card-bg: #ffffff;
    --card-shadow: rgba(190, 24, 93, 0.15);
    --border-color: #fecdd3;
    --muted-color: #9f1239;
    --nav-hover-bg: #ffe4e6;
    --nav-hover-color: #be123c;
    --accent-color: #e11d48;
    --accent-strong: #be123c;
    --secondary-button-border: #fda4af;
    --header-gradient: linear-gradient(135deg, #f43f5e, #be123c);
    --status-active-bg: #fee2e2;
    --status-active-color: #b91c1c;
    --status-inactive-bg: #fef3c7;
    --status-inactive-color: #92400e;
    --feedback-success: #16a34a;
    --feedback-error: #dc2626;
    --login-bg: url('/assets/img/background-login-thema-red.png');
}

[data-theme='greenlight'] {
    --bg-color: #f3faf4;
    --text-color: #0f1f17;
    --card-bg: #ffffff;
    --card-shadow: rgba(15, 118, 78, 0.12);
    --border-color: #c7f0cf;
    --muted-color: #1b4332;
    --nav-hover-bg: #def7e5;
    --nav-hover-color: #15803d;
    --accent-color: #15803d;
    --accent-strong: #0f7a3b;
    --secondary-button-border: #86efac;
    --header-gradient: linear-gradient(135deg, #16a34a, #0f7a3b);
    --status-active-bg: #dcfce7;
    --status-active-color: #166534;
    --status-inactive-bg: #fee2e2;
    --status-inactive-color: #b91c1c;
    --feedback-success: #16a34a;
    --feedback-error: #dc2626;
    --login-bg: url('/assets/img/background-login-thema-green.png');
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

#app {
    min-height: 100vh;
}

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

.chat-float-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1200;
    font-size: 1.5rem;
    overflow: hidden;
}

.chat-float-button img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.chat-float-panel {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    width: min(360px, 90vw);
    height: 80vh;
    max-height: 80vh;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1200;
}

.chat-float-panel header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--accent-color);
    color: #fff;
}

.chat-float-panel header button {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-float-content {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    overflow: hidden;
    gap: 0.75rem;
}

.chat-float-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
    background: var(--bg-color);
}

.chat-message--user {
    align-self: flex-end;
    background: var(--accent-color);
    color: var(--primary-button-text);
}

.chat-message--assistant {
    align-self: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.chat-message--system {
    align-self: center;
    background: rgba(248, 113, 113, 0.15);
    color: #b91c1c;
}

.chat-input-form {
    display: flex;
    gap: 0.5rem;
}

.chat-input-form input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
}

.chat-input-form button {
    border-radius: 999px;
}

.chat-empty-hint {
    text-align: center;
    color: var(--muted-color);
    margin: 0;
}

header {
    background: var(--header-gradient);
    color: #fff;
    padding: 1.5rem 2rem;
}

.automation-studio header,
.chat-float-panel header,
.modal-window header {
    background: var(--header-gradient);
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 15px;
}

.header-main {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.user-menu__avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-menu__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu__trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.user-menu__chevron {
    font-size: 0.8rem;
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.25);
    min-width: 200px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.user-menu__panel button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
}

.user-menu__panel button:hover {
    background: var(--nav-hover-bg);
    color: var(--nav-hover-color);
}

.toast-wrapper {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1100;
    pointer-events: none;
    align-items: flex-end;
}

.toast {
    min-width: 160px;
    padding: 0.45rem 0.75rem;
    border-radius: 14px;
    color: #064e3b;
    font-weight: 600;
    background: rgba(187, 247, 208, 0.35);
    border: 2px solid #047857;
    box-shadow: 0 15px 25px rgba(4, 120, 87, 0.2);
    backdrop-filter: blur(18px);
    line-height: 1.4;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(-10px) translateX(10px);
    animation: toast-pop 0.35s ease forwards;
}

.toast.success {
    background: rgba(187, 247, 208, 0.35);
    border-color: #047857;
    color: #065f46;
}

.toast.warning {
    background: rgba(254, 240, 138, 0.35);
    border-color: #ca8a04;
    color: #713f12;
}

.toast.error {
    background: rgba(254, 202, 202, 0.35);
    border-color: #b91c1c;
    color: #7f1d1d;
}

@keyframes toast-pop {
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.header-brand {
    display: flex;
    align-items: center;
    min-height: 44px;
}

.header-brand__logo {
    display: block;
    height: 112px;
    width: auto;
    max-width: min(240px, 60vw);
    object-fit: contain;
}

.main-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    flex: 1;
    min-height: calc(100vh - 140px);
    transition: grid-template-columns 0.2s ease;
}

.main-container.sidebar-collapsed {
    grid-template-columns: 82px 1fr;
}

.main-container > section {
    min-width: 0;
}

nav {
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
}

.sidebar-toggle-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    margin-bottom: 0.85rem;
}

.sidebar-toggle-button:hover {
    background: var(--nav-hover-bg);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.sidebar-toggle-button i {
    font-size: 1.1rem;
}

nav button {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.95rem;
    border-radius: 8px;
    color: var(--muted-color);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav button.active,
nav button:hover {
    background: var(--nav-hover-bg);
    color: var(--nav-hover-color);
}

nav button span {
    flex: 1;
}

.main-container.sidebar-collapsed nav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.main-container.sidebar-collapsed nav button {
    justify-content: center;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.main-container.sidebar-collapsed nav button span {
    display: none;
}

.nav-button__icon {
    font-size: 1rem;
}

section {
    padding: 2rem;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 2rem 1.4rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted-color);
    font-size: 0.88rem;
    backdrop-filter: blur(10px);
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-top: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.card-subtitle {
    margin: 0.15rem 0 0;
    color: var(--muted-color);
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.35;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 10px 20px var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-card__icon {
    font-size: 1.5rem;
    color: var(--muted-color);
}

.stat-label {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.kanban-dashboard-card .kanban-dashboard-value {
    font-size: 1.5rem;
}

.kanban-dashboard-workspace-table td:last-child,
.kanban-dashboard-workspace-table th:last-child {
    width: 180px;
    text-align: right;
}

.openai-usage-card__value {
    font-size: 1.5rem;
}

.openai-usage-card__chart-shell {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.openai-usage-card__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--muted-color);
    font-size: 0.88rem;
}

.openai-usage-card__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.openai-usage-card__legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.openai-usage-card__legend-dot.tokens {
    background: #2563eb;
}

.openai-usage-card__legend-dot.cost {
    background: #16a34a;
}

.openai-usage-chart {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.75rem 0.75rem 2rem;
    background:
        linear-gradient(180deg, rgba(239, 246, 255, 0.75), rgba(255, 255, 255, 0.95)),
        repeating-linear-gradient(
            to top,
            rgba(148, 163, 184, 0.12) 0,
            rgba(148, 163, 184, 0.12) 1px,
            transparent 1px,
            transparent 44px
        );
}

.openai-usage-chart svg {
    width: 100%;
    height: 220px;
    display: block;
}

.openai-usage-chart__line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.openai-usage-chart__line.tokens {
    stroke: #2563eb;
}

.openai-usage-chart__line.cost {
    stroke: #16a34a;
}

.openai-usage-chart__labels {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.45rem;
    height: 1rem;
}

.openai-usage-chart__labels span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: var(--muted-color);
}

.stat-card--users {
    background: #dbeafe;
    border-color: #93c5fd;
}

.stat-card--users .stat-label,
.stat-card--users .stat-value,
.stat-card--users .stat-card__icon {
    color: #1e3a8a;
}

.stat-card--companies {
    background: #fef3c7;
    border-color: #fbd38d;
}

.stat-card--companies .stat-label,
.stat-card--companies .stat-value,
.stat-card--companies .stat-card__icon {
    color: #92400e;
}

.stat-card--productTypes {
    background: #ede9fe;
    border-color: #c4b5fd;
}

.stat-card--productTypes .stat-label,
.stat-card--productTypes .stat-value,
.stat-card--productTypes .stat-card__icon {
    color: #5b21b6;
}

.stat-card--products {
    background: #ccfbf1;
    border-color: #5eead4;
}

.stat-card--products .stat-label,
.stat-card--products .stat-value,
.stat-card--products .stat-card__icon {
    color: #115e59;
}

.card.success {
    border-left: 4px solid var(--feedback-success);
}

.card.error {
    border-left: 4px solid var(--feedback-error);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.loading-modal {
    background: rgba(15, 23, 42, 0.85);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 35px 55px rgba(15, 23, 42, 0.4);
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.icon-spin {
    animation: spin 0.85s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.grid {
    display: flex;
    /*grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem*/
    flex-direction: column;
    gap: 1.5rem;
}

.companies-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kanban-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-family: var(--font-family);
}

.kanban-subnav {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kanban-subnav button {
    border: 1px solid var(--border-color);
    background: transparent;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted-color);
}

.kanban-subnav button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-button-text);
}

.kanban-subnav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.condicionante-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.condicionante-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-tabs,
.pill-tab-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.pill-tab {
    border: 1px solid var(--border-color);
    background: transparent;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--muted-color);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pill-tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-button-text);
}

.pill-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.condicionante-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.condicionante-filter-grid label {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.condicionante-filter-grid select {
    margin-top: 0.35rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.condicionante-filter-grid input {
    margin-top: 0.35rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.condicionante-filter-grid button {
    flex: 0 0 auto;
    align-self: flex-end;
    height: 42px;
}

.condicionante-company-groups {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.condicionante-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.condicionante-form-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (min-width: 960px) {
    .condicionante-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.condicionante-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.condicionante-company-group {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
}

[data-theme='dark'] .condicionante-company-group {
    background: rgba(30, 41, 59, 0.6);
}

.condicionante-company-header h3 {
    margin: 0;
}

.condicionante-license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.condicionante-license-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem;
    background: var(--card-bg);
}

.condicionante-license-card__list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.condicionante-license-card__list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.condicionante-license-card__meta {
    display: flex;
    flex-direction: column;
    text-align: right;
    font-size: 0.85rem;
    color: var(--muted-color);
}

.licenca-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.licenca-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.licenca-tabs__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.licenca-tabs__actions {
    display: flex;
    gap: 0.5rem;
}

.licenca-pane {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checklist-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checklist-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checklist-tabs__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checklist-tabs__actions {
    display: flex;
    gap: 0.5rem;
}

.checklist-pane {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.checklist-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checklist-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
}

.checklist-progress span {
    display: block;
    height: 8px;
    background: var(--accent-color);
    border-radius: 999px;
    flex: 1;
    max-width: 160px;
}

.checklist-progress small {
    color: var(--muted-color);
}

.checklist-total-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.checklist-controls-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.checklist-control-row {
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 0.75rem;
    align-items: center;
    border: 1px dashed var(--border-color);
    padding: 0.75rem;
    border-radius: 12px;
    background: #f0fdf4;
}

.checklist-control-row .full-row {
    grid-column: 1 / -1;
}

.checklist-remove-btn {
    padding: 0.4rem 0.5rem;
    height: 38px;
    width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.checklist-form-card select {
    width: 95%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font: inherit;
    margin: 10px
}

.checklist-form-card input {
    width: 95%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font: inherit;
    margin: 10px
}

.checklist-lists {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checklist-form-card .action-buttons {
    justify-content: flex-start;
    margin: 1rem 0;
}

.checklist-dashboard-card .checklist-tabs__actions {
    align-items: center;
}

.checklist-dashboard-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.checklist-dashboard-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--muted-color);
}

.checklist-dashboard-filters input,
.checklist-dashboard-filters select {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
}

.checklist-controls-actions {
    display: flex;
    justify-content: flex-end;
}

.checklist-form-card .form-grid {
    gap: 1rem;
}

.checklist-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.checklist-overview-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.checklist-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.checklist-filter-grid label,
.checklist-filter-grid fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--muted-color);
    border: none;
}

.checklist-filter-grid input,
.checklist-filter-grid select {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
}

.checklist-finalizacao {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    gap: 0.35rem;
}

.checklist-finalizacao legend {
    padding: 0;
    margin-bottom: 0.25rem;
    color: var(--muted-color);
}

.checklist-finalizacao label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-color);
    cursor: pointer;
}

.checklist-finalizacao input[type="radio"] {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    accent-color: var(--accent-color);
}

.checklist-filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.automation-screen {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: visible;
}

.automation-card {
    overflow: visible;
}

.automation-flow-host {
    height: auto;
    min-height: 0;
    margin-top: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    overflow: visible;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.automation-studio {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
    box-sizing: border-box;
    overflow: visible;
}

.automation-studio.is-expanded {
    position: fixed;
    inset: 0;
    z-index: 1200;
    height: 100vh;
    background:
        linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(235, 244, 255, 0.98)),
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 22%);
    padding: 1rem 1.25rem;
    box-sizing: border-box;
    overflow: auto;
}

body.automation-expanded-open {
    overflow: hidden;
}

.automation-studio__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.automation-studio__header-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.automation-tabs {
    margin-bottom: 0.85rem;
}

.automation-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    min-width: min(840px, 100%);
}

.automation-meta-grid label,
.automation-list-toolbar,
.automation-top-actions,
.automation-side__header,
.automation-list-card__footer {
    display: flex;
}

.automation-meta-grid label {
    flex-direction: column;
    gap: 0.32rem;
}

.automation-meta-grid label span {
    font-weight: 600;
    color: #334155;
}

.automation-meta-grid label.full-width {
    grid-column: 1 / -1;
}

.automation-meta-grid input,
.automation-meta-grid select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem;
    font-size: 1rem;
    margin-top: 0.35rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.automation-top-actions {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.automation-editor-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 0.9rem;
    height: min(78vh, 980px);
    min-height: 760px;
    align-items: stretch;
}

.automation-editor-layout.catalog-collapsed {
    grid-template-columns: 88px minmax(0, 1fr);
}

.automation-side {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
    height: 100%;
    padding: 0.95rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(12px);
    overflow: auto;
}

.automation-side__header {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.automation-side__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.automation-selection-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.7), rgba(239, 246, 255, 0.95));
}

.automation-selection-indicator strong {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.automation-selection-indicator span {
    font-size: 0.88rem;
    line-height: 1.4;
    color: #334155;
}

.automation-component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.automation-component-grid.is-collapsed {
    grid-template-columns: 1fr;
}

.automation-component-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.automation-component-grid.is-collapsed .automation-component-tile {
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 0.75rem 0.45rem;
    border-radius: 16px;
}

.automation-component-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.automation-component-tile:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.automation-component-tile i {
    font-size: 1.35rem;
}

.automation-component-tile span {
    color: var(--muted-color);
    font-size: 0.84rem;
    line-height: 1.4;
}

.automation-component-tile.tone-success,
.automation-node-card.tone-success,
.automation-node-agent.tone-success {
    background: linear-gradient(180deg, #dcfce7 0%, #f7fff9 100%);
    color: #166534;
}

.automation-component-tile.tone-primary,
.automation-node-card.tone-primary,
.automation-node-agent.tone-primary {
    background: linear-gradient(180deg, #dbeafe 0%, #f7fbff 100%);
    color: #1d4ed8;
}

.automation-component-tile.tone-info,
.automation-node-card.tone-info,
.automation-node-agent.tone-info {
    background: linear-gradient(180deg, #cffafe 0%, #f0fdff 100%);
    color: #0f766e;
}

.automation-component-tile.tone-warning,
.automation-node-card.tone-warning,
.automation-node-agent.tone-warning {
    background: linear-gradient(180deg, #fef3c7 0%, #fffaf0 100%);
    color: #92400e;
}

.automation-component-tile.tone-accent,
.automation-node-card.tone-accent,
.automation-node-agent.tone-accent {
    background: linear-gradient(180deg, #ede9fe 0%, #faf9ff 100%);
    color: #6d28d9;
}

.automation-component-tile.tone-danger,
.automation-node-card.tone-danger,
.automation-node-agent.tone-danger {
    background: linear-gradient(180deg, #fee2e2 0%, #fff7f7 100%);
    color: #b91c1c;
}

.automation-component-tile.tone-secondary,
.automation-node-card.tone-secondary,
.automation-node-agent.tone-secondary {
    background: linear-gradient(180deg, #e2e8f0 0%, #f8fafc 100%);
    color: #334155;
}

.automation-component-tile.tone-muted,
.automation-node-card.tone-muted,
.automation-node-agent.tone-muted {
    background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%);
    color: #475569;
}

.automation-component-tile.tone-dark,
.automation-node-card.tone-dark,
.automation-node-agent.tone-dark {
    background: linear-gradient(180deg, #e5e7eb 0%, #ffffff 100%);
    color: #111827;
}

.automation-canvas {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.automation-canvas__surface {
    flex: 1;
    min-height: 0;
    height: 100%;
    border-radius: 24px;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 249, 0.95)),
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.09), transparent 26%);
}

.automation-studio.is-expanded .automation-canvas__surface {
    height: 100%;
    min-height: 0;
}

.automation-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.automation-token-chip {
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    padding: 0.32rem 0.7rem;
    font-size: 0.82rem;
    cursor: pointer;
}

.automation-token-chip.ghost,
.automation-token-chip.static {
    cursor: default;
    background: #f8fafc;
    color: #475569;
    border-color: rgba(148, 163, 184, 0.18);
}

.automation-flow-app {
    width: 100%;
    height: 100%;
}

.automation-node-card,
.automation-node-agent {
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.07);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.automation-node-card.is-selected,
.automation-node-agent.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), 0 22px 34px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.automation-node-selection-badge {
    position: absolute;
    top: -10px;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
    pointer-events: none;
}

.automation-node-status {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.automation-node-status.success {
    color: #15803d;
}

.automation-node-status.error {
    color: #b91c1c;
}

.automation-node-card {
    width: 124px;
    min-height: 124px;
    padding: 0.75rem;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
}

.automation-node-card--ifelse {
    width: 150px;
    min-height: 124px;
    padding-right: 1rem;
    gap: 0.25rem;
}

.automation-node-card--end {
    width: 136px;
    min-height: 118px;
    justify-content: center;
}

.automation-node-card__icon,
.automation-node-agent__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.automation-node-card strong,
.automation-node-agent strong {
    line-height: 1.2;
}

.automation-node-card small,
.automation-node-agent small {
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(15, 23, 42, 0.74);
}

.automation-node-agent {
    width: 250px;
    min-height: 134px;
    padding: 0.85rem 0.95rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.automation-node-agent header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.automation-node-agent__body {
    font-size: 0.8rem;
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 14px;
    padding: 0.7rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    max-height: 92px;
    overflow: hidden;
    white-space: pre-wrap;
}

.automation-handle {
    width: 14px !important;
    height: 14px !important;
    border: 2px solid #fff !important;
    background: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16) !important;
}

.automation-handle--branch {
    right: -8px !important;
}

.automation-handle--true {
    background: #16a34a !important;
}

.automation-handle--false {
    background: #dc2626 !important;
}

.automation-handle--model-input {
    bottom: -8px !important;
    background: #0f766e !important;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18) !important;
}

.react-flow__edge-path,
.react-flow__connection-path {
    stroke-width: 2.6px;
}

.react-flow__edge.automation-edge--model-link .react-flow__edge-path {
    stroke: #0f766e;
    stroke-dasharray: 7 5;
    animation: automationModelEdgeFlow 0.9s linear infinite;
}

.react-flow__edge.automation-edge--model-link .react-flow__edge-text {
    fill: #0f766e;
}

@keyframes automationModelEdgeFlow {
    from {
        stroke-dashoffset: 24;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.automation-node-card__branches {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    margin-top: 0;
}

.automation-node-card__branch {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding-right: 0.5rem;
}

.automation-node-card__branch--true {
    color: #15803d;
}

.automation-node-card__branch--false {
    color: #b91c1c;
}

.automation-flow-minimap {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.automation-context-menu {
    position: fixed;
    z-index: 1400;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
}

.automation-context-menu button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    justify-content: flex-start;
    width: 100%;
}

.automation-list-screen {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.automation-list-toolbar {
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.automation-list-table-shell {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
    overflow: auto;
}

.automation-list-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.automation-list-table th,
.automation-list-table td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: middle;
}

.automation-list-table thead th {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted-color);
    background: rgba(248, 250, 252, 0.95);
}

.automation-list-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.85);
}

.automation-list-table tbody tr:last-child td {
    border-bottom: none;
}

.automation-list-table th.actions,
.automation-list-table td.actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.automation-list-table__name {
    min-width: 240px;
}

.automation-list-table__name strong,
.automation-list-table__name small {
    display: block;
}

.automation-list-table__name small {
    margin-top: 0.2rem;
    color: var(--muted-color);
}

.automation-table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.automation-status-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.68rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.automation-status-chip.draft {
    background: #e2e8f0;
    color: #334155;
}

.automation-status-chip.active {
    background: #dcfce7;
    color: #166534;
}

.automation-status-chip.paused {
    background: #fef3c7;
    color: #92400e;
}

.automation-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.46);
    display: flex;
    align-items: center;
    justify-content: center;
}

.automation-modal-card {
    width: min(1280px, 100%);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.automation-modal-card--fullscreen {
    width: min(1600px, 96vw);
    height: min(92vh, 1100px);
    max-height: min(92vh, 1100px);
}

.automation-modal-card--medium {
    width: min(920px, 94vw);
    max-height: min(82vh, 900px);
}

.automation-test-runner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
}

.automation-test-runner__status,
.automation-test-runner__value {
    font-size: 1.4rem;
}

.automation-test-step-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.automation-test-step {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.92);
}

.automation-test-step.success {
    border-color: rgba(34, 197, 94, 0.28);
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.94), rgba(255, 255, 255, 0.96));
}

.automation-test-step.failed {
    border-color: rgba(248, 113, 113, 0.28);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.94), rgba(255, 255, 255, 0.96));
}

.automation-test-step__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.automation-test-step__header small {
    color: var(--muted-color);
}

.automation-test-step__error {
    margin: 0 0 0.75rem;
    color: #b91c1c;
    font-weight: 600;
}

.automation-modal-card__header,
.automation-modal-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.automation-modal-card__header h3,
.automation-modal-card__header p {
    margin: 0;
}

.automation-modal-card__header p {
    margin-top: 0.25rem;
    color: var(--muted-color);
}

.automation-modal-card__footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: none;
    justify-content: flex-end;
}

.automation-modal-card__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 1.2rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.automation-modal-card__body--single {
    grid-template-columns: 1fr;
}

.automation-modal-card__body--triple {
    grid-template-columns: minmax(280px, 0.9fr) minmax(460px, 1.3fr) minmax(320px, 0.95fr);
    align-items: stretch;
}

.automation-modal-main,
.automation-modal-side,
.automation-modal-pane {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    min-width: 0;
}

.automation-modal-main {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
}

.automation-modal-pane {
    overflow-y: auto;
    overflow-x: hidden;
}

.automation-modal-pane--config {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
}

.automation-modal-card--default {
    width: min(1380px, 96vw);
}

.automation-modal-card__body--default {
    grid-template-columns: minmax(240px, 0.78fr) minmax(520px, 1.55fr) minmax(260px, 0.82fr);
    align-items: stretch;
}

.automation-modal-card__body--default .automation-modal-pane {
    min-height: 0;
}

.automation-modal-pane--config-default {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
}

.automation-modal-card__body--default .automation-config-section {
    flex: 0 0 auto;
    overflow: visible;
}

.automation-config-section {
    padding: 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fbff;
    min-width: 0;
}

.automation-config-section > header,
.automation-modal-card__body > header,
.automation-list-card > header,
.automation-node-agent > header {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.automation-config-section--fill {
    min-height: 100%;
}

.automation-config-section.compact {
    background: #fff;
}

.automation-config-section header {
    margin-bottom: 0.75rem;
}

.automation-config-section__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.automation-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

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

.automation-form-grid.four-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.automation-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.automation-form-grid label span {
    font-weight: 600;
    color: #334155;
}

.automation-field-help {
    margin-top: 0.2rem;
    color: var(--muted-color);
    font-size: 0.82rem;
    line-height: 1.35;
}

.automation-form-grid .full-width {
    grid-column: 1 / -1;
}

.automation-form-grid input:not([type="checkbox"]):not([type="radio"]),
.automation-form-grid select,
.automation-form-grid textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem;
    font-family: inherit;
    font-size: 1rem;
    margin-top: 0.35rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.automation-code-textarea {
    min-height: 180px;
    resize: vertical;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.5;
    white-space: pre-wrap;
}

.automation-code-shell {
    margin-top: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 420px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.automation-code-shell__toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.automation-code-shell__toolbar .ghost {
    color: var(--muted-color);
    border-color: transparent;
    background: transparent;
}

.automation-code-shell__toolbar .ghost:hover {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.05);
}

.automation-code-shell__editor {
    position: relative;
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.automation-code-shell__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 420px;
    padding: 1rem;
    text-align: center;
    color: var(--muted-color);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.automation-code-monaco {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

.automation-code-monaco.is-fullscreen {
    min-height: 100%;
}

.automation-code-editor {
    width: 100%;
    min-height: 180px;
    box-sizing: border-box;
    border: 0;
    padding: 0.85rem 0.9rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
    background: #fff;
    color: var(--text-color);
}

.automation-code-editor:focus {
    outline: none;
}

.automation-code-editor--fallback {
    min-height: 420px;
    resize: none;
}

.automation-code-modal {
    z-index: 2100;
}

.automation-code-modal__card {
    width: min(98vw, 1600px);
    height: min(94vh, 1100px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.automation-code-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    background: #f8fafc;
}

.automation-code-modal__header .ghost {
    color: var(--muted-color);
    border-color: transparent;
    background: transparent;
}

.automation-code-modal__header .ghost:hover {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.05);
}

.automation-code-modal__body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.automation-code-modal__body > * {
    flex: 1;
    min-height: 0;
}

.automation-modal-card--rich-editor {
    width: min(1520px, 98vw);
}

.automation-modal-card__body--rich-editor {
    grid-template-columns: minmax(240px, 0.72fr) minmax(680px, 1.85fr) minmax(260px, 0.78fr);
    align-items: stretch;
}

.automation-modal-pane--config-rich {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
}

.automation-script-config {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.automation-script-config__editor {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.automation-script-config__editor .automation-code-shell {
    margin-top: 0;
}

.automation-script-editor-field {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    flex: 1;
}

.automation-script-editor-field__meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.automation-script-editor-field__meta > span {
    font-weight: 600;
    color: #334155;
}

.automation-script-config button.secondary,
.automation-script-config .checklist-ai-button {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.automation-script-config button.secondary:hover,
.automation-script-config .checklist-ai-button:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.automation-json-editor {
    margin-top: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
    overflow: auto;
}

.automation-json-editor--readonly {
    min-height: 280px;
}

.automation-json-preview {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-color);
}

.automation-json-kv {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.automation-json-kv__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.automation-json-kv__row--toggle {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto auto;
}

.automation-json-kv__row input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem;
    font-size: 0.95rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.automation-json-kv__empty {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.automation-inline-check {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.45rem !important;
    white-space: nowrap;
}

.automation-inline-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

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

.automation-checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
}

.automation-checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.automation-switch-field {
    align-items: center;
    flex-direction: row !important;
    gap: 0.5rem !important;
}

.automation-switch-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.automation-switch-field--card {
    margin-top: 0.65rem;
}

.automation-auth-card {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #eef0f3;
    color: #1f2937;
}

.automation-auth-card strong {
    display: block;
    margin-bottom: 0.35rem;
}

.automation-auth-card p {
    margin: 0;
    color: #475569;
    line-height: 1.45;
}

.automation-endpoint-card {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    background: #f8fafc;
}

.automation-endpoint-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.automation-endpoint-card__row span {
    color: #475569;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
}

.automation-endpoint-card__group + .automation-endpoint-card__group {
    margin-top: 0.9rem;
}

.automation-endpoint-card__group > strong {
    display: block;
    margin-bottom: 0.55rem;
}

.automation-segmented-control {
    display: inline-flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.automation-segmented-control button {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
}

.automation-segmented-control button.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.automation-node-input-summary {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.automation-condition-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.automation-condition-card {
    padding: 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
}

.automation-chip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.automation-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    background: rgba(14, 116, 144, 0.08);
    color: #155e75;
    font-size: 0.86rem;
    font-weight: 600;
}

.automation-condition-combinator {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.automation-condition-combinator span {
    font-weight: 600;
    color: #334155;
}

.automation-condition-combinator select {
    width: 180px;
    max-width: 100%;
}

.automation-condition-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

@media (max-width: 1440px) {
    .automation-meta-grid {
        min-width: 0;
    }

    .automation-editor-layout,
    .automation-editor-layout.catalog-collapsed {
        grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    }

    .automation-modal-card__body--rich-editor {
        grid-template-columns: minmax(220px, 0.7fr) minmax(540px, 1.55fr) minmax(240px, 0.75fr);
    }

    .automation-modal-card__body--default {
        grid-template-columns: minmax(220px, 0.72fr) minmax(420px, 1.4fr) minmax(220px, 0.78fr);
    }
}

@media (max-width: 1080px) {
    .automation-flow-host {
        min-height: 0;
    }

    .automation-studio__header,
    .automation-list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .automation-list-table {
        min-width: 640px;
    }

    .automation-meta-grid,
    .automation-editor-layout,
    .automation-editor-layout.catalog-collapsed,
    .automation-modal-card__body,
    .automation-modal-card__body--rich-editor,
    .automation-modal-card__body--default,
    .automation-modal-card__body--triple,
    .automation-form-grid.two-columns,
    .automation-form-grid.four-columns,
    .automation-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .automation-json-kv__row {
        grid-template-columns: 1fr;
    }

    .automation-editor-layout {
        height: auto;
        min-height: auto;
    }

    .automation-canvas__surface {
        margin-top: 0;
        min-height: 70vh;
        height: 70vh;
    }

    .automation-modal-backdrop {
        padding: 0.75rem;
    }
}

.modal-card.large {
    max-width: 720px;
}

.modal-card.huge {
    max-width: 1024px;
}

.checklist-builder-card select[multiple] {
    min-height: 120px;
}

.checklist-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.choice-card {
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.choice-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.choice-card i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.choice-card button {
    width: auto;
}

.choice-card input[type="file"] {
    display: none;
}

.choice-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.checklist-builder-card .checklist-tabs__actions {
    gap: 0.5rem;
}

.checklist-builder-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.checklist-builder-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checklist-builder-pane .form-grid {
    gap: 0.75rem;
}

.checklist-builder-card label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 500;
    color: var(--muted-color);
}

.checklist-builder-card input,
.checklist-builder-card select,
.checklist-builder-card textarea {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    margin-top: 0;
}

.checklist-builder-card textarea {
    min-height: 110px;
}

.checklist-builder-card .html-editor .ql-container.ql-snow {
    min-height: 150px;
}

.checklist-builder-card .html-editor .ql-editor {
    min-height: 150px;
}

.acompanhamento-item .html-editor .ql-container.ql-snow,
.acompanhamento-item .html-editor .ql-editor {
    min-height: 120px;
}

.checklist-ai-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.checklist-ai-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 500;
    color: var(--muted-color);
}

.checklist-ai-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.checklist-ai-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.checklist-ai-info-toggle {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.checklist-ai-tooltip {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(14, 116, 144, 0.18);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(240, 249, 255, 0.96));
    color: #0f172a;
    font-size: 0.88rem;
    line-height: 1.45;
}

.ai-textarea--loading {
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.2));
    background-size: 240px 100%;
    animation: checklistAiPulse 1.2s linear infinite;
}

@keyframes checklistAiPulse {
    from {
        background-position: -240px 0;
    }
    to {
        background-position: 240px 0;
    }
}

.alert-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.alert-gauge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.upload-area.dashed {
    border: 1px dashed var(--border-color);
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
    color: var(--muted-color);
}

.checklist-builder-card .upload-drop.checklist-upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 108px;
    border-color: var(--border-color);
}

.checklist-builder-card .upload-drop.checklist-upload-drop p {
    margin: 0;
}

.checklist-builder-card .upload-drop.checklist-upload-drop i {
    font-size: 1.1rem;
}

.checklist-upload-list {
    margin-top: 0.75rem;
}

.checklist-upload-list li {
    align-items: center;
}

.checklist-upload-list li button {
    margin-left: auto;
}

.checklist-image-grid {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.checklist-image-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checklist-image-card__preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
}

.checklist-image-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.checklist-image-card__header strong {
    font-size: 0.82rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checklist-image-card__caption {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: var(--muted-color);
}

.checklist-image-card__source {
    font-size: 0.78rem;
    color: var(--muted-color);
}

.controles-avulsos {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controle-avulso {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controle-avulso header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.controle-status-buttons {
    display: flex;
    gap: 0.35rem;
}

.controle-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.acompanhamento-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.acompanhamento-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: end;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
}

.acompanhamento-item button {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .acompanhamento-item {
        grid-template-columns: 1fr;
    }
}

.controle-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.controle-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controle-card__header {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 0.5rem;
    align-items: center;
}

.controle-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.controle-handle {
    cursor: grab;
    color: var(--muted-color);
}

.controle-section {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-hint {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.checklist-secoes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-secao {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.licenca-filter-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.licenca-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.licenca-filter-grid label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.licenca-filter-grid select,
.licenca-filter-grid input {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
    margin-top: 0.35rem;
}

.multi-chip-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.multi-chip-field__control {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.multi-chip-field__control select {
    flex: 1;
}

.multi-chip-field__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.multi-chip-field__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--nav-hover-bg);
    color: var(--text-color);
    font-size: 0.8rem;
}

.multi-chip-field__chip button {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.licenca-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.spacer {
    flex: 1;
}

.chip-button {
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--muted-color);
}

.chip-button.chip--active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(37, 99, 235, 0.1);
}

.chip-button.chip--danger.chip--active {
    border-color: #dc2626;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.15);
}

.chip-button.chip--warning.chip--active {
    border-color: #d97706;
    color: #b45309;
    background: rgba(251, 191, 36, 0.2);
}

.chip-button.chip--info.chip--active {
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.chip-button.chip--muted.chip--active {
    border-color: var(--border-color);
    color: var(--muted-color);
    background: rgba(148, 163, 184, 0.2);
}

.search-input {
    min-width: 220px;
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
}

.licenca-table-card table th,
.licenca-table-card table td {
    white-space: nowrap;
}

.deadline-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.deadline-pill--PRAZO_EXPIRADO {
    background: #fee2e2;
    color: #b91c1c;
}

.deadline-pill--PRAZO_PROXIMO {
    background: #fef3c7;
    color: #92400e;
}

.deadline-pill--PRAZO_DISTANTE {
    background: #dbeafe;
    color: #1d4ed8;
}

.deadline-pill--SEM_PRAZO,
.deadline-pill--muted {
    background: #e2e8f0;
    color: #475569;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.modal-card {
    width: min(520px, 90vw);
    padding: 1.5rem;
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 25px 55px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-card input,
.modal-card select,
.modal-card textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font: inherit;
    background: var(--card-bg);
    color: var(--text-color);
}

.modal-card .action-buttons {
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.modal-option {
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    background: rgba(37, 99, 235, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.modal-option__icon {
    font-size: 1.5rem;
}

.licenca-form-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.licenca-cadastro-pane {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.licenca-form-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.licenca-form-card .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

@media (min-width: 1280px) {
    .licenca-form-card .form-grid,
    .licenca-cond-card .form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.licenca-manage-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
}

.licenca-manage-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.licenca-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.licenca-manage-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.licenca-manage-grid input,
.licenca-manage-grid textarea {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
}

.licenca-manage-grid textarea {
    min-height: 90px;
}

.licenca-manage-card table th,
.licenca-manage-card table td {
    text-align: left;
}

.licenca-form-tabs {
    display: inline-flex;
    gap: 0.5rem;
}

.licenca-form-card .form-grid label,
.licenca-cond-card .form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.licenca-form-card .form-grid select,
.licenca-form-card .form-grid input,
.licenca-form-card .form-grid textarea,
.licenca-cond-card .form-grid select,
.licenca-cond-card .form-grid input,
.licenca-cond-card .form-grid textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    background: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
}

.licenca-form-card .form-grid textarea {
    min-height: 90px;
    resize: vertical;
}

.condicionante-form textarea,
.licenca-cond-card textarea {
    resize: vertical;
    box-sizing: border-box;
}

.licenca-cond-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.licenca-cond-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.licenca-cond-card .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.licenca-cond-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.licenca-cond-card.is-collapsed {
    background: var(--bg-color);
}

.licenca-cond-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.licenca-cond-card__title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.licenca-cond-card__title .table-subtitle {
    margin: 0;
}

.licenca-cond-card__header-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.licenca-cond-card__summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.licenca-cond-card__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.multi-select select[multiple],
.licenca-cond-card select[multiple],
.condicionante-form select[multiple] {
    min-height: 140px;
    overflow-y: auto;
}

.periodicity-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.upload-drop {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
}

.upload-drop input {
    display: none;
}

.automation-upload-drop {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    color: var(--muted-color);
    background: rgba(248, 250, 252, 0.9);
}

.automation-upload-drop i {
    font-size: 1.3rem;
}

.automation-upload-drop p {
    margin: 0;
}

.automation-upload-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.automation-upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
}

.mapping-layout {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 1.5rem;
    align-items: flex-start;
}

.mapping-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mapping-map {
    position: relative;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 18px 45px var(--card-shadow);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mapping-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.mapping-search-actions {
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.mapping-panel .form-grid label,
.mapping-crud-card .form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.mapping-panel .form-grid select,
.mapping-panel .form-grid input,
.mapping-crud-card .form-grid select,
.mapping-crud-card .form-grid input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    background: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
}

.mapping-controls label {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.mapping-controls select {
    margin-top: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    background: var(--bg-color);
}

.mapping-controls input {
    margin-top: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    background: var(--bg-color);
}

.mapping-controls button {
    flex: 0 0 auto;
}

.mapping-hint {
    font-size: 0.85rem;
    color: var(--muted-color);
    margin: 0;
}

.mapping-map__canvas {
    flex: 1;
    width: 100%;
    min-height: 60vh;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.mapping-map__canvas.leaflet-container {
    background: #e5e7eb;
}

.mapping-map__loading {
    position: absolute;
    inset: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
    border-radius: 14px;
    z-index: 400;
    color: var(--text-color);
    font-weight: 600;
}

.mapping-map__loading .loading-spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
    border-color: rgba(15, 23, 42, 0.18);
    border-top-color: var(--accent-color);
}

.mapping-panel {
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 18px 45px var(--card-shadow);
    max-height: 70vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mapping-crud-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mapping-crud-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.mapping-crud-card__actions {
    justify-content: flex-end;
    align-items: center;
}

.mapping-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.mapping-counter {
    border-radius: 999px;
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.8rem;
    font-size: 0.85rem;
    color: var(--muted-color);
    background: var(--bg-color);
}

.mapping-empty {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.mapping-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mapping-list__item {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.85rem;
    background: var(--bg-color);
    cursor: pointer;
    transition: border 0.2s ease, transform 0.2s ease;
}

.mapping-list__item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.mapping-provider__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.mapping-provider__meta {
    font-size: 0.85rem;
    color: var(--muted-color);
    text-transform: capitalize;
    margin-top: 0.25rem;
}

.mapping-provider__contact {
    font-size: 0.85rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.mapping-provider__contact a {
    color: var(--accent-strong);
    text-decoration: none;
}

.mapping-provider__contact a:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .mapping-layout {
        grid-template-columns: 1fr;
    }
    .mapping-panel {
        max-height: none;
        order: -1;
    }

    .app-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.25rem 1.25rem;
    }
}

.kanban-setup {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kanban-header-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.kanban-board-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 280px;
    font-size: 0.9rem;
}

.kanban-board-form textarea {
    min-height: 80px;
}

.kanban-board-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kanban-board-field-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.kanban-board-field-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: 500;
}

.kanban-board-field-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.kanban-board-field-chips {
    margin-top: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.kanban-board-field-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.82rem;
    background: var(--bg-color);
}

.kanban-list-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
}

.kanban-list-bulk-actions select {
    min-width: 220px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.kanban-forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.kanban-column-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-column-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    cursor: grab;
}

.kanban-column-color {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px var(--card-bg);
}

.kanban-column-list__info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kanban-column-list__info small {
    color: var(--muted-color);
    font-size: 0.75rem;
}

.kanban-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kanban-columns {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
    scrollbar-width: thin;
}

.kanban-column {
    flex: 0 0 320px;
    width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 6px solid var(--accent-color);
}

.kanban-column--drag-over {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.kanban-columns::-webkit-scrollbar {
    height: 10px;
}

.kanban-columns::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
}

.kanban-columns::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.45);
    border-radius: 999px;
}

.kanban-scroll-nav {
    position: fixed;
    right: 98px;
    bottom: 76px;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 220px;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
}

.kanban-scroll-nav button {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border-radius: 8px;
}

.kanban-scroll-range {
    flex: 1;
    min-width: 0;
    accent-color: #22c55e;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.kanban-column-header h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
}

.kanban-column-actions {
    display: flex;
    gap: 0.35rem;
}

.kanban-column-meta {
    font-size: 0.85rem;
    color: var(--muted-color);
    margin: 0;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-column-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.kanban-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.kanban-card--dragging {
    opacity: 0.6;
    border-style: dashed;
}

.kanban-card header {
    display: flex;
    border-radius: 12px;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
    font-size: 0.95rem;
}

.kanban-card header h4 {
    margin: 0;
    font-size: 1rem;
}

.kanban-card-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.kanban-card-priority {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted-color);
    letter-spacing: 0.05em;
}

.kanban-card header small {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted-color);
}

.kanban-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-color);
}

.kanban-card-detail {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    line-height: 1.2;
}

.kanban-card-detail strong {
    font-weight: 600;
    color: var(--muted-color);
}

.kanban-card-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.kanban-card-actions button {
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--muted-color);
}

.kanban-card-actions button.secondary {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.kanban-card-actions button.ghost {
    border-color: transparent;
    color: var(--muted-color);
}

.kanban-card--empty {
    text-align: center;
    color: var(--muted-color);
    font-style: italic;
    border-style: dashed;
}

.kanban-filters-card input,
.kanban-filters-card select {
    width: 100%;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    background: var(--card-bg);
    box-sizing: border-box;
}

.kanban-filters-card select,
.kanban-board-selector select,
.kanban-move-select select {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    background: var(--card-bg);
}

.kanban-move-select {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.kanban-move-select select {
    width: 100%;
    font-size: 0.85rem;
}

.kanban-tag-input {
    appearance: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    width: 100%;
    min-height: 32.4px;
    background: var(--card-bg);
    box-sizing: border-box;
}

.kanban-workspace-actions {
    justify-content: flex-end;
    margin-left: auto;
    margin-top: 0.85rem;
    gap: 1rem;
    padding-top: 0.35rem;
}

.kanban-filter-section {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: rgba(148, 163, 184, 0.06);
}

.kanban-filter-section__header h3 {
    margin: 0;
}

.kanban-period-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.65rem;
}

.kanban-checkbox-label {
    gap: 0.45rem;
}

.kanban-checkbox-label span {
    font-weight: 600;
    color: var(--muted-color);
}

.kanban-checkbox-label input[type="checkbox"] {
    margin-top: 0;
    width: 18px;
    height: 18px;
    align-self: flex-start;
}

.kanban-list-table-wrapper {
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.kanban-list-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    background: var(--card-bg);
}

.kanban-list-table thead th {
    text-align: left;
    font-size: 0.82rem;
    color: var(--muted-color);
    font-weight: 700;
    padding: 0.9rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.03);
    white-space: nowrap;
}

.kanban-list-table tbody td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.kanban-list-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.kanban-list-table tbody tr:last-child td {
    border-bottom: none;
}

.kanban-list-table__check {
    width: 42px;
    text-align: center;
}

.kanban-list-table__check input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.kanban-list-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.kanban-list-type i {
    color: var(--accent-color);
    font-size: 1rem;
}

.kanban-list-summary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 220px;
}

.kanban-list-summary strong,
.kanban-list-comments {
    line-height: 1.35;
}

.kanban-list-summary small,
.kanban-list-comments {
    color: var(--muted-color);
    font-size: 0.88rem;
}

.kanban-list-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--kanban-status-color);
    background: color-mix(in srgb, var(--kanban-status-color) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--kanban-status-color) 34%, transparent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-list-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.kanban-list-categories span {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.08);
    font-size: 0.78rem;
    color: var(--text-color);
}

.kanban-list-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-start;
}

.kanban-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.kanban-card-modal {
    width: min(850px);
    height: min(760px);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
}

.kanban-card-modal .modal-card__header {
    padding: 1rem 1.25rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.kanban-card-modal .modal-card__body {
    padding: 1rem 1.75rem 1.25rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.kanban-card-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    min-height: 0;
}

.kanban-card-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.35rem 0.9rem 0.2rem;
}

.kanban-card-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.85rem;
}

.kanban-card-grid > label {
    min-width: 0;
}

.kanban-field-title { grid-column: 1 / span 8; }
.kanban-field-assignee { grid-column: 9 / span 4; }
.kanban-field-description,
.kanban-field-metadata,
.kanban-field-address { grid-column: 1 / -1; }
.kanban-field-tags { grid-column: 1 / span 6; }
.kanban-field-priority { grid-column: 7 / span 2; }
.kanban-field-due { grid-column: 9 / span 2; }
.kanban-field-sort { grid-column: 11 / span 2; }
.kanban-field-responsible { grid-column: 1 / span 4; }
.kanban-field-company { grid-column: 5 / span 4; }
.kanban-field-contact { grid-column: 9 / span 2; }
.kanban-field-city { grid-column: 11 / span 2; }
.kanban-field-area { grid-column: 1 / span 3; }
.kanban-field-service { grid-column: 4 / span 5; }
.kanban-field-amount { grid-column: 9 / span 4; }
.kanban-field-custom { grid-column: span 4; }
.kanban-field-attachments {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted-color);
}

.kanban-field-attachments > span {
    display: block;
}

.kanban-card-drop {
    margin-top: 0.35rem;
    min-height: 148px;
    border: 1px dashed rgba(37, 99, 235, 0.34);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.95));
    color: #1e3a8a;
    gap: 0.65rem;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.kanban-card-drop i {
    font-size: 1.6rem;
}

.kanban-card-drop p {
    margin: 0;
    max-width: 420px;
    text-align: center;
    font-size: 0.95rem;
}

.kanban-card-drop.is-drag-over {
    border-color: #2563eb;
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.98), rgba(239, 246, 255, 0.98));
    transform: translateY(-1px);
}

.kanban-card-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.kanban-card-attachment-image {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: #fff;
}

.kanban-card-attachment-image img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.95);
}

.kanban-card-attachment-image__meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.kanban-card-attachment-image__meta strong,
.kanban-card-attachment-image__meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-attachment-image__meta small {
    color: var(--muted-color);
}

.kanban-card-attachment-image__actions,
.kanban-card-attachment-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.kanban-card-attachment-list li {
    gap: 0.75rem;
}

.kanban-card-attachment-list span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-actions-bar {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kanban-history-card {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
}

.kanban-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow: auto;
    padding-right: 0.25rem;
}

.kanban-history-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    background: var(--card-bg);
    display: grid;
    gap: 0.25rem;
}

.kanban-history-item small {
    color: var(--muted-color);
}

.kanban-history-item p {
    margin: 0;
}

@media (max-width: 1100px) {
    .kanban-card-modal {
        width: calc(100vw - 90px);
        height: calc(100vh - 90px);
        border-radius: 10px;
    }
    .kanban-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .kanban-field-title,
    .kanban-field-description,
    .kanban-field-metadata,
    .kanban-field-address,
    .kanban-field-tags,
    .kanban-field-assignee,
    .kanban-field-priority,
    .kanban-field-due,
    .kanban-field-sort,
    .kanban-field-responsible,
    .kanban-field-company,
    .kanban-field-contact,
    .kanban-field-city,
    .kanban-field-area,
    .kanban-field-service,
    .kanban-field-amount,
    .kanban-field-custom {
        grid-column: 1 / -1;
    }
    .kanban-scroll-nav {
        right: 70px;
        bottom: 66px;
        width: 190px;
    }
    .kanban-list-table {
        min-width: 980px;
    }
}

body.modal-open {
    overflow: hidden;
}

.kanban-import-drop {
    min-height: 130px;
}

.kanban-import-drop i {
    font-size: 1.6rem;
}

.kanban-import-drop.is-drag-over {
    border-color: var(--accent-color);
    background: rgba(37, 99, 235, 0.08);
}

.kanban-import-modal {
    width: min(640px, 92vw);
    max-height: 88vh;
}

.kanban-import-modal__body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.kanban-import-template-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    text-decoration: none;
}

.kanban-import-fields {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    background: rgba(148, 163, 184, 0.08);
}

.kanban-import-fields p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.full-width {
    font-size: 0.9rem;
    padding: 0.6rem;
}

.modal-card__header h2 {
    margin: 0;
}

.modal-card__header h2 small {
    display: block;
    font-size: 0.85rem;
    color: var(--muted-color);
    font-weight: 500;
}

.company-lookup-card p {
    margin: 0.25rem 0 0;
    color: var(--muted-color);
}

.company-lookup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button {
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-weight: 600;
    color: var(--muted-color);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.tab-button--active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-button-text);
}

.company-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.company-tab {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-tab textarea {
    min-height: 120px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: flex-start;
}

.full-row {
    grid-column: 1 / -1;
}

.company-form-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.modal-card {
    background: var(--card-bg);
    border-radius: 16px;
    width: min(960px, 95vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
}

.modal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
}

.modal-card__body {
    padding: 1.5rem;
    overflow-y: auto;
}

form {
    display: grid;
    gap: 1rem;
}

form label {
    font-weight: 600;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--muted-color);
}

form input,
form select,
form textarea {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem;
    font-size: 1rem;
    margin-top: 0.35rem;
    background: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    box-sizing: border-box;
}
form textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.read-only-editor {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    background: var(--card-bg);
    min-height: 200px;
    margin: 0.5rem 0 1rem;
    pointer-events: none;
}

.html-editor-shell {
    margin-top: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
}

.html-editor .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.08);
}

.html-editor .ql-container.ql-snow {
    border: none;
    min-height: 260px;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--bg-color);
}

.html-editor .ql-editor {
    min-height: 260px;
}

.read-only-content {
    min-height: 160px;
    color: var(--text-color);
}

.read-only-content.empty {
    color: var(--muted-color);
    font-style: italic;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

button.primary {
    background: var(--accent-color);
    color: var(--primary-button-text);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
}

button.secondary {
    background: transparent;
    border: 1px solid var(--secondary-button-border);
    color: var(--muted-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
}

button.ghost {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #b91c1c;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

button.primary:hover,
button.secondary:hover,
button.warning:hover,
button.ghost:hover {
    filter: brightness(0.95);
}

button.ghost:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

button.warning {
    background: #f97316;
    border: none;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
}

button.ghost.danger {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.6);
    color: #b91c1c;
}

button.icon-only {
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    min-width: 36px;
}

button.primary:disabled,
button.secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

.link-button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted-color);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

.link-button:hover {
    color: var(--accent-strong);
}

.link-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-input {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--muted-color);
}

.file-input input {
    margin-top: 0.35rem;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--muted-color);
}

.checkbox-field input[type='checkbox'] {
    width: 16px;
    height: 16px;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--muted-color);
    margin: 0.2rem 0 0;
}

.helper-text.variables {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.payment-payer-summary {
    display: grid;
    gap: 0.45rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface-muted);
}

.payment-payer-summary p {
    margin: 0;
}

.payment-email-preview {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(245, 130, 32, 0.05), rgba(255, 255, 255, 0.9));
    overflow: auto;
}

.payment-boleto-preview-shell {
    min-height: 70vh;
}

.payment-boleto-frame {
    width: 100%;
    min-height: 70vh;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
}

.kanban-summary-form {
    align-items: flex-start;
}

.kanban-summary-emails {
    min-height: 110px;
}

.kanban-summary-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
    margin-top: 0.85rem;
}

.kanban-summary-columns__item {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    min-height: 48px;
}

.kanban-summary-form__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.kanban-summary-table td {
    vertical-align: top;
}

.variable-chip {
    background: var(--nav-hover-bg);
    color: var(--accent-color);
    padding: 0.1rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.import-preview {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.import-preview li {
    display: flex;
    flex-direction: column;
}

.import-preview li span {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.attachments-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.attachments-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.attachments-list span {
    font-size: 0.9rem;
    color: var(--muted-color);
}

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 0.5rem;
}

.settings-button {
    background: var(--card-bg);
    color: var(--muted-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.settings-button:hover {
    background: var(--nav-hover-bg);
    color: var(--nav-hover-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

th,
td {
    padding: 0.65rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

td button {
    margin-right: 0.35rem;
}

.status-pill {
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-active {
    background: var(--status-active-bg);
    color: var(--status-active-color);
    border-color: var(--status-active-color);
}

.status-inactive {
    background: var(--status-inactive-bg);
    color: var(--status-inactive-color);
    border-color: var(--status-inactive-color);
}

.status-email-sent {
    background: #ecfdf5;
    color: #047857;
    border-color: #047857;
}

.status-email-pending {
    background: #fef9c3;
    color: #92400e;
    border-color: #ca8a04;
}

.status-email-failed {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #b91c1c;
}

.status-neutral {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.status-warning {
    background: #fff7ed;
    color: #c2410c;
    border-color: #f97316;
}

.status-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #2563eb;
}

.view-fade-enter-active,
.view-fade-leave-active {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.view-fade-enter-from,
.view-fade-leave-to {
    opacity: 0;
    transform: translateY(12px);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color);
}

.auth-login {
    position: relative;
    background: var(--bg-color) var(--login-bg) center center / cover no-repeat;
}

.auth-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.3));
    mix-blend-mode: multiply;
}

.auth-login .auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

[data-theme='dark'] .auth-login .auth-card {
    background: rgba(30, 41, 59, 0.9);
}

.auth-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px var(--card-shadow);
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-logo {
    display: block;
    max-width: 240px;
    width: 100%;
    margin: 0 auto 0.5rem;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

ul {
    padding-left: 1.2rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.config-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 950;
}

.config-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 320px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -10px 0 25px rgba(15, 23, 42, 0.2);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: right 0.3s ease;
    z-index: 1000;
}

.config-panel.open {
    right: 0;
}

.config-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.config-panel__close {
    background: transparent;
    border: none;
    color: var(--muted-color);
    cursor: pointer;
    font-size: 0.9rem;
}

.config-panel form {
    flex: 1;
}

@media (max-width: 960px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    nav {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
    }

    nav button {
        flex: 1;
        white-space: nowrap;
    }
}
.licenca-period-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.licenca-period-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

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

.period-range input {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

/* === Markdown styling for chat === */
.chat-message--assistant .msg-content pre {
  background: #0f1724;
  color: #e6eef8;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0.5rem 0;
}

.chat-message--assistant .msg-content code {
  background: rgba(2,6,23,0.06);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size: 0.85rem;
}

/* Chat typing indicator */
.typing-placeholder {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-color);
  opacity: 0.6;
  animation: typingBlink 1s infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 0.9; transform: translateY(-2px); }
}

.msg-streaming {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.5;
}

.chat-message--assistant .msg-content pre code {
  background: transparent;
  padding: 0;
}

.chat-message--assistant .msg-content h1,
.chat-message--assistant .msg-content h2,
.chat-message--assistant .msg-content h3 {
  margin: 0.35rem 0;
  font-weight: 700;
}

.chat-message--assistant .msg-content p {
  margin: 0.25rem 0;
}

.chat-message--assistant .msg-content ul,
.chat-message--assistant .msg-content ol {
  margin: 0.25rem 0 0.5rem 1rem;
}

.chat-message--assistant .msg-content a {
  color: var(--accent-color);
  text-decoration: underline;
}

.chat-message--assistant .msg-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 0.25rem 0;
}

/* small mobile tweak */
@media (max-width: 420px) {
  .chat-message--assistant .msg-content pre {
    font-size: 0.8rem;
  }
}

.checklist-template-editor-modal {
    width: min(980px, 94vw);
    max-height: 92vh;
}

.checklist-builder-screen {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--bg-color);
    padding: 0.75rem 1rem;
    overflow: hidden;
}

.checklist-builder-screen__card {
    width: 100%;
    height: calc(100vh - 1.5rem);
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.checklist-over-screen-overlay {
    z-index: 2200 !important;
}

.checklist-builder-screen .checklist-builder-card {
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100%;
}

.checklist-builder-screen .modal-card__body {
    flex: 1 1 auto;
    min-height: 0;
}

.controles-pane .controle-columns-container {
    width: min(1700px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.controle-column-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.checklist-controles-resumo {
    width: min(1700px, 100%);
    margin: 0 auto 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
}

.checklist-conformidade-visual {
    width: min(1700px, 100%);
    margin: 0 auto 0.75rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
}

.checklist-conformidade-track {
    display: flex;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.checklist-conformidade-segment {
    height: 100%;
    transition: width 0.2s ease;
}

.checklist-conformidade-segment--na {
    background: #2563eb;
}

.checklist-conformidade-segment--x {
    background: #dc2626;
}

.checklist-conformidade-segment--ok {
    background: #16a34a;
}

.checklist-conformidade-legenda {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.86rem;
    color: var(--text-color);
}

.checklist-conformidade-legenda .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.35rem;
}

.checklist-conformidade-legenda .dot--na {
    background: #2563eb;
}

.checklist-conformidade-legenda .dot--x {
    background: #dc2626;
}

.checklist-conformidade-legenda .dot--ok {
    background: #16a34a;
}

.settings-tabs {
    margin-top: 0.75rem;
}

.settings-image-preview {
    margin: 0.5rem 0;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 0.4rem;
    background: rgba(148, 163, 184, 0.06);
}

.settings-image-preview img {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.chat-icon-preview {
    margin-top: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.06);
}

.chat-icon-preview img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    background: #fff;
}

.chat-config-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.chat-config-cell img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: #fff;
}

.chat-config-cell span {
    min-width: 0;
    word-break: break-word;
}

.chat-config-field {
    min-width: 0;
}

.chat-config-upload-field {
    display: flex;
    flex-direction: column;
}

.settings-profile-preview {
    margin-top: 0.65rem;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(148, 163, 184, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
}

.settings-profile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.controle-column-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.checklist-template-editor {
    width: 100%;
    min-height: 52vh;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
    font-size: 0.86rem;
    line-height: 1.45;
    box-sizing: border-box;
}

.checklist-print-selection-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-height: 68vh;
    overflow: auto;
}

.checklist-print-selection-group {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.checklist-print-selection-group h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    color: var(--muted-color);
}

.checklist-print-selection-group__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.checklist-print-selection-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.checklist-print-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    margin: 0;
}

.checklist-print-checkbox span {
    line-height: 1.3;
}

.checklist-print-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Checklist builder modal layout hardening */
.checklist-builder-card {
    width: min(1360px, 96vw);
    max-width: 1360px;
    max-height: 94vh;
    padding: 0;
    overflow: hidden;
}

.checklist-builder-card .modal-card__header,
.checklist-builder-card .modal-card__body {
    width: 100%;
    box-sizing: border-box;
}

.checklist-builder-card .modal-card__body {
    overflow-y: auto;
    overflow-x: hidden;
}

.checklist-builder-card .checklist-builder-tabs {
    padding: 0 1.5rem;
    margin: 0.75rem 0 0.5rem;
}

.checklist-builder-card .checklist-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.9rem;
}

.checklist-builder-card .checklist-grid > label,
.checklist-builder-card .checklist-grid > .alert-card {
    grid-column: span 4;
    min-width: 0;
}

.checklist-builder-card .checklist-grid > .full-width {
    grid-column: 1 / -1;
}

.checklist-builder-card .checklist-grid > label:nth-child(4),
.checklist-builder-card .checklist-grid > label:nth-child(5),
.checklist-builder-card .checklist-grid > label:nth-child(6) {
    grid-column: span 3;
}

.checklist-builder-card .checklist-grid > label:nth-child(7),
.checklist-builder-card .checklist-grid > label:nth-child(8) {
    grid-column: span 6;
}

.checklist-builder-card input,
.checklist-builder-card select,
.checklist-builder-card textarea,
.checklist-builder-card button {
    max-width: 100%;
    box-sizing: border-box;
}

.checklist-builder-card textarea {
    width: 100%;
    max-width: 100%;
    resize: vertical;
    overflow: auto;
}

.checklist-builder-card .action-buttons {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.5rem 1.2rem;
    margin-top: 0;
}

.checklist-builder-card .action-buttons button,
.checklist-builder-card .controle-actions button {
    width: auto;
}

.controle-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.controle-card__title {
    flex: 1 1 320px;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.controle-card__header .controle-status-buttons {
    margin-left: auto;
}

.checklist-builder-card .controle-section {
    padding: 0.9rem;
}

.checklist-builder-card .controle-dual-grid {
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .checklist-builder-card {
        width: min(1200px, 97vw);
    }

    .checklist-builder-card .checklist-grid > label,
    .checklist-builder-card .checklist-grid > .alert-card {
        grid-column: span 6;
    }
}

@media (max-width: 760px) {
    .checklist-builder-card .checklist-grid {
        grid-template-columns: 1fr;
    }

    .checklist-builder-card .checklist-grid > label,
    .checklist-builder-card .checklist-grid > .alert-card,
    .checklist-builder-card .checklist-grid > .full-width {
        grid-column: 1 / -1;
    }

    .checklist-builder-card .modal-card__header {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .checklist-builder-card .checklist-builder-tabs,
    .checklist-builder-card .action-buttons {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .checklist-builder-card .controle-dual-grid {
        grid-template-columns: 1fr;
    }
}

.secure-vault-layout {
    gap: 1.25rem;
}

.secure-vault-form {
    display: grid;
    gap: 0.9rem;
}

.secure-vault-form label {
    display: grid;
    gap: 0.35rem;
}

.secure-vault-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.secure-vault-actions .icon-only {
    min-width: 40px;
}

.secure-access-favicon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 4px;
    flex: 0 0 auto;
}

.secure-access-icon-cell {
    width: 42px;
    text-align: center;
}

.secure-document-drop {
    min-height: 132px;
    text-align: center;
}

.secure-document-drop i {
    font-size: 1.6rem;
}

.secure-document-grid {
    margin-top: 0.5rem;
}

.secure-document-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.secure-document-card__placeholder {
    min-height: 180px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.5rem;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    font-size: 2rem;
}

.secure-document-card__type {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.secure-document-card__body {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.secure-document-card__title,
.secure-document-card__description,
.secure-document-card__file,
.secure-document-card__meta {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.secure-document-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.secure-document-card__description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    color: var(--text-muted);
}

.secure-document-card__file,
.secure-document-card__meta {
    white-space: nowrap;
}

.secure-document-preview-modal {
    width: min(1100px, calc(100vw - 70px));
}

.secure-document-preview-body {
    min-height: 65vh;
    display: grid;
    place-items: center;
    background: rgba(148, 163, 184, 0.08);
    overflow: auto;
}

.secure-document-preview-canvas,
.secure-document-preview-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.secure-document-preview-frame {
    width: 100%;
    min-height: 65vh;
    border: none;
    background: #fff;
    border-radius: 12px;
}

.secure-document-preview-frame--pdf {
    min-height: 72vh;
}

.secure-document-preview-fallback {
    min-height: 320px;
    display: grid;
    place-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.secure-document-preview-fallback i {
    font-size: 2.5rem;
}
