:root {
    --bg-body: #0f172a;
    --bg-card: #ffffff;
    --bg-column: #16213a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --color-aguardando: #38bdf8;
    /* Sky 400 */
    --color-aceito: #fbbf24;
    /* Amber 400 */
    --color-inicio: #4ade80;
    /* Green 400 */
    --glass-border: rgba(255, 255, 255, 0.1);
}

:root.light-mode {
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-column: #e5e7eb;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-border: rgba(0, 0, 0, 0.1);
    --color-aguardando: #0ea5e9;
    /* Sky 500 for better contrast on light */
    --color-aceito: #f59e0b;
    /* Amber 500 */
    --color-inicio: #22c55e;
    /* Green 500 */
    /* Sidebar expandida: branco no light-mode */
    --sidebar-expanded-bg: rgba(255, 255, 255, 0.98);
}

/* Optimize Mode: Hide Summary and KPIs */
body.optimized-mode .summary-bar,
body.optimized-mode .kpi-row {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
    background: var(--bg-body);
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(74, 222, 128, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Main Layout --- */
.main-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar-main {
    width: 64px;
    background: var(--sidebar-bg, rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1200;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
        padding 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
        background 0.3s ease 0.2s,
        box-shadow 0.3s ease 0.2s;
    overflow: hidden;
}

/* Estado expandido (hover) */
.sidebar-main:hover {
    width: 240px;
    padding: 1.5rem 1rem;
    /* Expandida: usa --sidebar-expanded-bg (dark-mode = igual ao collapsed, light-mode = branco) */
    background: var(--sidebar-expanded-bg, var(--sidebar-bg, rgba(15, 23, 42, 0.98)));
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    transition-delay: 0.2s;
}

/* Collapsed state: sidebar ALWAYS dark */
.sidebar-main .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    min-height: 40px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Favicon (collapsed) e Logo (expanded) */
.sidebar-logo .sidebar-favicon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.sidebar-logo .sidebar-full-logo {
    width: 160px;
    height: auto;
    object-fit: contain;
    opacity: 0;
    position: absolute;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.sidebar-main:hover .sidebar-logo .sidebar-favicon {
    opacity: 0;
    width: 0;
}

.sidebar-main:hover .sidebar-logo .sidebar-full-logo {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

/* Versão do app na sidebar */
.sidebar-version {
    font-size: 0.85rem;
    color: var(--sidebar-muted-color, rgba(226, 232, 240, 0.7));
    text-align: center;
    letter-spacing: 0.5px;
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.sidebar-main:hover .sidebar-version {
    opacity: 1;
}

/* Light mode: sidebar expandida é branca → versão em preto */
:root.light-mode .sidebar-main:hover .sidebar-version {
    color: #0f172a;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sidebar-border-color, rgba(255, 255, 255, 0.08));
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem;
    border-radius: 10px;
    color: var(--sidebar-nav-color, rgba(148, 163, 184, 0.9));
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link i {
    font-size: 1.25rem;
    flex-shrink: 0;
    min-width: 1.25rem;
    text-align: center;
}

/* Texto do nav-link: oculto quando collapsed, visível no hover */
.nav-link span,
.nav-link:not(:has(i))::after {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-main:hover .nav-link span {
    opacity: 1;
}

.nav-link:hover,
.nav-link.active {
    background: var(--sidebar-hover-bg, rgba(255, 255, 255, 0.08));
    color: var(--sidebar-nav-active-color, #e2e8f0);
    border-color: var(--sidebar-border-color, rgba(255, 255, 255, 0.1));
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(74, 222, 128, 0.1));
    border-color: rgba(56, 189, 248, 0.25);
    color: var(--sidebar-nav-active-color, #f0f9ff);
}

/* Light mode: sidebar expandida branca + texto preto */
:root.light-mode .sidebar-main:hover {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

:root.light-mode .sidebar-main:hover .nav-link {
    color: #0f172a;
}

:root.light-mode .sidebar-main:hover .nav-link:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #000000;
}

:root.light-mode .sidebar-main:hover .nav-link.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(74, 222, 128, 0.08));
    color: #0f172a;
}

:root.light-mode .sidebar-main:hover .sidebar-footer {
    border-top-color: rgba(0, 0, 0, 0.12);
}

/* Conteúdo principal: margem fixa para sidebar collapsed */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-body);
    margin-left: 64px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── sidebar-pinned: sidebar fixada expandida (clique no hamburguer) ── */
/* Espelha todos os estados de .sidebar-main:hover para funcionar sem mouse */

.main-layout.sidebar-pinned .sidebar-main {
    width: 240px;
    padding: 1.5rem 1rem;
    background: var(--sidebar-expanded-bg, var(--sidebar-bg, rgba(15, 23, 42, 0.98))) !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    transition-delay: 0s !important;
}

.main-layout.sidebar-pinned .content-area {
    margin-left: 240px;
}

/* Favicon oculto → logo visível */
.main-layout.sidebar-pinned .sidebar-main .sidebar-logo .sidebar-favicon {
    opacity: 0;
    width: 0;
}

.main-layout.sidebar-pinned .sidebar-main .sidebar-logo .sidebar-full-logo {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

/* Versão visível */
.main-layout.sidebar-pinned .sidebar-main .sidebar-version {
    opacity: 1;
}

/* Textos dos nav-links visíveis (span) */
.main-layout.sidebar-pinned .sidebar-main .nav-link span {
    opacity: 1;
}

/* Light mode pinned */
:root.light-mode .main-layout.sidebar-pinned .sidebar-main {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

:root.light-mode .main-layout.sidebar-pinned .sidebar-main .nav-link {
    color: #0f172a;
}

:root.light-mode .main-layout.sidebar-pinned .sidebar-main .nav-link:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #000000;
}

:root.light-mode .main-layout.sidebar-pinned .sidebar-main .nav-link.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(74, 222, 128, 0.08));
    color: #0f172a;
}

:root.light-mode .main-layout.sidebar-pinned .sidebar-main .sidebar-footer {
    border-top-color: rgba(0, 0, 0, 0.12);
}

:root.light-mode .main-layout.sidebar-pinned .sidebar-main .sidebar-version {
    color: #0f172a;
}

/* Botão hambúrguer: indicador visual quando sidebar está pinned */
#desktopToggleBtn.sidebar-pin-active {
    color: var(--accent-color, #38bdf8);
    background: rgba(56, 189, 248, 0.12);
    border-radius: 8px;
}

.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.view-pane {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}

.view-pane.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Landing Page */
#view-landing {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    flex: 1;
    height: 100%;
}

#view-landing::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
    animation: rotateBg 20s linear infinite;
}

@keyframes rotateBg {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.landing-logo {
    width: 350px;
    height: auto;
    max-width: 80%;
    z-index: 1;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.1));
    animation: pulseLogo 3s ease-in-out infinite;
}

@keyframes pulseLogo {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}



/* Sidebar Toggle Button - manter para views internas */
.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

:root.light-mode .sidebar-toggle-btn {
    color: #64748b;
}

:root.light-mode .sidebar-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

@media (max-width: 992px) {
    .sidebar-main {
        display: none !important;
        /* Mobile will use the drawer */
    }

    .content-area {
        margin-left: 0 !important;
    }
}

/* Responsive Scaling for Tablets */
@media (max-width: 1200px) {
    html {
        font-size: 14px;
    }

    .conveyor-title {
        font-size: 1rem;
    }

    .column-title {
        font-size: 0.9rem;
    }

    .bed-value {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 13px;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .summary-value {
        font-size: 1.3rem;
    }
}

/* --- KPI Bar (Responsive) --- */
.kpi-row {
    margin-bottom: 2rem;
}

.kpi-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
}

.kpi-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    justify-content: center;
}

.kpi-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.kpi-header .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* --- Header --- */
.main-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.8);
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: background 0.3s;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: flex-end;
}

