/* ============================================
   Design System — Editorial Refined
   Monochromatic palette, red accent, Visie DNA
   ============================================ */

/* --- Custom Properties --- */
:root,
[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #f6f6f7;
    --bg-elevated: #ffffff;
    --text: #0c0c0c;
    --text-secondary: #393d44;
    --text-muted: #8a8f9a;
    --border: #dcdde0;
    --border-subtle: #ecedef;
    --accent: #a7000c;
    --accent-hover: #8a000a;
    --accent-soft: rgba(167, 0, 12, 0.05);
    --accent-glow: rgba(167, 0, 12, 0.12);
    --input-bg: #ffffff;
    --input-border: #d4d5d9;
    --input-focus-border: #0c0c0c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-hover: 0 8px 28px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.04);
    --nav-bg: #ffffff;
    --nav-border: #ecedef;
    --hero-bg: #0c0c0c;
    --hero-text: #ffffff;
    --footer-bg: #f6f6f7;
    --card-bg: #ffffff;
    --notification-primary-bg: #fdf0f2;
    --notification-primary-border: #a7000c;
    --notification-primary-text: #7a0008;
    --notification-success-bg: #eef8ee;
    --notification-success-border: #2e7d32;
    --notification-success-text: #1b5e20;
    --notification-danger-bg: #fdf0f0;
    --notification-danger-border: #a7000c;
    --notification-danger-text: #7a0008;
    --notification-warning-bg: #fdf8ee;
    --notification-warning-border: #c68a00;
    --notification-warning-text: #7a5600;
    --notification-info-bg: #eef3fc;
    --notification-info-border: #3670b2;
    --notification-info-text: #1a4a80;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

[data-theme="dark"] {
    --bg: #0c0c0c;
    --bg-alt: #131315;
    --bg-elevated: #19191c;
    --text: #ededee;
    --text-secondary: #a8a9ae;
    --text-muted: #606168;
    --border: #2c2d30;
    --border-subtle: #212224;
    --accent: #d4323e;
    --accent-hover: #e04550;
    --accent-soft: rgba(212, 50, 62, 0.08);
    --accent-glow: rgba(212, 50, 62, 0.18);
    --input-bg: #131315;
    --input-border: #35363a;
    --input-focus-border: #ededee;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 28px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
    --nav-bg: #0c0c0c;
    --nav-border: #1e1f21;
    --hero-bg: #131315;
    --hero-text: #ededee;
    --footer-bg: #0c0c0c;
    --card-bg: #19191c;
    --notification-primary-bg: rgba(212, 50, 62, 0.10);
    --notification-primary-border: #d4323e;
    --notification-primary-text: #f09090;
    --notification-success-bg: rgba(46, 125, 50, 0.10);
    --notification-success-border: #4caf50;
    --notification-success-text: #81c784;
    --notification-danger-bg: rgba(167, 0, 12, 0.10);
    --notification-danger-border: #d4323e;
    --notification-danger-text: #f09090;
    --notification-warning-bg: rgba(198, 138, 0, 0.10);
    --notification-warning-border: #e0a800;
    --notification-warning-text: #f0cc60;
    --notification-info-bg: rgba(54, 112, 178, 0.10);
    --notification-info-border: #5c9ce6;
    --notification-info-text: #90c0f0;
}

/* --- Base --- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
    transition: background-color 0.3s ease;
}

body {
    font-family: var(--font, "Inter"), -apple-system, sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: var(--text-secondary);
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body > .section {
    flex-grow: 1;
}

::selection {
    background-color: var(--accent-glow);
    color: var(--text);
}

/* --- Typography --- */

.title,
.subtitle {
    color: var(--text) !important;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.title {
    font-size: 1.85rem;
    line-height: 1.2;
}

.title.is-1 {
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: -0.03em;
}

.title.is-2 {
    font-size: 2.25rem;
    font-weight: 400;
    letter-spacing: -0.025em;
}

.title.is-3 {
    font-size: 1.5rem;
    letter-spacing: -0.015em;
}

.title.is-4 {
    font-size: 1.2rem;
}

.title.is-5 {
    font-size: 1rem;
}

.title.is-6 {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
}

.subtitle {
    color: var(--text-muted) !important;
    font-weight: 400;
    letter-spacing: -0.005em;
}

.subtitle.is-6 {
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted) !important;
}

.label {
    color: var(--text) !important;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

a {
    color: var(--text);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

.has-text-centered a,
p a,
.content a {
    color: var(--accent);
    text-decoration: none;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.3s ease, color 0.2s ease;
}

.has-text-centered a:hover,
p a:hover,
.content a:hover {
    background-size: 100% 1px;
}

strong {
    color: var(--text);
    font-weight: 600;
}

small {
    color: var(--text-muted);
}

hr {
    background-color: var(--border-subtle) !important;
    height: 1px !important;
}

/* --- Navbar --- */

.navbar {
    background-color: var(--nav-bg) !important;
    border-bottom: 1px solid var(--nav-border);
    min-height: 3.75rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-item,
.navbar-link {
    color: var(--text-secondary) !important;
    font-size: 0.87rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

.navbar-item:hover,
.navbar-link:hover {
    background-color: transparent !important;
    color: var(--text) !important;
}

.navbar-brand .navbar-item {
    color: var(--text) !important;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.navbar-burger {
    color: var(--text) !important;
}

.navbar-burger:hover {
    background-color: transparent !important;
    color: var(--accent) !important;
}

.navbar-burger span {
    background-color: var(--text) !important;
    height: 1.5px !important;
    transition: background-color 0.3s ease;
}

.navbar-dropdown {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-top: 2px solid var(--accent) !important;
    border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.35rem 0 !important;
}

.navbar-dropdown .navbar-item {
    font-size: 0.84rem !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 0 !important;
}

.navbar-dropdown .navbar-item:hover {
    background-color: var(--bg-alt) !important;
    color: var(--accent) !important;
}

.navbar-divider {
    background-color: var(--border-subtle) !important;
    margin: 0.35rem 0.75rem !important;
}

.navbar-link::after {
    border-color: var(--text-muted) !important;
}

.navbar-menu {
    background-color: var(--nav-bg) !important;
    transition: background-color 0.3s ease;
}

/* --- Buttons --- */

.button,
.buttons .button {
    border-radius: 60px !important;
    font-weight: 500;
    font-size: 0.87rem;
    padding: 0.55em 1.8em;
    letter-spacing: 0.005em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-width: 1.5px;
    border-style: solid;
    line-height: 1.5;
    height: auto;
    position: relative;
}

.button:active {
    transform: scale(0.97);
}

.button.is-primary:not(.is-outlined) {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}

.button.is-primary:not(.is-outlined):hover {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    box-shadow: 0 4px 16px rgba(167, 0, 12, 0.3);
    transform: translateY(-1px);
}

.button.is-primary:not(.is-outlined):active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(167, 0, 12, 0.2);
}

.button.is-primary:focus {
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.button.is-primary.is-outlined {
    background-color: transparent !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.button.is-primary.is-outlined:hover {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(167, 0, 12, 0.25);
    transform: translateY(-1px);
}

.button.is-outlined {
    background-color: transparent !important;
}

.button.is-outlined:not([class*="is-primary"]):not([class*="is-link"]):not([class*="is-info"]):not([class*="is-success"]):not([class*="is-warning"]):not([class*="is-danger"]) {
    border-color: var(--text-secondary) !important;
    color: var(--text-secondary) !important;
}

.button.is-outlined:not([class*="is-primary"]):not([class*="is-link"]):not([class*="is-info"]):not([class*="is-success"]):not([class*="is-warning"]):not([class*="is-danger"]):hover {
    background-color: var(--text-secondary) !important;
    color: var(--bg) !important;
}

.button.is-light {
    background-color: transparent !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.button.is-light:hover {
    border-color: var(--text) !important;
    background-color: var(--text) !important;
    color: var(--bg) !important;
}

.button.is-dark {
    background-color: var(--text) !important;
    border-color: var(--text) !important;
    color: var(--bg) !important;
}

.button.is-dark:hover {
    opacity: 0.85;
}

.button.is-white {
    background-color: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.button:not([class*="is-"]) {
    background-color: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.button:not([class*="is-"]):hover {
    border-color: var(--text-muted) !important;
    box-shadow: var(--shadow-sm);
}

.button[disabled] {
    opacity: 0.4 !important;
    pointer-events: none;
}

.button.is-loading::after {
    border-color: transparent transparent currentColor currentColor !important;
}

.button.is-fullwidth {
    padding-top: 0.7em;
    padding-bottom: 0.7em;
    font-size: 0.9rem;
}

.button.is-medium {
    font-size: 0.95rem;
    padding: 0.65em 2.2em;
}

.button.is-small {
    font-size: 0.78rem;
    padding: 0.4em 1.2em;
}

.button.is-large {
    font-size: 1.05rem;
    padding: 0.75em 2.5em;
}

.navbar .button.is-primary,
.navbar .button.is-light {
    padding: 0.35em 1.4em;
    font-size: 0.82rem;
}

.field.has-addons .control .button,
.field.has-addons .control .input {
    border-radius: 0 !important;
}

.field.has-addons .control:first-child .button,
.field.has-addons .control:first-child .input {
    border-radius: 60px 0 0 60px !important;
}

.field.has-addons .control:last-child .button,
.field.has-addons .control:last-child .input {
    border-radius: 0 60px 60px 0 !important;
}

/* --- Form Inputs --- */

.input,
.textarea,
.select select {
    background-color: var(--input-bg) !important;
    border: 1.5px solid var(--input-border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    font-size: 0.92rem;
    padding: 0.65em 0.9em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: auto;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

.input:hover,
.textarea:hover,
.select select:hover {
    border-color: var(--text-muted) !important;
}

.input:focus,
.textarea:focus,
.select select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.control.has-icons-left .icon {
    color: var(--text-muted) !important;
    transition: color 0.2s ease;
}

.control.has-icons-left .input:focus ~ .icon {
    color: var(--accent) !important;
}

.help {
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

/* --- Notifications --- */

.notification {
    border-radius: var(--radius-md) !important;
    border: none;
    border-left: 3px solid var(--border);
    padding: 1rem 2.5rem 1rem 1.25rem !important;
    font-size: 0.88rem;
    font-weight: 400;
    box-shadow: var(--shadow-sm) !important;
    background-color: var(--bg-elevated) !important;
    transition: opacity 0.4s ease, transform 0.4s ease,
                margin 0.4s ease, padding 0.4s ease,
                max-height 0.4s ease;
    max-height: 200px;
    overflow: hidden;
}

.notification.is-fading {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.notification.is-primary {
    background-color: var(--notification-primary-bg) !important;
    border-left-color: var(--notification-primary-border);
    color: var(--notification-primary-text) !important;
}

.notification.is-success {
    background-color: var(--notification-success-bg) !important;
    border-left-color: var(--notification-success-border);
    color: var(--notification-success-text) !important;
}

.notification.is-danger {
    background-color: var(--notification-danger-bg) !important;
    border-left-color: var(--notification-danger-border);
    color: var(--notification-danger-text) !important;
}

.notification.is-warning {
    background-color: var(--notification-warning-bg) !important;
    border-left-color: var(--notification-warning-border);
    color: var(--notification-warning-text) !important;
}

.notification.is-info {
    background-color: var(--notification-info-bg) !important;
    border-left-color: var(--notification-info-border);
    color: var(--notification-info-text) !important;
}

.notification .delete {
    background-color: transparent !important;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.notification .delete:hover {
    opacity: 1;
}

.notification .delete::before,
.notification .delete::after {
    background-color: currentColor !important;
}

body > .toast-stack {
    position: fixed !important;
    top: calc(3.75rem + 1.5rem + env(safe-area-inset-top));
    right: calc(1.5rem + env(safe-area-inset-right));
    z-index: 1000;
    display: grid;
    gap: 0.75rem;
    width: min(24rem, calc(100vw - 3rem));
    margin: 0;
    pointer-events: none;
}

body > .toast-stack .toast {
    margin: 0 !important;
    pointer-events: auto;
}

body > .toast-stack .toast.is-fading {
    transform: translateY(-8px) scale(0.98);
    max-height: 200px;
    padding: 1rem 2.5rem 1rem 1.25rem !important;
}

/* --- Section --- */

.section {
    background-color: var(--bg);
    padding: 3rem 1.5rem;
    transition: background-color 0.3s ease;
}

/* --- Form Card --- */

.form-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s ease, border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.form-card .title {
    margin-bottom: 0.25rem !important;
}

.form-card .form-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 2rem;
}

.form-card .field {
    margin-bottom: 1.25rem;
}

.form-card .button.is-fullwidth {
    margin-top: 0.75rem;
}

.separator {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.separator span {
    padding: 0 0.75rem;
}

.google-btn {
    border: 1px solid var(--border) !important;
    background: var(--bg) !important;
    color: var(--text) !important;
    font-weight: 500;
    transition: all 0.2s;
}

.google-btn:hover {
    border-color: var(--text-muted) !important;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.form-links {
    margin-top: 1.75rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.form-links p + p {
    margin-top: 0.4rem !important;
}

.form-links a {
    background-image: none !important;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    color: var(--text-secondary);
}

.form-links a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* --- Hero (home anonymous) --- */

.hero-landing {
    background-color: var(--hero-bg);
    color: var(--hero-text);
    padding: 7rem 1.5rem 6rem;
    margin: -3rem -1.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-landing::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0.5;
}

.hero-landing .hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--hero-text);
    margin-bottom: 1rem;
    position: relative;
}

.hero-landing .hero-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2.5rem;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
}

.hero-landing .buttons {
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

.hero-landing .button.is-primary {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}

.hero-landing .button.is-primary:hover {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.hero-landing .button.is-outlined {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.hero-landing .button.is-outlined:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
}

/* --- Dashboard (home logged in) --- */

.section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* --- Footer --- */

.footer {
    background-color: var(--footer-bg) !important;
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 1.5rem !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer .content p {
    color: var(--text-muted) !important;
    font-size: 0.78rem;
}

/* --- Theme Toggle --- */

.theme-toggle {
    cursor: pointer;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 60px;
    font-size: 0.8rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--text-muted);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--text);
    color: var(--text);
    transform: rotate(15deg);
}

/* --- Animation --- */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-card {
    animation: fadeUp 0.35s ease both;
}

.hero-landing .hero-title {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-landing .hero-subtitle {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
}

.hero-landing .buttons {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.notification {
    animation: fadeUp 0.3s ease both;
}

/* --- Box --- */

.box {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text-secondary) !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* --- Table --- */

.table-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table {
    background-color: var(--bg) !important;
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
}

.table th {
    color: var(--text) !important;
    border-color: var(--border-subtle) !important;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.9em 1em !important;
}

.table td {
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
    padding: 0.8em 1em !important;
    vertical-align: middle;
}

.table thead th {
    border-bottom: 2px solid var(--border) !important;
    background-color: var(--bg-alt) !important;
}

.table.is-striped tbody tr:not(.is-selected):nth-child(even) {
    background-color: var(--bg-alt) !important;
}

.table.is-hoverable tbody tr:not(.is-selected) {
    transition: background-color 0.15s ease;
}

.table.is-hoverable tbody tr:not(.is-selected):hover {
    background-color: var(--accent-soft) !important;
}

.table tr.is-selected {
    background-color: var(--accent) !important;
    color: #ffffff !important;
}

.table tr.is-selected td,
.table tr.is-selected th {
    border-color: rgba(255,255,255,0.15) !important;
    color: #ffffff !important;
}

/* --- Card --- */

.card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover) !important;
    border-color: var(--border) !important;
    transform: translateY(-2px);
}

.card-header {
    background-color: transparent;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.15rem 0;
}

.card-header-title {
    color: var(--text) !important;
    font-weight: 500;
    font-size: 0.92rem;
}

.card-header-icon {
    color: var(--text-muted) !important;
}

.card-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-footer {
    border-top: 1px solid var(--border-subtle) !important;
}

.card-footer-item {
    border-right-color: var(--border-subtle) !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.card-footer-item:hover {
    background-color: var(--accent-soft);
    color: var(--accent) !important;
}

/* --- Tags --- */

.tag:not(body) {
    border-radius: var(--radius-sm) !important;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    padding: 0 0.75em;
    height: 1.75em;
    transition: opacity 0.2s ease;
}

.tags.has-addons .tag:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}

.tags.has-addons .tag:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

/* --- Tabs --- */

.tabs {
    border-bottom-color: var(--border-subtle) !important;
}

.tabs ul {
    border-bottom-color: var(--border-subtle) !important;
}

.tabs a {
    border-bottom: 2px solid transparent !important;
    color: var(--text-muted) !important;
    font-size: 0.88rem;
    font-weight: 450;
    padding-bottom: calc(0.5em + 1px);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tabs a:hover {
    border-bottom-color: var(--border) !important;
    color: var(--text) !important;
}

.tabs li.is-active a {
    border-bottom-color: var(--accent) !important;
    color: var(--accent) !important;
    font-weight: 500;
}

.tabs.is-boxed a {
    border: 1.5px solid transparent !important;
    border-bottom: none !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.tabs.is-boxed li.is-active a {
    background-color: var(--bg) !important;
    border-color: var(--border-subtle) !important;
    border-bottom: none !important;
    color: var(--text) !important;
}

.tabs.is-toggle a {
    border: 1.5px solid var(--border) !important;
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
    border-radius: 0 !important;
    transition: all 0.2s ease;
}

.tabs.is-toggle li:first-child a {
    border-radius: 60px 0 0 60px !important;
}

.tabs.is-toggle li:last-child a {
    border-radius: 0 60px 60px 0 !important;
}

.tabs.is-toggle li.is-active a {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}

.tabs.is-toggle li:not(.is-active) a:hover {
    background-color: var(--bg-alt) !important;
    color: var(--text) !important;
}

/* --- Dropdown --- */

.dropdown-content {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.35rem 0 !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 0.87rem;
    padding: 0.5rem 1rem !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-alt) !important;
    color: var(--text) !important;
}

a.dropdown-item.is-active {
    background-color: var(--accent) !important;
    color: #ffffff !important;
}

.dropdown-divider {
    background-color: var(--border-subtle) !important;
    margin: 0.35rem 0.5rem !important;
}

/* --- Pagination --- */

.pagination-previous,
.pagination-next,
.pagination-link {
    border: 1.5px solid var(--border) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.87rem;
    font-weight: 450;
    min-width: 2.25em;
    transition: all 0.2s ease;
}

.pagination-previous:hover,
.pagination-next:hover,
.pagination-link:hover {
    border-color: var(--text-muted) !important;
    color: var(--text) !important;
    background-color: var(--bg-alt) !important;
}

.pagination-link.is-current {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}

.pagination-ellipsis {
    color: var(--text-muted) !important;
}

/* --- Progress --- */

.progress {
    border-radius: 60px !important;
    height: 0.5rem;
    overflow: hidden;
}

.progress::-webkit-progress-bar {
    background-color: var(--bg-alt) !important;
    border-radius: 60px;
}

.progress::-webkit-progress-value {
    border-radius: 60px;
    transition: width 0.4s ease;
}

.progress.is-small { height: 0.35rem; }
.progress.is-medium { height: 0.7rem; }
.progress.is-large { height: 1rem; }

/* --- Breadcrumb --- */

.breadcrumb {
    font-size: 0.88rem;
}

.breadcrumb a {
    color: var(--accent) !important;
    background-image: none !important;
}

.breadcrumb a:hover {
    color: var(--accent-hover) !important;
}

.breadcrumb li.is-active a {
    color: var(--text) !important;
    font-weight: 500;
}

.breadcrumb li + li::before {
    color: var(--text-muted) !important;
}

/* --- Message --- */

.message {
    background-color: transparent !important;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.message-header {
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    font-size: 0.87rem;
    font-weight: 500;
    padding: 0.75em 1em;
}

.message-body {
    background-color: var(--bg-elevated) !important;
    border: none !important;
    border-top: none !important;
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    padding: 1em 1.25em;
}

.message:not([class*="is-"]) .message-header {
    background-color: var(--text) !important;
    color: var(--bg) !important;
}

.message.is-success .message-body,
.message.is-warning .message-body,
.message.is-danger .message-body {
    background-color: var(--bg-alt) !important;
}

/* --- Modal --- */

.modal-background {
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-card {
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
}

.modal-card-head {
    background-color: var(--bg-elevated) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    padding: 1.25rem 1.5rem;
}

.modal-card-foot {
    background-color: var(--bg-alt) !important;
    border-top: 1px solid var(--border-subtle) !important;
    padding: 1rem 1.5rem;
}

.modal-card-title {
    color: var(--text) !important;
    font-size: 1.1rem;
    font-weight: 500;
}

.modal-card-body {
    background-color: var(--bg-elevated) !important;
    color: var(--text-secondary) !important;
    padding: 1.5rem;
}

/* --- Hero (Bulma component) --- */

.hero {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.hero .title,
.hero .subtitle {
    color: inherit !important;
}

.hero.is-primary {
    background-color: var(--accent) !important;
    color: #ffffff !important;
}

/* --- Level --- */

.level .heading {
    color: var(--text-muted) !important;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}

.level .title {
    font-weight: 600 !important;
    letter-spacing: -0.02em;
}

/* --- Content --- */

.content blockquote {
    background-color: var(--bg-alt);
    border-left: 3px solid var(--accent) !important;
    padding: 1em 1.25em;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.content pre {
    background-color: var(--bg-alt) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md) !important;
    padding: 1.25em;
    font-size: 0.87rem;
}

.content code {
    background-color: var(--accent-soft) !important;
    color: var(--accent) !important;
    border-radius: 4px;
    padding: 0.15em 0.4em;
    font-size: 0.88em;
}

.content pre code {
    background: none !important;
    color: inherit !important;
    padding: 0;
}

/* --- Checkbox / Radio --- */

.checkbox,
.radio {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
}

/* --- Select --- */

.select::after {
    border-color: var(--text-muted) !important;
}

.select select {
    border-radius: var(--radius-md) !important;
}

/* --- File --- */

.file-cta {
    background-color: var(--bg-alt) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
    transition: all 0.2s ease;
}

.file-name {
    background-color: var(--input-bg) !important;
    border: 1.5px solid var(--border) !important;
    border-left: none !important;
    color: var(--text-secondary) !important;
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
}

.file.is-primary .file-cta {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}

/* --- Showcase Sidebar --- */

.showcase-sidebar {
    position: sticky;
    top: 4.75rem;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.showcase-sidebar::-webkit-scrollbar {
    width: 3px;
}

.showcase-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.showcase-sidebar .menu-list a {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    padding: 0.3em 0.75em;
    border-radius: 0 !important;
    border-left: 2px solid transparent;
    background: none !important;
    transition: color 0.15s ease, border-color 0.15s ease;
    line-height: 1.6;
}

.showcase-sidebar .menu-list a:hover {
    color: var(--text) !important;
    border-left-color: var(--border);
}

.showcase-sidebar .menu-list a.is-active {
    color: var(--accent) !important;
    border-left-color: var(--accent);
    font-weight: 500;
}

/* --- Media Object --- */

.media + .media {
    border-top-color: var(--border-subtle) !important;
}

.media-content .content p {
    line-height: 1.55;
}

/* ============================================
   App Shell (grid, sidebar, painel do assistente) (protótipo)
   ============================================ */

/* --- Layout de 3 zonas --- */

.app-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr) 350px;
    grid-template-rows: 100vh;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-alt);
}

.app-shell.visieagents-collapsed {
    grid-template-columns: 248px minmax(0, 1fr) 0;
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 2.25rem 4rem;
}

.app-content::-webkit-scrollbar,
.app-sidebar::-webkit-scrollbar,
.visieagents-messages::-webkit-scrollbar { width: 8px; }
.app-content::-webkit-scrollbar-thumb,
.app-sidebar::-webkit-scrollbar-thumb,
.visieagents-messages::-webkit-scrollbar-thumb {
    background: var(--border); border-radius: 8px;
}

/* --- Topbar --- */

.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 3.75rem;
    flex-shrink: 0;
    padding: 0 1.5rem;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border-subtle);
}

.app-topbar .topbar-context {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.app-topbar .topbar-context .crumb {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.app-topbar .topbar-context .here {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar .topbar-spacer { flex: 1; }

.topbar-search {
    position: relative;
    max-width: 280px;
    width: 100%;
}

.topbar-search input {
    width: 100%;
    background-color: var(--bg-alt);
    border: 1.5px solid transparent;
    border-radius: 60px;
    padding: 0.45em 0.9em 0.45em 2.2em;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--bg);
}

.topbar-search .fa-magnifying-glass {
    position: absolute;
    left: 0.85em;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 60px;
    border: 1.5px solid var(--border);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    border-color: var(--text);
    color: var(--text);
}

.topbar-avatar {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 60px;
    background-color: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
    text-decoration: none;
}

/* --- Sidebar --- */

.app-sidebar {
    background-color: var(--bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 3.75rem;
    flex-shrink: 0;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.app-sidebar .brand .brand-mark {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 0.75rem 1.5rem;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.5rem 0.65rem 0.35rem;
    margin-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.87rem;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.nav-item:hover {
    background-color: var(--bg-alt);
    color: var(--text);
}

.nav-item.is-active {
    background-color: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

.nav-item .nav-ico {
    width: 1.1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nav-item:hover .nav-ico,
.nav-item.is-active .nav-ico { color: inherit; }

.nav-item .nav-caret {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.nav-group.is-open > .nav-item .nav-caret { transform: rotate(90deg); }

.nav-sub {
    display: none;
    margin: 0.1rem 0 0.35rem 0;
    padding-left: 1.55rem;
}

.nav-group.is-open .nav-sub { display: block; }

.nav-sub .nav-item {
    font-size: 0.83rem;
    padding: 0.4rem 0.65rem;
    color: var(--text-muted);
    position: relative;
}

.nav-sub .nav-item::before {
    content: "";
    position: absolute;
    left: -0.55rem;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: var(--border-subtle);
}

.nav-sub .nav-item:hover,
.nav-sub .nav-item.is-active { color: var(--accent); }

.sidebar-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.8rem 0.65rem;
}

/* --- Painel do assistente --- */

.visieagents-panel {
    background-color: var(--bg);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.visieagents-collapsed .visieagents-panel { display: none; }

.visieagents-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 3.75rem;
    flex-shrink: 0;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.visieagents-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 60px;
    background: linear-gradient(135deg, var(--accent), #d4323e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.visieagents-header .visieagents-title { font-weight: 600; color: var(--text); font-size: 0.92rem; line-height: 1.1; }
.visieagents-header .visieagents-status { font-size: 0.72rem; color: var(--text-muted); }
.visieagents-header .visieagents-status .dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: #2e9e4f; margin-right: 4px;
}
.visieagents-header .visieagents-actions { margin-left: auto; display: flex; gap: 0.25rem; }
.visieagents-header .icon-btn { width: 1.9rem; height: 1.9rem; border-color: transparent; }
.visieagents-header .icon-btn:hover { background: var(--bg-alt); }

.visieagents-context-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0.85rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.visieagents-context-note i { color: var(--accent); margin-top: 2px; }

.visieagents-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.chat-msg { display: flex; gap: 0.55rem; max-width: 100%; }
.chat-msg .bubble {
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 82%;
}
.chat-msg .bubble strong { color: inherit; }
.chat-msg.from-visieagents .bubble {
    background: var(--bg-alt);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}
.chat-msg.from-user { flex-direction: row-reverse; }
.chat-msg.from-user .bubble {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg .msg-avatar {
    width: 1.7rem; height: 1.7rem; border-radius: 60px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600;
}
.chat-msg.from-visieagents .msg-avatar { background: linear-gradient(135deg, var(--accent), #d4323e); color: #fff; }
.chat-msg.from-user .msg-avatar { background: var(--text); color: var(--bg); }

.visieagents-suggestions {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding: 0 0.85rem 0.6rem;
}
.suggestion-chip {
    font-size: 0.78rem;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 60px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.suggestion-chip:hover { border-color: var(--accent); color: var(--accent); }

.visieagents-composer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 0.85rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.visieagents-composer textarea {
    flex: 1;
    resize: none;
    border: 1.5px solid var(--input-border);
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text);
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 8rem;
}
.visieagents-composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.visieagents-send {
    width: 2.4rem; height: 2.4rem; flex-shrink: 0;
    border-radius: 60px; border: none; cursor: pointer;
    background: var(--accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.2s ease;
}
.visieagents-send:hover { background: var(--accent-hover); }
.visieagents-mic {
    width: 2.4rem; height: 2.4rem; flex-shrink: 0;
    border-radius: 60px; border: 1.5px solid var(--border); cursor: pointer;
    background: var(--bg); color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.visieagents-mic:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.visieagents-mic.is-recording {
    border-color: var(--accent); color: #fff; background: var(--accent);
    animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 0 6px var(--accent-glow); }
}

/* Botão flutuante quando o painel está recolhido */
.visieagents-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #d4323e);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
    transition: transform 0.2s ease;
}
.visieagents-fab:hover { transform: translateY(-2px) scale(1.03); }
.visieagents-collapsed .visieagents-fab { display: inline-flex; }

/* Painel do assistente maximizado (tela cheia) */
.visieagents-max .visieagents-panel {
    position: fixed;
    inset: 0;
    z-index: 90;
    border-left: none;
    display: flex;
}
.visieagents-max .visieagents-messages,
.visieagents-max .visieagents-composer,
.visieagents-max .visieagents-suggestions { max-width: 820px; width: 100%; margin-left: auto; margin-right: auto; }

/* --- Cabeçalho de página --- */

.page-head { margin-bottom: 1.75rem; }
.page-head .page-eyebrow {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.35rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.page-head .page-title { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text); margin: 0; }
.page-head .page-sub { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.3rem; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --- KPI cards --- */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    display: block;
}
a.kpi-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--border); }
.kpi-card .kpi-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card .kpi-value { font-size: 1.65rem; font-weight: 600; color: var(--text); letter-spacing: -0.02em; margin: 0.35rem 0 0.25rem; }
.kpi-delta { font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }
.kpi-delta.up { color: #2e9e4f; }
.kpi-delta.down { color: var(--accent); }
[data-theme="dark"] .kpi-delta.up { color: #4caf50; }

/* --- Cards genéricos do protótipo --- */

.proto-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.35rem;
}
.proto-card .card-title { font-size: 0.95rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.proto-card .card-title .muted { font-weight: 400; color: var(--text-muted); font-size: 0.82rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }

/* --- Gráficos (SVG placeholder) --- */

.chart-wrap { margin-top: 0.85rem; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-line-fill { fill: var(--accent-glow); opacity: 0.5; }
.chart-line-stroke { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--accent); }
.chart-grid { stroke: var(--border-subtle); stroke-width: 1; }
.chart-bar { fill: var(--accent); transition: opacity 0.2s ease; }
.chart-bar.alt { fill: var(--text-secondary); opacity: 0.55; }
.chart-label { fill: var(--text-muted); font-size: 11px; font-family: inherit; }
.chart-axis { fill: var(--text-muted); font-size: 10px; font-family: inherit; }
.donut-track { fill: none; stroke: var(--border-subtle); stroke-width: 14; }
.donut-value { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round; }

.bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.7rem; font-size: 0.85rem; }
.bar-row .bar-name { width: 130px; flex-shrink: 0; color: var(--text-secondary); text-align: right; }
.bar-row .bar-track { flex: 1; height: 0.6rem; background: var(--bg-alt); border-radius: 60px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--accent); border-radius: 60px; }
.bar-row .bar-val { width: 48px; flex-shrink: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* --- Listas de itens (ferramentas, dashboards, etc.) --- */

.item-list { display: flex; flex-direction: column; gap: 0.6rem; }
.item-row {
    display: flex; align-items: center; gap: 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.item-row:hover { border-color: var(--border); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.item-row .item-ico {
    width: 2.4rem; height: 2.4rem; flex-shrink: 0; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.item-row .item-body { min-width: 0; flex: 1; }
.item-row .item-name { display: block; font-weight: 500; color: var(--text); font-size: 0.9rem; }
.item-row .item-desc { display: block; color: var(--text-muted); font-size: 0.82rem; margin-top: 0.1rem; }
.item-row .item-meta { margin-left: auto; flex-shrink: 0; color: var(--text-muted); font-size: 0.78rem; text-align: right; }
.item-row .fa-chevron-right { color: var(--text-muted); font-size: 0.72rem; }

/* --- Cards de conector / agente --- */

.tile {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
}
.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--border); }
.tile .tile-top { display: flex; align-items: center; gap: 0.75rem; }
.tile .tile-logo {
    width: 2.6rem; height: 2.6rem; border-radius: var(--radius-md); flex-shrink: 0;
    background: var(--bg-alt); color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.tile .tile-name { font-weight: 600; color: var(--text); font-size: 0.92rem; }
.tile .tile-sub { color: var(--text-muted); font-size: 0.78rem; }
.tile .tile-desc { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.45; }
.tile .tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* --- Status badges --- */

.status {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
    padding: 0.2rem 0.6rem; border-radius: 60px;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.on { color: #2e9e4f; background: rgba(46,158,79,0.1); }
.status.off { color: var(--text-muted); background: var(--bg-alt); }
.status.warn { color: #c68a00; background: rgba(198,138,0,0.1); }
.status.err { color: var(--accent); background: var(--accent-soft); }
[data-theme="dark"] .status.on { color: #4caf50; }

/* --- Pill tabs (abas do tema) --- */

.pill-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1.75rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0; }
.pill-tab {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem; color: var(--text-muted); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.pill-tab:hover { color: var(--text); }
.pill-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.pill-tab i { font-size: 0.8rem; }

/* --- Estado vazio --- */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    background: var(--card-bg);
}
.empty-state .empty-ico { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.empty-state .empty-title { color: var(--text); font-weight: 600; font-size: 1rem; margin-bottom: 0.35rem; }
.empty-state p { font-size: 0.88rem; margin-bottom: 1.1rem; }

/* --- Breadcrumb protótipo --- */

.proto-crumb { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.proto-crumb a { color: var(--text-muted); text-decoration: none; }
.proto-crumb a:hover { color: var(--accent); }
.proto-crumb .sep { opacity: 0.5; }

/* --- Onboarding --- */

.onboarding-wrap { max-width: 880px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.steps { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2.5rem; justify-content: center; }
.step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.step .step-num {
    width: 1.6rem; height: 1.6rem; border-radius: 60px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border); font-size: 0.78rem; font-weight: 600;
}
.step.is-active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.is-done .step-num { background: #2e9e4f; border-color: #2e9e4f; color: #fff; }
.step.is-active { color: var(--text); font-weight: 500; }
.step-line { width: 2.5rem; height: 1.5px; background: var(--border); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.85rem; }
.choice {
    display: flex; align-items: flex-start; gap: 0.75rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-md);
    padding: 1rem; cursor: pointer; background: var(--card-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.choice:hover { border-color: var(--text-muted); }
.choice.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.choice .choice-ico { color: var(--accent); font-size: 1.1rem; margin-top: 2px; }
.choice .choice-name { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.choice .choice-desc { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.15rem; }

/* --- Responsive app shell --- */

@media screen and (max-width: 1100px) {
    .app-shell { grid-template-columns: 248px minmax(0,1fr) 0; }
    .app-shell:not(.visieagents-collapsed) .visieagents-panel {
        position: fixed; inset: 0; z-index: 90; border-left: none;
    }
    .visieagents-fab { display: inline-flex; }
}

@media screen and (max-width: 768px) {
    .app-shell { grid-template-columns: minmax(0,1fr); }
    .app-sidebar {
        position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 100;
        transform: translateX(-100%); transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }
    .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
    .app-content { padding: 1.25rem 1.1rem 4rem; }
}

/* --- Mock do WhatsApp --- */

.phone {
    width: 340px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 34px;
    background: #0c0c0c;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.phone-screen {
    border-radius: 24px;
    overflow: hidden;
    background: #e5ddd5;
    display: flex;
    flex-direction: column;
    height: 640px;
}
.wa-header {
    background: #075E54;
    color: #fff;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.wa-header .wa-avatar {
    width: 2.1rem; height: 2.1rem; border-radius: 60px;
    background: linear-gradient(135deg, var(--accent), #d4323e);
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem;
    flex-shrink: 0;
}
.wa-header .wa-name { font-weight: 600; font-size: 0.92rem; line-height: 1.1; }
.wa-header .wa-sub { font-size: 0.72rem; opacity: 0.85; }
.wa-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 0.7rem;
    background-color: #e5ddd5;
    background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.wa-msg {
    max-width: 82%;
    padding: 0.45rem 0.6rem 0.35rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #111;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
    position: relative;
    white-space: pre-line;
}
.wa-msg .wa-time { font-size: 0.62rem; color: rgba(0,0,0,0.45); float: right; margin: 0.35rem 0 0 0.5rem; }
.wa-msg.from-visieagents { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.wa-msg.from-user { align-self: flex-end; background: #dcf8c6; border-top-right-radius: 2px; }
.wa-msg strong { font-weight: 700; color: inherit; }
.wa-input {
    flex-shrink: 0;
    background: #f0f0f0;
    padding: 0.5rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wa-input .wa-field {
    flex: 1; background: #fff; border-radius: 60px; padding: 0.5rem 0.9rem;
    color: #8a8f9a; font-size: 0.8rem;
}
.wa-input .wa-send {
    width: 2.2rem; height: 2.2rem; border-radius: 60px; background: #075E54; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wa-body::-webkit-scrollbar { width: 4px; }
.wa-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 4px; }

/* --- Utilidades --- */
.text-muted { color: var(--text-muted) !important; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.stack > * + * { margin-top: 1.25rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mini-chip { font-size: 0.74rem; color: var(--text-secondary); background: var(--bg-alt); border-radius: 60px; padding: 0.2rem 0.65rem; }

/* --- Responsive (existente) --- */

@media screen and (max-width: 768px) {
    .hero-landing {
        padding: 4rem 1.5rem 3.5rem;
    }

    .hero-landing::before {
        width: 300px;
        height: 300px;
    }

    .form-card {
        padding: 1.75rem 1.25rem;
        border: none;
        box-shadow: none;
        background-color: transparent;
    }

    [data-theme="dark"] .form-card {
        background-color: transparent;
    }

    .section {
        padding: 2rem 1rem;
    }

    body > .toast-stack {
        top: calc(3.75rem + 1rem + env(safe-area-inset-top));
        right: calc(1.25rem + env(safe-area-inset-right));
        left: calc(1.25rem + env(safe-area-inset-left));
        width: auto;
    }

    .card:hover {
        transform: none;
    }
}

/* =====================================================================
   App Real (chat, conversas) (shell 2 colunas, chat do agente, telas de dados)
   ===================================================================== */

.app-shell.no-visieagents { grid-template-columns: 248px minmax(0, 1fr); }

/* Dropdown do usuário na topbar */
.topbar-user .dropdown-trigger { cursor: pointer; }
.topbar-user .dropdown-menu { min-width: 12rem; }

/* Linha chave/valor em cards de status */
.kv { padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); }

/* Chip de método HTTP */
.method-chip {
    display: inline-block; font-family: ui-monospace, monospace; font-size: 0.7rem;
    font-weight: 700; letter-spacing: 0.04em; padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm); vertical-align: middle;
}
.method-get { background: rgba(46, 158, 79, 0.14); color: #2e9e4f; }

.result-pre {
    max-height: 420px; overflow: auto; font-size: 0.82rem; line-height: 1.5;
    background: var(--bg-alt); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 0.9rem;
}

/* Cabeçalho do agente */
.agent-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.agent-logo { width: 3rem; height: 3rem; font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent), #d4323e); color: #fff; }
.agent-head-body { flex: 1; min-width: 0; }
.agent-name { font-weight: 600; font-size: 1.05rem; flex: 1; min-width: 0; }
.agent-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* Chat */
.agent-chat {
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); height: calc(100vh - 340px); min-height: 380px;
}
/* Na aba do agente, o conteúdo preenche a viewport e só as mensagens rolam;
   o composer fica sempre visível no rodapé (sem rolagem de página). */
.app-content.is-chat { display: flex; flex-direction: column; overflow: hidden; padding: 1.25rem 2.25rem 1.5rem; }
.app-content.is-chat .pill-tabs { margin-bottom: 0.75rem; }
.app-content.is-chat .chat-layout { flex: 1 1 auto; min-height: 0; }
.chat-layout > .agent-chat { flex: 1 1 auto; height: auto; min-height: 0; }
.agent-head.compact { margin-bottom: 0.85rem; }

/* Layout: lista de conversas + chat */
.chat-layout { display: flex; gap: 1rem; min-height: 0; }

.conv-list {
    flex: 0 0 240px; display: flex; flex-direction: column; gap: 0.75rem;
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); padding: 0.75rem; overflow: hidden;
}
.conv-new { width: 100%; justify-content: center; }
.conv-items { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conv-item { display: flex; align-items: center; border-radius: var(--radius-md); }
.conv-item:hover { background: var(--bg-alt); }
.conv-item.is-active { background: var(--accent-soft); }
.conv-link {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.6rem; color: var(--text-secondary); font-size: 0.85rem;
}
.conv-item.is-active .conv-link { color: var(--accent); font-weight: 600; }
.conv-link i { flex-shrink: 0; opacity: 0.7; }
.conv-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-del {
    flex-shrink: 0; border: none; background: none; cursor: pointer;
    color: var(--text-muted); padding: 0.4rem 0.55rem; border-radius: var(--radius-sm);
    opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.conv-item:hover .conv-del, .conv-item.is-active .conv-del { opacity: 1; }
.conv-del:hover { color: var(--accent); background: var(--accent-soft); }

/* Modal de confirmação */
.confirm-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.confirm-modal[hidden] { display: none; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.confirm-card {
    position: relative; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1.5rem; max-width: 440px; width: 90%;
}
.confirm-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 1.05rem; margin-bottom: 0.6rem; }
.confirm-title i { color: var(--accent); }
.confirm-card p { font-size: 0.9rem; line-height: 1.5; color: var(--text-secondary); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

@media (max-width: 720px) {
    .chat-layout { flex-direction: column; }
    .conv-list { flex: 0 0 auto; max-height: 32vh; }
}
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
.chat-empty { margin: auto; text-align: center; color: var(--text-muted); max-width: 340px; }
.chat-empty i { font-size: 1.6rem; opacity: 0.5; margin-bottom: 0.5rem; display: block; }
.chat-composer {
    display: flex; gap: 0.5rem; align-items: flex-end;
    padding: 0.75rem; border-top: 1px solid var(--border); background: var(--bg-alt);
}
.chat-composer textarea {
    flex: 1; resize: none; border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem; font: inherit; font-size: 0.92rem; background: var(--bg);
    color: var(--text); max-height: 140px; line-height: 1.4;
}
.chat-composer textarea:focus { outline: none; border-color: var(--accent); }

/* Markdown dentro das bolhas */
.chat-msg .bubble > *:first-child { margin-top: 0; }
.chat-msg .bubble > *:last-child { margin-bottom: 0; }
.chat-msg .bubble p { margin: 0 0 0.6rem; }
.chat-msg .bubble h1, .chat-msg .bubble h2, .chat-msg .bubble h3 {
    font-size: 1rem; font-weight: 700; margin: 0.6rem 0 0.4rem;
}
.chat-msg .bubble ul, .chat-msg .bubble ol { margin: 0 0 0.6rem 1.1rem; }
.chat-msg .bubble li { margin: 0.15rem 0; }
.chat-msg .bubble code {
    font-family: ui-monospace, monospace; font-size: 0.85em;
    background: var(--border-subtle); padding: 0.05rem 0.3rem; border-radius: 4px;
}
.chat-msg .bubble pre {
    background: var(--bg-alt); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 0.7rem; overflow-x: auto; margin: 0 0 0.6rem;
}
.chat-msg .bubble pre code { background: none; padding: 0; }
.chat-msg .bubble table { border-collapse: collapse; width: 100%; margin: 0 0 0.6rem; font-size: 0.88em; }
.chat-msg .bubble th, .chat-msg .bubble td { border: 1px solid var(--border); padding: 0.3rem 0.5rem; text-align: left; }

/* Indicador de digitação */
.typing { display: inline-flex; gap: 0.25rem; align-items: center; }
.chat-msg .bubble .typing { display: flex; margin-top: 0.5rem; }
.chat-msg .bubble .typing:first-child { margin-top: 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); opacity: 0.4; animation: typing-bounce 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Botão de escolha (onboarding empresa) */
.choice-button { display: flex; align-items: center; gap: 0.75rem; background: var(--bg); }
.choice-button:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }

@media (max-width: 768px) {
    .app-shell.no-visieagents { grid-template-columns: minmax(0, 1fr); }
    .agent-chat { height: calc(100vh - 300px); }
}

/* Menu de ambiente na topbar */
.topbar-env { margin-right: 0.25rem; }
.topbar-env .env-btn {
    border-radius: 60px; border: 1px solid var(--border); background: var(--bg);
    color: var(--text-secondary); font-weight: 500; max-width: 220px;
}
.topbar-env .env-btn:hover { border-color: var(--accent); color: var(--accent); }
.topbar-env .env-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.topbar-env .dropdown-item.is-active { color: var(--accent); font-weight: 600; }

/* Tag "Executando ferramenta: m:s" — entra no fluxo do texto, na ordem das chamadas */
.chat-msg .bubble .tool-status { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-msg .bubble .tool-status:not(:empty) { margin: 0.5rem 0; }
.chat-msg .bubble .tool-status:first-child { margin-top: 0; }
.chat-msg .bubble .tool-status:last-child { margin-bottom: 0; }
.tool-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem;
    color: var(--accent); background: var(--accent-soft);
    border: 1px solid var(--accent-glow); padding: 0.2rem 0.6rem; border-radius: 60px;
}
.tool-chip .t { font-variant-numeric: tabular-nums; opacity: 0.85; }

/* Chip após a execução: fica visível, verde suave = sucesso; clique abre o resultado */
.tool-chip.is-done, .tool-chip.is-error { cursor: pointer; user-select: none; }
.tool-chip.is-done {
    color: #2b8a3e; background: rgba(64, 192, 87, 0.12); border-color: rgba(64, 192, 87, 0.35);
}
.tool-chip.is-done:hover { background: rgba(64, 192, 87, 0.22); }
[data-theme="dark"] .tool-chip.is-done { color: #69db7c; }
.tool-chip.is-error:hover { background: var(--accent-glow); }

/* Dashboards */
.dash-new-form { display: flex; gap: 0.5rem; align-items: center; }
.dash-new-form .input { width: 220px; }
.dash-actions { flex-wrap: wrap; gap: 0.75rem; }
.dash-buttons { display: flex; gap: 0.5rem; align-items: center; }
.dash-area { display: flex; flex-direction: column; gap: 1rem; }
.dash-widget .widget-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.widget-actions { display: flex; gap: 0.6rem; align-items: center; opacity: 0.55; }
.dash-widget:hover .widget-actions { opacity: 1; }
.widget-actions a, .widget-actions button {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--text-muted); font-size: 0.85rem;
}
.widget-actions a:hover, .widget-actions button:hover { color: var(--accent); }
.widget-erro { color: var(--accent); font-size: 0.85rem; }
.dash-widget.is-indicadores { background: none; border: none; padding: 0; box-shadow: none; }
.dash-widget.is-indicadores .kpi-grid { margin-bottom: 0; }
.dash-widget td.num, .dash-widget th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-widget td.neg { color: var(--accent) !important; }   /* vence o !important de .table td */
.dash-widget .chart-block { max-width: none; border: 0; padding: 0; }

/* Relatórios */
.report-form { max-width: 560px; }
.freq-options { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.freq-options .radio, .freq-options .checkbox { margin: 0; }

/* Editor de widget */
.widget-form .wf-hint { font-size: 0.82rem; margin-bottom: 0.75rem; }
.wf-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.wf-grow { flex: 1; }
.wf-tool { border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 0.75rem; margin-bottom: 0.75rem; }
.wf-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem; }
.wf-params .field, .wf-field { margin-bottom: 0.25rem; }
.wf-remove { flex: 0 0 auto; }
.wf-tool-idx { flex: 0 0 auto; }

/* Gráfico entregue pelo agente (ferramenta chart_js) */
.chart-block {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 0.75rem; margin: 0.5rem 0; max-width: 640px;
}
.chart-block canvas { max-height: 300px; }

/* Popup do resultado da ferramenta (JSON como tabelas aninhadas) */
.tool-result-card { max-width: 720px; }
.tool-result-card .confirm-title i { color: #2b8a3e; }
[data-theme="dark"] .tool-result-card .confirm-title i { color: #69db7c; }
.tool-result-body { max-height: 60vh; overflow: auto; font-size: 0.82rem; margin-top: 0.5rem; }
.tool-result-body pre {
    background: var(--bg-alt); border-radius: var(--radius-md); padding: 0.75rem;
    white-space: pre-wrap; word-break: break-word;
}
.json-table { border-collapse: collapse; width: 100%; }
.json-table th, .json-table td {
    border: 1px solid var(--border); padding: 0.3rem 0.5rem;
    text-align: left; vertical-align: top;
}
.json-table th { background: var(--bg-alt); font-weight: 600; }
.json-null { color: var(--text-muted); }