html.light-mode .main-header {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Toggle Theme Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.light-mode .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.light-mode .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-main);
    /* Color and shadow removed by user request */
    transition: width 0.3s ease, height 0.3s ease;
    position: relative;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    /* Prevent image drag interfere with resize */
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#clock {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--glass-border);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-aguardando), var(--color-inicio));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.light-mode .user-avatar {
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Botão de logout ao lado do avatar */
.btn-logout-header {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-logout-header:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.light-mode .btn-logout-header {
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

.light-mode .btn-logout-header:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}


/* --- Summary Bar --- */
.summary-bar {
    padding: 1rem 2rem;
    display: flex;
    gap: 1.5rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    backdrop-filter: blur(5px);
}

.summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.color-aguardando-text {
    background: #ffa474;
    color: #000;
    padding: 2px 10px;
    border-radius: 6px;
}

.color-aceito-text {
    background: #6bd2f9;
    color: #000;
    padding: 2px 10px;
    border-radius: 6px;
}

.color-inicio-text {
    background: #98d67f;
    color: #000;
    padding: 2px 10px;
    border-radius: 6px;
}

/* --- Dashboard Columns (Bootstrap Grid Handled) --- */
main {
    padding-top: 1rem;
}

.conveyor-side {
    margin-bottom: 2rem;
    min-width: 0;
}

.conveyor-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.column {
    background: var(--bg-column);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    max-height: calc(100vh - 180px);
}

.column-header {
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

#col-dieta-ENABLE .column-header,
#col-transporte-ENABLE .column-header {
    background-color: #ffa474;
    color: #000;
}

#col-dieta-ACCEPT .column-header,
#col-transporte-ACCEPT .column-header {
    background-color: #6bd2f9;
    color: #000;
}

#col-dieta-START .column-header,
#col-transporte-START .column-header {
    background-color: #98d67f;
    color: #000;
}

.column-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: none;
}

.column-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
}

.card-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Custom Scrollbar */
.card-list::-webkit-scrollbar {
    width: 6px;
}

.card-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.card-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.card-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* --- Event Card (Novo Design Baseado em Imagem) --- */
.event-card {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    color: #1e293b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    overflow: visible;
    /* Permitir badges e conteudo expandido */
    border-left: 12px solid #10b981;
    border-right: 12px solid #10b981;
    position: relative;
    height: auto;
    min-height: auto;
    /* Altura ajustavel pelo conteudo */
    padding-bottom: 6px;
    /* Reduzido de 15px */
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.5);
}

/* Variantes de Barra lateral de SLA (Esquerda - Atividade, Direita - Total) */
.card-sla-activity-green {
    border-left-color: #10b981 !important;
}

.card-sla-activity-yellow {
    border-left-color: #f1f50a !important;
}

.card-sla-activity-orange {
    border-left-color: #ff9900 !important;
}

.card-sla-activity-red {
    border-left-color: #dd2c2c !important;
}

.card-sla-total-green {
    border-right-color: #10b981 !important;
}

.card-sla-total-yellow {
    border-right-color: #f1f50a !important;
}

.card-sla-total-orange {
    border-right-color: #ff9900 !important;
}

.card-sla-total-red {
    border-right-color: #dd2c2c !important;
}

.card-content {
    flex: 1;
    padding: 0.25rem 0.5rem;
    /* Reduzido de 0.5rem 0.75rem */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0rem;
    padding-top: 4px;
    /* Reduzido de 10px */
    /* Espaco para o badge nao sobrepor */
}

.activation-time {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e293b;
    opacity: 0.9;
}

.card-patient-line {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e293b;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

.warning-icon {
    font-size: 1.0rem;
    line-height: 1;
    display: none;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

.card-warning-yellow .warning-icon,
.card-warning-orange .warning-icon,
.card-warning-red .warning-icon {
    display: block;
}

.card-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 0rem;
}

.bed-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.bed-value {
    font-size: 0.8rem !important;
    font-weight: 700;
    color: #000;
    line-height: 1.1;
    width: 100%;
}

.service-box {
    display: none;
}

.card-times {
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: 100%;
}

.time-box {
    border: 2px solid #444;
    border-radius: 8px;
    padding: 0px 4px;
    /* Reduzido de 1px 6px */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.box-atividade {
    background: #b8e6b8;
}

.box-total {
    background: transparent;
}

.time-box-label {
    font-size: 0.6rem;
    font-weight: 400;
    color: #000;
    text-transform: capitalize;
    margin-bottom: -3px;
}

.time-box-value {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 92%;
    max-width: 740px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s;
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

/* --- Side Menu (Drawer) --- */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: var(--bg-body);
    border-right: 1px solid var(--glass-border);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 2001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
}

.side-menu-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.side-menu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.side-menu-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-menu-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.side-menu-item i {
    font-size: 1.4rem;
    color: var(--color-aguardando);
}

.side-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-color: var(--color-aguardando);
}

/* Light Mode Side Menu */
.light-mode .side-menu {
    background: #ffffff;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.light-mode .side-menu-item {
    background: rgba(0, 0, 0, 0.03);
    color: #1e293b;
}

.light-mode .side-menu-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.modal-body {
    padding: 1.5rem;
}

/* --- Novo Layout do Grid de Informações do Modal --- */
.modal-info-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.modal-info-grid {
    grid-column: span 2;
    display: grid !important;
}

@media (max-width: 576px) {
    .modal-info-grid-container {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .modal-info-grid {
        grid-column: span 1;
    }
}

.modal-info-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 0 !important; /* Reseta margens para a grid */
    display: flex !important;
    flex-direction: column !important; /* Sempre em coluna, evita sobreposição horizontal */
    align-items: flex-start !important;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.modal-info-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.light-mode .modal-info-row {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-mode .modal-info-row:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.modal-label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0 !important;
}

.modal-label i {
    font-size: 0.95rem;
    color: var(--color-aguardando);
}

.modal-value {
    font-size: 1.05rem !important;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
}

.modal-value.highlight {
    font-size: 1.15rem !important;
    color: var(--color-aguardando);
}

/* Ajustes no status badge dentro do modal */
.modal-value.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-value.status-badge.status-ENABLE {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--color-aguardando);
}

.modal-value.status-badge.status-ACCEPT {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--color-aceito);
}

.modal-value.status-badge.status-START {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--color-inicio);
}

.modal-value.status-badge.status-FINISHED {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-muted);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-action {
    background: var(--color-aguardando);
    color: #0f172a;
}

/* Light Mode Overrides for Modals */
.light-mode .modal-container {
    background: #ffffff;
    color: #1e293b;
}

.light-mode .modal-header {
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .modal-close {
    color: #64748b;
}

.light-mode .modal-close:hover {
    color: #0f172a;
}

.light-mode .modal-label {
    color: #64748b;
}

.light-mode .modal-footer {
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .btn-secondary {
    background: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.light-mode .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* ── Modal: responsividade base ── */
.modal-container {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}

.modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Tablet Portrait (≤ 1024px) ── */
@media (max-width: 1024px) {
    .modal-container {
        width: 96%;
        max-width: 600px;
        max-height: 90vh;
        border-radius: 12px;
    }
    .modal-header { padding: 1rem 1.25rem; }
    .modal-body   { padding: 1rem 1.25rem; }
    .modal-footer { padding: 1rem 1.25rem; }
    .modal-title  { font-size: 1.1rem; }
}

/* ── Tablet / Mobile Landscape (altura ≤ 560px) ── */
@media (max-height: 560px) and (orientation: landscape) {
    .modal-overlay {
        align-items: flex-start;
        padding: 4px 0;
    }
    .modal-container {
        width: 96%;
        max-width: 680px;
        max-height: 98vh;
        border-radius: 10px;
        margin: auto;
    }
    .modal-header {
        padding: 0.6rem 1rem;
    }
    .modal-title {
        font-size: 0.95rem;
    }
    .modal-body {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .modal-info-grid-container {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    .modal-info-row {
        padding: 0.5rem 0.75rem;
    }
    .modal-value {
        font-size: 0.9rem !important;
    }
    .modal-value.highlight {
        font-size: 1rem !important;
    }
    .modal-footer {
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    /* Timeline mais compacta */
    .event-timeline {
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    .timeline-item {
        padding-bottom: 0.75rem;
        gap: 0.75rem;
    }
    .modal-tl-track {
        gap: 0.5rem;
    }
    /* Remarks compacto */
    .modal-remarks-section {
        margin-top: 0.5rem;
    }
}

/* ── Mobile Portrait pequeno (≤ 480px) ── */
@media (max-width: 480px) {
    .modal-container {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 88vh;
        position: fixed;
        bottom: 0;
        left: 0;
    }
    .modal-overlay {
        align-items: flex-end;
    }
}

/* --- Responsiveness --- */
@media (max-width: 1400px) {
    main {
        gap: 1rem;
        padding: 0.5rem;
    }

    .kpi-row {
        padding: 0 1rem !important;
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    .conveyor-title {
        font-size: 1.2rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .column-title {
        font-size: 0.9rem;
    }

    .bed-value {
        font-size: 1.3rem;
    }

    .service-box {
        font-size: 0.9rem;
        padding: 4px 10px;
    }

    .time-box {
        min-width: 80px;
        padding: 2px 4px;
    }

    .time-box-value {
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) {
    .kpi-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .kpi-group {
        padding: 0.5rem;
        border-radius: 10px;
    }

    .summary-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .summary-card {
        min-width: 120px;
        padding: 0.5rem 1rem;
    }

    .summary-value {
        font-size: 1.2rem;
    }

    .conveyor-side {
        gap: 0.5rem;
    }
}

@media (max-width: 900px) {
    main {
        flex-direction: column;
    }

    .conveyor-side {
        min-width: 100%;
        border-bottom: 2px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 1rem;
    }
}

@media (max-width: 768px) {

    /* ─── Header Mobile ─── */
    .main-header {
        padding: 0.5rem 0.75rem !important;
        grid-template-columns: auto 1fr auto;
    }

    .header-center .brand-name {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 45vw;
    }

    .header-center .brand-icon {
        width: 32px;
        height: 32px;
    }

    .header-right {
        gap: 0.5rem;
    }

    .header-right .top-actions {
        display: flex;
        gap: 0.25rem;
    }

    .header-right .theme-toggle-btn {
        width: 32px;
        height: 32px;
    }

    .header-right .user-profile {
        display: none !important;
    }

    #clock {
        font-size: 0.85rem;
        font-weight: 600;
    }

    /* ─── Summary / KPI / Metrics ─── */
    .summary-bar-container {
        padding: 0 0.5rem !important;
    }

    .summary-card {
        min-width: calc(50% - 0.5rem);
        padding: 0.5rem 0.75rem;
    }

    .summary-value {
        font-size: 1.1rem;
    }

    .kpi-row {
        padding: 0 0.5rem !important;
    }

    .kpi-group {
        padding: 0.5rem;
    }

    .kpi-card {
        padding: 0.5rem;
    }

    .kpi-value {
        font-size: 1rem;
    }

    .kpi-label {
        font-size: 0.65rem;
    }

    /* ─── Search & Filters ─── */
    .search-filter-row {
        padding: 0 0.5rem !important;
    }

    .search-filter-row .row {
        flex-direction: column !important;
    }

    .search-filter-row .col-12.col-md-5,
    .search-filter-row .col-12.col-md-7 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .search-filter-row .col-12.col-md-7 {
        justify-content: flex-start !important;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    /* ─── Nutrição Kanban ─── */
    #view-nutricao main.container-fluid {
        padding: 0 0.5rem !important;
    }

    .conveyor-side {
        min-width: 100%;
        gap: 0.5rem;
    }

    .conveyor-title {
        font-size: 0.85rem;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .column {
        min-height: 250px;
    }

    .card-list {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    /* Card interno */
    .card-content {
        padding: 0.25rem 0.4rem;
    }

    .bed-value {
        font-size: 0.75rem !important;
    }

    .time-box {
        min-width: 0;
        flex: 1;
        padding: 1px 3px;
    }

    .time-box-value {
        font-size: 0.8rem;
    }

    .time-box-label {
        font-size: 0.5rem;
    }

    /* ─── Metrics Row (Nutrição) ─── */
    .metrics-row.container-fluid {
        padding: 0 0.5rem !important;
    }

    /* ─── Settings Pages ─── */
    .settings-page,
    .view-pane[id^="view-settings"] {
        padding: 0.75rem !important;
    }

    .settings-card {
        padding: 1rem;
    }

    .settings-section-card {
        padding: 0.75rem;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions button {
        width: 100%;
    }
}

/* --- Login Modal Styles --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-container {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.login-header {
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
}

.login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-aguardando), var(--color-inicio));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 2rem;
    margin: 0 auto 1rem;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-aguardando);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-aguardando), var(--color-inicio));
    border: none;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.3);
}

.login-version {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 0 1rem;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Top Action Buttons in Header */
.top-actions {
    display: none;
    gap: 0.5rem;
    align-items: center;
}

.top-actions.show {
    display: flex;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid;
}

.settings-btn {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

.settings-btn:hover {
    background: rgba(251, 191, 36, 0.3);
    border-color: rgba(251, 191, 36, 0.6);
}

.logout-btn {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.3);
    border-color: rgba(220, 38, 38, 0.6);
}

/* Settings Page */
.settings-page {
    display: none;
    padding: 2rem;
    width: 100%;
    margin: 0 auto;
}

.settings-page.active {
    display: block;
}

.settings-header {
    margin-bottom: 2rem;
}

/* Ocultar botão de 3 barras dentro de settings no desktop (já tem o sidebar lateral) */
.settings-header .sidebar-toggle-btn.d-none.d-lg-flex {
    display: none !important;
}

.settings-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.settings-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-aguardando);
}

.settings-form-group {
    margin-bottom: 1.25rem;
}

.settings-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.settings-input,
.settings-select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
}

.settings-input:focus,
.settings-select:focus {
    outline: none;
    border-color: var(--color-aguardando);
    background: rgba(255, 255, 255, 0.08);
}

.settings-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-save {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-aguardando), var(--color-inicio));
    border: none;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-save:hover {
    transform: translateY(-2px);
}

.btn-cancel {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Hide main content when not authenticated */
.app-content {
    display: none;
}

.app-content.authenticated {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* System Feedback Modal (Success/Error) */
.status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.status-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.status-modal-content {
    background: #1e293b;
    width: 90%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-modal.active .status-modal-content {
    transform: scale(1);
}

.status-icon-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}

.status-success .status-icon-box {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 2px solid #10b981;
}

.status-error .status-icon-box {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.status-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #fff;
}

.status-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.btn-status-ok {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: #334155;
    color: #fff;
}

.status-success .btn-status-ok {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.status-success .btn-status-ok:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* --- Drag and Drop Styles --- */
.event-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
    cursor: grabbing;
}

.column.drag-over {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px dashed var(--glass-border);
    transform: scale(1.01);
    transition: all 0.2s;
}

.card-list {
    min-height: 100px;
}

/* --- Smooth Animations --- */
.event-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
    will-change: transform, opacity;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-enter {
    animation: fadeIn 0.4s ease-out forwards;
}

.card-exit {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

/* --- Confirmation Modal --- */
.confirm-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
    margin-top: 1.5rem;
}

.btn-confirm-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-confirm-yes {
    background: linear-gradient(135deg, var(--color-aguardando), var(--color-inicio));
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

/* ========================================
   LIGHT MODE - MODAIS
   ======================================== */

/* Status Modal, Confirmation Modal, Debug API Modal */
.light-mode .status-modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.light-mode .status-title {
    color: #1e293b;
}

.light-mode .status-message {
    color: #64748b;
}

.light-mode .btn-status-ok {
    background: #e2e8f0;
    color: #1e293b;
}

.light-mode .btn-status-ok:hover {
    background: #cbd5e1;
}

.light-mode .status-success .btn-status-ok {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.light-mode .btn-confirm-cancel {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

.light-mode .btn-confirm-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

.light-mode .btn-confirm-yes {
    color: #fff;
}

/* Login Modal */
.light-mode .login-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.light-mode .login-container {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.light-mode .login-title {
    color: #1e293b;
}

.light-mode .login-subtitle {
    color: #64748b;
}

.light-mode .login-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.light-mode .login-input:focus {
    border-color: #38bdf8;
    background: #ffffff;
}

.light-mode .login-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.light-mode .login-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Settings Modal */
.light-mode .settings-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.light-mode .settings-container {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .settings-header {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .settings-title {
    color: #1e293b;
}

.light-mode .settings-close {
    color: #64748b;
}

.light-mode .settings-close:hover {
    color: #1e293b;
}

.light-mode .settings-label {
    color: #1e293b;
}

.light-mode .settings-input,
.light-mode .settings-select {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.light-mode .settings-input:focus,
.light-mode .settings-select:focus {
    border-color: #38bdf8;
    background: #ffffff;
}

.light-mode .settings-help {
    color: #64748b;
}

.light-mode .settings-save-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

.light-mode .settings-checkbox-group label {
    color: #1e293b;
}

/* ========================================
   COLUNA FINALIZADO
   ======================================== */

/* Coluna Finalizado */
.column-finished {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.column-finished .column-header {
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 2px solid rgba(16, 185, 129, 0.3);
}

.column-finished .column-title {
    color: #10b981;
    display: flex;
    align-items: center;
}

/* Cards Finalizados - sem background especifico para herdar o branco */
.event-card-finished {
    opacity: 1 !important;
    cursor: default !important;
}

.event-card-finished:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

.event-card-finished .event-card-header::before {
    content: "\2713 ";
    color: #10b981;
    font-weight: bold;
    margin-right: 0.25rem;
}

/* Animacao de conclusao */
@keyframes finishPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.event-card-finishing {
    animation: finishPulse 0.6s ease-out;
}

/* Light Mode */
.light-mode .column-finished {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.light-mode .column-finished .column-header {
    background: rgba(16, 185, 129, 0.15);
}

.light-mode .event-card-finished {
    background: #ffffff !important;
}

/* ========================================
   INDICADORES VISUAIS AVANCADOS (Fase 3)
   ======================================== */

/* Aging (Envelhecimento) */
@keyframes agingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes agingPulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.event-card-aging {
    animation: agingPulse 2s infinite;
    border-top: 2px dashed #f59e0b;
}

.event-card-aging-critical {
    animation: agingPulseRed 1.5s infinite;
    border-top: 2px dashed #ef4444;
}

.aging-badge {
    position: absolute;
    top: 5px;
    /* Descer um pouco conforme solicitado */
    right: 35px;
    /* Espaco para o cadeado */
    background: #f59e0b;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-card-aging-critical .aging-badge {
    background: #ef4444;
}

/* Anotação (antes: Blocked) */
.event-card-blocked {
    /* Sem borda vermelha — apenas uma sutil indicação de anotação */
    outline: 2px dashed rgba(245, 158, 11, 0.5);
    outline-offset: -2px;
}

.event-card-blocked::after {
    content: none;
}

.block-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-8deg);
    background: var(--annotation-bg, rgba(245, 200, 40, 0.18));
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    color: var(--annotation-text, rgba(30, 0, 0, 0.85));
    padding: 5px 14px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 0.85rem;
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--annotation-border, rgba(200, 155, 10, 0.45));
    letter-spacing: 0.05em;
}

.btn-block-card {
    position: absolute;
    top: 5px;
    /* Alinhar com o badge */
    right: 5px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 10;
    padding: 2px;
    transition: all 0.2s;
}

/* ── Botão de Avanço Rápido no Card ── */
.btn-quick-advance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.15s;
    z-index: 5;
}

.btn-quick-advance:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.btn-quick-advance i {
    font-size: 0.9rem;
}

.light-mode .btn-quick-advance {
    color: #fff;
}

/* ── Overlay de processamento no card (spinner) ── */
.card-pending-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.light-mode .card-pending-overlay {
    background: rgba(255, 255, 255, 0.6);
}

.card-pending-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: cardSpinAnim 0.75s linear infinite;
    display: block;
}

.light-mode .card-pending-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #0ea5e9;
}

@keyframes cardSpinAnim {
    to { transform: rotate(360deg); }
}


.light-mode .filter-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.light-mode .filter-btn:hover {
    background: #f8fafc;
    color: #1e293b;
}

.filter-btn.active {
    background: #6366f1 !important;
    color: white !important;
    border-color: #6366f1 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ========================================
   HISTORICO E AUDITORIA (Fase 5)
   ======================================== */

.event-timeline {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.light-mode .event-timeline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.timeline-title-main {
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-container {
    padding-left: 5px;
}

.timeline-item {
    display: flex;
    gap: 1.25rem;
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.light-mode .timeline-item:not(:last-child)::after {
    background: #e2e8f0;
}

.timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #334155;
    flex-shrink: 0;
    z-index: 1;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.timeline-item.completed .timeline-dot {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.timeline-item.current .timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #334155;
    flex-shrink: 0;
    z-index: 1;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.timeline-content {
    flex-grow: 1;
}

.timeline-stage {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.light-mode .timeline-stage {
    color: #1e293b;
}

.timeline-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.timeline-duration {
    font-size: 0.7rem;
    color: #818cf8;
    font-weight: 500;
}

.light-mode .timeline-duration {
    color: #4f46e5;
}

/* --- Optimized Mode (Maximized View) --- */
/* Ocultar apenas as secoes de metricas e filtros, mantendo o cabecalho visivel */
body.optimized-mode #summaryRow,
body.optimized-mode .search-filter-row,
body.optimized-mode .kpi-row,
body.optimized-mode .metrics-row {
    display: none !important;
}

/* Ajuste de padding se necessario */
body.optimized-mode #appContent {
    padding-top: 0 !important;
}

/* ========================================
   SETTINGS PAGE VIEW (Refactored)
   ======================================== */

.settings-page {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
    z-index: 10;
}

.settings-drawer {
    width: 90%;
    max-width: none;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.settings-header {
    flex-shrink: 0;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.4);
}

.settings-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-subtitle {
    color: #94a3b8;
    font-size: 1rem;
}

.settings-card {
    flex-grow: 1;
    padding: 2.5rem;
    overflow-y: initial;
    /* Scroll is on settings-page now */
}

.settings-section-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-card-title {
    font-size: 0.9rem;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-card-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(56, 189, 248, 0.2);
}

.settings-form-group {
    margin-bottom: 1.5rem;
}

.settings-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.settings-help {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
}

.settings-actions {
    padding: 1.5rem 2.5rem;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Light Mode Overrides */
.light-mode .settings-drawer {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.light-mode .settings-header {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light-mode .settings-title {
    color: #0f172a;
}

.light-mode .settings-subtitle {
    color: #64748b;
}

.light-mode .settings-section-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light-mode .settings-label {
    color: #334155;
}

.light-mode .settings-help {
    color: #64748b;
}

.light-mode .settings-actions {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* ========================================
   SETTINGS UI POLISH (Toggles, Inputs)
   ======================================== */

/* 1. Toggle Switches */
.settings-checkbox-group {
    position: relative;
    padding-left: 0;
    display: flex !important;
    align-items: center !important;
    gap: 15px;
    min-height: 44px;
}

.settings-checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    flex-shrink: 0;
    margin: 0;
}

.settings-checkbox-group label {
    user-select: none;
    cursor: pointer;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.4;
    flex-grow: 1;
}

.settings-checkbox-group input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #94a3b8;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-checkbox-group input[type="checkbox"]:checked {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
}

.settings-checkbox-group input[type="checkbox"]:checked::after {
    transform: translateX(20px);
    background: #38bdf8;
}

.light-mode .settings-checkbox-group input[type="checkbox"] {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.light-mode .settings-checkbox-group input[type="checkbox"]::after {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.light-mode .settings-checkbox-group input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.light-mode .settings-checkbox-group input[type="checkbox"]:checked::after {
    background: #fff;
}

.light-mode .settings-checkbox-group label {
    color: #334155;
}

/* 2. Color Pickers (Swatches) */
input[type="color"].settings-input {
    padding: 2px;
    height: 40px;
    width: 100%;
    min-width: 60px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Webkit specific for color swatch inside input */
input[type="color"].settings-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"].settings-input::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* 3. Inputs & Selects Refinement */
.settings-input,
.settings-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #f1f5f9;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.settings-input:hover,
.settings-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.settings-input:focus,
.settings-select:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    outline: none;
}

.light-mode .settings-input,
.light-mode .settings-select {
    background: #fff;
    border-color: #d1d5db;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.light-mode .settings-input:hover,
.light-mode .settings-select:hover {
    border-color: #9ca3af;
}

.light-mode .settings-input:focus,
.light-mode .settings-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Group Spacing */
.settings-form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.settings-checkbox-group label {
    user-select: none;
}

/* Light Mode Scrollbar */
.light-mode .settings-card::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Fix Checkbox Flex Layout */
.settings-checkbox-group {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    min-height: 44px;
    margin-bottom: 1rem;
}


/* ========================================
   FINAL REDESIGN: Cards & Circles
   ======================================== */

/* Card Container */
.settings-section-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.light-mode .settings-section-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Light Mode Drawer Background */
.light-mode .settings-drawer {
    background: #f8fafc !important;
    /* Slate 50 */
}

/* Circular Color Inputs */
input[type='color'].settings-input {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    cursor: pointer;
    transition: transform 0.2s;
}

input[type='color'].settings-input:hover {
    transform: scale(1.1);
}

input[type='color'].settings-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type='color'].settings-input::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.light-mode input[type='color'].settings-input {
    border: 2px solid #e2e8f0 !important;
}

/* Titles Highlight */
.settings-card-title {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-bottom: none !important;
}

.light-mode .settings-card-title {
    color: #64748b !important;
}

/* Toggle Switch Text Fix */
.settings-checkbox-group label {
    white-space: normal;
    text-align: left;
}


/* Horizontal Input Group (Text + Color) */
.settings-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.settings-input-group input[type='text'],
.settings-input-group input[type='number'] {
    flex: 1;
    min-width: 0;
    /* Prevent overflow */
    width: auto !important;
}

.settings-input-group input[type='color'] {
    flex-shrink: 0;
}

/* Settings Drawer Width - Final */
.settings-page .settings-drawer {
    width: 90% !important;
    max-width: none !important;
    border-radius: 20px !important;
}

/* ========================================
   CARTOES FINALIZADOS - SEM TRANSPARENCIAS
   ======================================== */

/* Cartao finalizado - herda branco do tema */
.event-card-finished {
    opacity: 1 !important;
}




.event-modal.finished .modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
    opacity: 1 !important;
}

.light-mode .event-modal.finished .modal-content {
    background: #ffffff !important;
}


/* ========================================
   PADRONIZACAO FINAL DE CARDS (BRANCO)
   ======================================== */

.event-card,
.event-card-finished,
.event-modal .modal-content,
.event-modal.finished .modal-content {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    opacity: 1 !important;
}

/* Tamanho de fonte da localizacao padronizado */
.bed-value {
    font-size: 0.8rem !important;
}


.event-card-finished:hover {
    transform: none !important;
    cursor: default !important;
}

/* ===== Configurações Gerais - Toggle Switches ===== */
.geral-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.geral-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.geral-toggle-row:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.geral-toggle-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.geral-toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.geral-toggle-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

/* Switch (estilo iOS) */
.geral-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.geral-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.geral-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
}

.geral-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.geral-switch input:checked+.geral-slider {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.geral-switch input:checked+.geral-slider::before {
    transform: translateX(24px);
}

.geral-switch input:focus+.geral-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* ===== Splash Image (Landing Page) ===== */
.splash-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.splash-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    animation: splashFadeIn 0.6s ease-out;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Light mode ajustes */
.light-mode .geral-toggle-row {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.light-mode .geral-toggle-row:hover {
    background: rgba(0, 0, 0, 0.06);
}

.light-mode .geral-toggle-label {
    color: #1e293b;
}

.light-mode .geral-toggle-desc {
    color: #64748b;
}

.light-mode .geral-slider {
    background-color: rgba(0, 0, 0, 0.2);
}

/* ─── SISTEMA DE PRIORIDADE ─── */
:root {
    --priority-color: #f59e0b;
    --priority-bg: rgba(245, 158, 11, 0.12);
    --priority-border: rgba(245, 158, 11, 0.6);
}

/* Badge no card */
.card-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 4px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    animation: priorityPulse 2s ease-in-out infinite;
}

.card-priority-badge-finished {
    background: linear-gradient(135deg, #64748b, #475569);
    animation: none;
    opacity: 0.9;
}

@keyframes priorityPulse {

    0%,
    100% {
        box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow: 0 2px 14px rgba(245, 158, 11, 0.8);
    }
}

/* Card com prioridade: Mapeamento de cor de fundo sutil sem interferir no SLA lateral */
.event-card.event-card-priority {
    background: rgba(245, 158, 11, 0.08) !important;
    background-color: rgba(245, 158, 11, 0.08) !important;
}

.event-card.event-card-priority:hover {
    box-shadow: 0 12px 20px rgba(245, 158, 11, 0.25) !important;
}

/* ─── Toggle de Prioridade no Modal ─── */
.modal-priority-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--priority-bg);
    border: 1px solid var(--priority-border);
    border-radius: 10px;
    margin-bottom: 14px;
}

.modal-priority-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--priority-color);
}

/* Toggle switch estilo iOS */
.priority-toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.priority-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.priority-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(100, 116, 139, 0.4);
    border-radius: 34px;
    transition: background 0.3s;
}

.priority-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.priority-toggle-switch input:checked+.priority-toggle-slider {
    background: var(--priority-color);
}

.priority-toggle-switch input:checked+.priority-toggle-slider::before {
    transform: translateX(22px);
}

/* Badge informativo no modal de finalizado */
.modal-priority-badge-finished {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    color: #d97706;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.light-mode .modal-priority-badge-finished {
    color: #b45309;
}

/* ─── Botão Remover Anotação (dentro do modal de edição) ─── */
.btn-annotation-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.btn-annotation-remove:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.6);
}

.light-mode .btn-annotation-remove {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.25);
}

/* ─── Dropdown retenção na coluna FINALIZADO ─── */
.finished-retention-select {
    background: #1e293b;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 6px;
    color: #10b981;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 6px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    flex: 1;
    appearance: auto;
}

.finished-retention-select option {
    background: #1e293b;
    color: #e2e8f0;
}

.finished-retention-select:hover,
.finished-retention-select:focus {
    border-color: rgba(16, 185, 129, 0.7);
    background: #0f172a;
}

.light-mode .finished-retention-select {
    background: #fff;
    border-color: rgba(16, 185, 129, 0.5);
    color: #059669;
}

.light-mode .finished-retention-select option {
    background: #fff;
    color: #334155;
}

.light-mode .finished-retention-select:hover {
    border-color: rgba(16, 185, 129, 0.8);
    background: #f0fdf4;
}

/* ─── Timeline Horizontal (Modal Nutrição) ─── */
.modal-timeline-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-timeline-track {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    gap: 0;
    scrollbar-width: thin;
}

.modal-tl-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    flex: 1;
    text-align: center;
}

.modal-tl-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 6px;
    line-height: 1.2;
    min-height: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    padding: 0 2px;
}

.tl-completed .modal-tl-name {
    color: #10b981;
}

.tl-pending .modal-tl-name {
    color: #64748b;
    opacity: 0.5;
}

.modal-tl-line-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}

.modal-tl-line {
    flex: 1;
    height: 2px;
    background: #10b981;
}

.tl-pending .modal-tl-line {
    background: rgba(100, 116, 139, 0.3);
}

.modal-tl-line.invisible {
    background: transparent;
}

.modal-tl-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    position: relative;
    z-index: 1;
}

.tl-pending .modal-tl-dot {
    background: rgba(100, 116, 139, 0.3);
    box-shadow: none;
    color: #64748b;
}

/* Impedimento na linha do tempo do transporte — evidencia o momento e o motivo */
.tl-impediment .modal-tl-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.tl-impediment .modal-tl-name {
    color: #f59e0b !important;
}

.tl-impediment-resumed .modal-tl-dot {
    background: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

.tl-impediment-resumed .modal-tl-name {
    color: #94a3b8 !important;
}

.modal-tl-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
    gap: 1px;
}

.tl-hhmm {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}

.tl-ddmm {
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
}

.tl-pending .tl-hhmm,
.tl-pending .tl-ddmm {
    opacity: 0.4;
}

.modal-tl-total {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 10px;
    padding-right: 4px;
}

.modal-tl-total strong {
    color: #10b981;
}

/* Etapa final cancelada (Monitor/Auditoria Smart) — mesmo padrão visual do
   tl-impediment (laranja), mas em vermelho pra ficar claro que é um encerramento
   negativo, não uma etapa concluída com sucesso. */
.tl-cancelled .modal-tl-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.tl-cancelled .modal-tl-name {
    color: #ef4444 !important;
}

.smartdetail-timeline-wrap {
    margin: 12px 0 8px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
}

.modal-priority-banner {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #f59e0b;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-priority-banner strong {
    color: #fbbf24;
}

/* ── Dados do Pedido (Remarks) ── */
.modal-remarks-section {
    margin-top: 16px;
    padding: 14px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
}

.remarks-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.remarks-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.remarks-row {
    display: flex;
    gap: 8px;
}

.remarks-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.remarks-item.remarks-fixed {
    flex-shrink: 0;
}

.remarks-item.remarks-fill {
    flex: 1;
    min-width: 0;
}

.remarks-item.remarks-obs {
    width: 100%;
    align-items: flex-start;
}

.remarks-item.remarks-obs .remarks-value {
    white-space: pre-wrap;
    word-break: break-word;
}

.remarks-item i {
    color: #60a5fa;
    font-size: 1rem;
    flex-shrink: 0;
}

.remarks-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.remarks-value {
    font-size: 0.82rem;
    color: #e2e8f0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Light mode */
.light-mode .modal-remarks-section {
    background: rgba(59, 130, 246, 0.04);
    border-color: rgba(59, 130, 246, 0.12);
}

.light-mode .remarks-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

.light-mode .remarks-value {
    color: #1e293b;
}

.light-mode .remarks-label {
    color: #64748b;
}

/* Light mode */
.light-mode .modal-tl-name {
    color: #64748b;
}

.light-mode .tl-completed .modal-tl-name {
    color: #059669;
}

.light-mode .tl-hhmm {
    color: #1e293b;
}

.light-mode .tl-ddmm {
    color: #64748b;
}

/* ══════════════════════════════════════════════════════════════
   MONITOR DE RECURSOS DO SERVIDOR (admin-only) — memória, mysqld.exe,
   disco e CPU. Botão em #topActions, painel flutuante ancorado abaixo dele.
   ══════════════════════════════════════════════════════════════ */
.resmon-panel {
    position: fixed;
    top: 64px;
    right: 24px;
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--bg-column);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 16px;
    z-index: 5000;
}

.resmon-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}

.resmon-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.resmon-panel-close {
    background: none;
    border: none;
    color: var(--text-main);
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px;
}

.resmon-panel-close:hover {
    opacity: 1;
}

.resmon-services {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.resmon-service-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.resmon-service-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.resmon-service-dot.resmon-success { background: #10b981; box-shadow: 0 0 4px #10b981; }
.resmon-service-dot.resmon-critical { background: #ef4444; box-shadow: 0 0 4px #ef4444; }

.resmon-service-name {
    font-size: 0.8rem;
    color: var(--text-main);
    flex: 1;
}

.resmon-service-status {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.resmon-metric {
    margin-bottom: 14px;
}

.resmon-metric:last-child {
    margin-bottom: 0;
}

.resmon-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.resmon-metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.resmon-metric-pct {
    font-size: 0.85rem;
    font-weight: 700;
}

.resmon-metric-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.resmon-bar {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: var(--glass-border);
    overflow: hidden;
}

.resmon-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.resmon-success { color: #10b981; }
.resmon-warning { color: #f59e0b; }
.resmon-critical { color: #ef4444; }
.resmon-neutral { color: var(--text-muted); }

.resmon-bar-fill.resmon-success { background: #10b981; }
.resmon-bar-fill.resmon-warning { background: #f59e0b; }
.resmon-bar-fill.resmon-critical { background: #ef4444; }
.resmon-bar-fill.resmon-neutral { background: var(--text-muted); }

.resmon-updated {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 8px;
}

.resmon-error {
    text-align: center;
    padding: 20px 8px;
    color: var(--text-muted);
}

.resmon-error i {
    font-size: 1.6rem;
    color: #ef4444;
    margin-bottom: 6px;
    display: block;
}

.resmon-error-detail {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 6px;
    word-break: break-word;
}

/* ══════════════════════════════════════════════════════════════
   MONITOR SMART (tempo real) — solicitações roteadas pelo Script de
   Criação do Tipo de Tarefa até o Rauland (FreeSwitch). Reaproveita
   .resmon-panel-header/.resmon-panel-title/.resmon-panel-close/
   .resmon-error/.resmon-updated e as cores .resmon-success/warning/
   critical/neutral do Monitor de Recursos, só o painel é mais largo
   (lista de solicitações, não medidores).
   ══════════════════════════════════════════════════════════════ */
.smartmon-panel {
    position: fixed;
    top: 64px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: 80vh;
    overflow-y: auto;
    background: var(--bg-column);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 16px;
    z-index: 5000;
}

.smartmon-summary {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.smartmon-sum-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: var(--bg-card, rgba(128, 128, 128, 0.08));
    border: 1px solid var(--glass-border);
}

.smartmon-sum-item b {
    font-size: 1.15rem;
    line-height: 1.2;
}

.smartmon-sum-item span {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.smartmon-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smartmon-row {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-card, rgba(128, 128, 128, 0.06));
    border: 1px solid var(--glass-border);
}

.smartmon-row-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.smartmon-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.smartmon-event {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.smartmon-status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(128, 128, 128, 0.15);
}

.smartmon-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.smartmon-bed {
    display: flex;
    align-items: center;
    gap: 4px;
}

.smartmon-cancel {
    margin-top: 4px;
    font-size: 0.7rem;
    color: #ef4444;
}

.smartmon-audit-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(128, 128, 128, 0.08);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.smartmon-audit-btn:hover {
    background: rgba(128, 128, 128, 0.16);
}

/* ══════════════════════════════════════════════════════════════
   AUDITORIA SMART — grade com ID do evento + sequência completa +
   alertas de não-conformidade. Modal wide (diferente do .status-modal,
   que é um diálogo estreito de confirmação).
   ══════════════════════════════════════════════════════════════ */
.smartaudit-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.smartaudit-modal-content {
    background: var(--bg-column);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 1180px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.smartaudit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.smartaudit-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.smartaudit-filters select {
    background: var(--bg-card, rgba(128,128,128,0.08));
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.8rem;
}

.smartaudit-refresh-btn {
    background: var(--bg-card, rgba(128,128,128,0.08));
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

.smartaudit-body {
    overflow: auto;
    flex: 1;
}

.smartaudit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.smartaudit-table th {
    position: sticky;
    top: 0;
    background: var(--bg-column);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.68rem;
    white-space: nowrap;
}

.smartaudit-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    white-space: nowrap;
}

.smartaudit-table tr.smartaudit-has-alert {
    background: rgba(239, 68, 68, 0.08);
}

.smartaudit-alert-cell {
    white-space: normal;
    max-width: 260px;
    color: #ef4444;
    font-weight: 600;
}

.smartaudit-rauland-ok { color: #10b981; font-weight: 700; }
.smartaudit-rauland-fail { color: #ef4444; font-weight: 700; }
.smartaudit-rauland-pending { color: var(--text-muted); }

/* Linhas clicáveis (Monitor + Auditoria) abrem o modal de detalhe */
.smartmon-row {
    cursor: pointer;
    transition: background 0.15s;
}
.smartmon-row:hover {
    background: rgba(128, 128, 128, 0.14);
}
.smartaudit-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}
.smartaudit-table tbody tr:hover {
    background: rgba(128, 128, 128, 0.12);
}
.smartaudit-table tr.smartaudit-has-alert:hover {
    background: rgba(239, 68, 68, 0.16);
}

/* Modal de detalhe de uma solicitação Smart -- mais estreito que o da Auditoria completa */
.smartdetail-modal-content {
    max-width: 480px;
}

.smartdetail-body {
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smartdetail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.smartdetail-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.smartdetail-value {
    color: var(--text-main);
    font-weight: 600;
    text-align: right;
}

.smartdetail-alerts {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.8rem;
}

.smartdetail-alerts ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.light-mode .modal-tl-total {
    color: #64748b;
}