/* Reset e Estilos Globais */
/* Variáveis importadas de theme.css */

:root{
    --bs-primary: var(--primary-color);
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;

    --bs-primary-rgb: var(--primary-color-rgb);
    --bs-secondary-rgb: var(--secondary-color-rgb);
    --bs-success-rgb: var(--success-color-rgb);
    --bs-info-rgb: var(--info-color-rgb);
    --bs-warning-rgb: var(--warning-color-rgb);
    --bs-danger-rgb: var(--danger-color-rgb);
    --bs-light-rgb: var(--light-color-rgb);
    --bs-dark-rgb: var(--dark-color-rgb);
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ═══ Card-headers com background sólido → texto branco ═══ */
.card-header.bg-primary,
.card-header.bg-secondary,
.card-header.bg-success,
.card-header.bg-danger,
.card-header.bg-info,
.card-header.bg-dark {
    color: #fff !important;
}
.card-header.bg-primary *,
.card-header.bg-secondary *,
.card-header.bg-success *,
.card-header.bg-danger *,
.card-header.bg-info *,
.card-header.bg-dark * {
    color: #fff !important;
}
.card-header.bg-warning {
    color: #212529 !important;
}
.card-header.bg-warning * {
    color: #212529 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================
   NAVBAR PROFISSIONAL
   ======================================== */
.navbar-akti {
    background: var(--primary-color);
    height: var(--navbar-height);
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    z-index: 1040;
}

.navbar-akti .navbar-brand {
    padding: 0;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-akti .navbar-brand img {
    height: 34px;
    transition: opacity var(--transition-fast);
}

.navbar-akti .navbar-brand:hover img {
    opacity: 0.85;
}

.navbar-akti .nav-link {
    color: rgba(255,255,255,0.7) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none !important;
    border: none !important;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.navbar-akti .nav-link:hover,
.navbar-akti .nav-link:focus {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}

.navbar-akti .nav-link.active {
    color: #fff !important;
    background: var(--accent-color);
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.navbar-akti .nav-link i {
    font-size: 0.8rem;
    opacity: 0.85;
    width: 16px;
    text-align: center;
}

.navbar-akti .nav-link.active i {
    opacity: 1;
}

/* Navbar divider vertical */
.navbar-akti .nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.12);
    margin: 0 0.5rem;
    align-self: center;
}

/* Right side icons */
.navbar-akti .nav-icon-btn {
    color: rgba(255,255,255,0.6) !important;
    font-size: 0.875rem;
    padding: 0.5rem 0.625rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-akti .nav-icon-btn:hover,
.navbar-akti .nav-icon-btn:focus {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}

.navbar-akti .nav-icon-btn.active {
    color: #fff !important;
    background: rgba(255,255,255,0.12);
}

/* User badge */
.navbar-akti .user-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.navbar-akti .user-badge.admin {
    background: rgba(59, 130, 246, 0.25);
    color: var(--accent-light);
}

/* Notification badge */
.navbar-akti .notification-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    font-size: 0.55rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--danger-color);
    color: #fff;
    font-weight: 700;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid var(--primary-color);
}

/* Logout button */
.navbar-akti .btn-logout {
    color: rgba(255,255,255,0.55) !important;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem !important;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.1) !important;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.navbar-akti .btn-logout:hover {
    color: #fff !important;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Dropdown menu override for akti navbar */
.navbar-akti .dropdown-menu {
    background: var(--primary-color);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 0.35rem;
    margin-top: 0.375rem;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
}

.navbar-akti .dropdown-item {
    color: rgba(255,255,255,0.75);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-akti .dropdown-item:hover,
.navbar-akti .dropdown-item:focus {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.navbar-akti .dropdown-item.active,
.navbar-akti .dropdown-item:active {
    background: var(--accent-color);
    color: #fff;
}

.navbar-akti .dropdown-item i {
    width: 18px;
    text-align: center;
    opacity: 0.6;
    font-size: 0.8rem;
}

.navbar-akti .dropdown-item:hover i {
    opacity: 1;
}

.navbar-akti .dropdown-divider {
    border-color: rgba(255,255,255,0.08);
    margin: 0.25rem 0;
}

.navbar-akti .dropdown-toggle::after {
    font-size: 0.6rem;
    vertical-align: 0.15em;
    margin-left: 0.3rem;
    opacity: 0.5;
}

/* ── Bell dropdown override (fundo branco) ── */
.navbar-akti #bellDropdownMenu,
.navbar-akti #notifDropdownMenu {
    background: var(--bg-card, #fff) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
}
.navbar-akti #bellDropdownMenu .dropdown-item,
.navbar-akti #notifDropdownMenu .dropdown-item {
    color: var(--text-main) !important;
    border-radius: 0;
}
.navbar-akti #bellDropdownMenu .dropdown-item:hover,
.navbar-akti #bellDropdownMenu .dropdown-item:focus,
.navbar-akti #notifDropdownMenu .dropdown-item:hover,
.navbar-akti #notifDropdownMenu .dropdown-item:focus {
    background: var(--bg-body) !important;
    color: var(--text-main) !important;
}
.navbar-akti #bellDropdownToggle::after,
.navbar-akti #notifBellToggle::after {
    display: none;
}

/* Remove underline de todos os links do navbar */
.navbar-akti a, .navbar-akti a:hover, .navbar-akti a:focus, .navbar-akti a:active {
    text-decoration: none !important;
}

/* ========================================
   FOOTER PROFISSIONAL
   ======================================== */
.footer-akti {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.4);
    padding: 0.875rem 1.5rem;
    font-size: 0.78rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: auto;
    flex-shrink: 0;
}

.footer-akti a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-akti a:hover {
    color: rgba(255,255,255,0.75);
}

.footer-akti .footer-logo {
    height: 22px;
    opacity: 0.35;
    transition: opacity var(--transition-fast);
}

.footer-akti .footer-logo:hover {
    opacity: 0.6;
}

.footer-akti .footer-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.1);
    display: inline-block;
    vertical-align: middle;
    margin: 0 0.75rem;
}

/* Botões Personalizados */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transition: all var(--transition-fast);
}
.btn-primary:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Cards e Containers */
.card, .table-responsive, fieldset {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Sidebar Customizado (se houver) */
.sidebar {
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.content-wrapper {
    padding: 20px;
}

/* Ajustes de Tables */
.table-responsive {
    padding: 15px;
}

.table thead th {
    background-color: var(--bg-body);
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
}

/* Formulários */
.form-label {
    color: var(--text-main);
    font-weight: 500;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

/* ========================================
   PIPELINE / LINHA DE PRODUÇÃO — Modern SaaS
   ======================================== */

/* ── Page Header ── */
.pipeline-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.pipeline-page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0;
}

.pipeline-page-header h1 i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.pipeline-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Metric Widgets (KPI row) ── */
.pipeline-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.pipeline-metric-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.pipeline-metric-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.pipeline-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pipeline-metric-card.metric-active::before { background: var(--accent-color); }
.pipeline-metric-card.metric-delayed::before { background: var(--danger-color); }
.pipeline-metric-card.metric-completed::before { background: var(--success-color); }
.pipeline-metric-card.metric-value::before { background: var(--warning-color); }

.pipeline-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pipeline-metric-icon.icon-active  { background: rgba(59,128,246,0.1); color: var(--accent-color); }
.pipeline-metric-icon.icon-delayed { background: rgba(239,68,68,0.1); color: var(--danger-color); }
.pipeline-metric-icon.icon-completed { background: rgba(34,197,94,0.1); color: var(--success-color); }
.pipeline-metric-icon.icon-value   { background: rgba(245,158,11,0.1); color: var(--warning-color); }

.pipeline-metric-data {
    flex: 1;
    min-width: 0;
}

.pipeline-metric-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.pipeline-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.pipeline-metric-value.text-danger { color: var(--danger-color) !important; }

.pipeline-metric-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Kanban Board Wrapper ── */
.pipeline-board-wrapper {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
    padding-bottom: 4px;
}

.pipeline-board {
    display: flex;
    width: 100%;
    gap: 12px;
}

.pipeline-column {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
}

/* Scroll fade indicator */
.pipeline-board-wrapper::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    width: 30px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, var(--bg-body), transparent);
    flex-shrink: 0;
    display: none;
}

.pipeline-board-wrapper.has-scroll::after {
    display: block;
}

/* Navigation arrows */
.pipeline-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.97);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.pipeline-nav-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(59,128,246,0.3);
}

.pipeline-nav-btn.nav-left { left: 4px; }
.pipeline-nav-btn.nav-right { right: 4px; }

.pipeline-board-wrapper.has-scroll .pipeline-nav-btn {
    display: flex;
}

/* ── Column minimap strip ── */
.pipeline-minimap {
    display: none;
    gap: 4px;
    padding: 8px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.pipeline-minimap-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.pipeline-minimap-item:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.pipeline-minimap-item .minimap-count {
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
}

/* ── Custom scrollbar ── */
.pipeline-board-wrapper::-webkit-scrollbar {
    height: 6px;
}

.pipeline-board-wrapper::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.pipeline-board-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

/* ── Responsive breakpoints ── */
@media (max-width: 576px) {
    .pipeline-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .pipeline-metric-card { padding: 14px 14px; }
    .pipeline-metric-value { font-size: 1.2rem; }
    .pipeline-board {
        width: max-content;
    }
    .pipeline-column {
        flex: 0 0 260px !important;
        min-width: 260px !important;
    }
    .pipeline-minimap {
        display: flex;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .pipeline-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .pipeline-board {
        width: max-content;
    }
    .pipeline-column {
        flex: 0 0 230px !important;
        min-width: 230px !important;
    }
    .pipeline-minimap {
        display: flex;
    }
}

@media (min-width: 992px) {
    .pipeline-board {
        width: 100%;
    }
    .pipeline-column {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

/* ── Column design ── */
.pipeline-column {
    transition: transform var(--transition-fast);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-light);
}

.pipeline-column-header {
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px;
    position: relative;
}

.pipeline-column-header .fw-bold {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-column-header .badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    min-width: 26px;
}

/* Stage goal bar below header */
.pipeline-stage-meta {
    background: rgba(255,255,255,0.85);
    font-size: 0.67rem;
    color: var(--text-muted);
    padding: 4px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-bottom: 1px solid var(--border-light);
}

.pipeline-stage-meta .goal-bar {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    max-width: 60px;
}

.pipeline-stage-meta .goal-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* Column body (card list / droppable zone) */
.pipeline-column-body {
    scrollbar-width: thin;
    padding: 8px !important;
    flex: 1;
    background: transparent;
    border: none !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.pipeline-column-body::-webkit-scrollbar {
    width: 4px;
}

.pipeline-column-body::-webkit-scrollbar-thumb {
    background: var(--border-color, #dee2e6);
    border-radius: 4px;
}

/* Empty state */
.pipeline-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--secondary-color);
    font-size: 0.78rem;
    opacity: 0.7;
}

.pipeline-empty-state i {
    font-size: 1.6rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ═══ Cards dos Pedidos no Kanban ═══ */
.pipeline-card {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    cursor: grab;
    border-radius: var(--radius-md) !important;
    background: var(--bg-card);
    border: 1px solid var(--border-light) !important;
    border-left: 3px solid transparent !important;
    overflow: hidden;
    position: relative;
}

/* Alternating card backgrounds for visual separation */
.pipeline-card:nth-child(odd) {
    background: var(--bg-card);
}

.pipeline-card:nth-child(even) {
    background: linear-gradient(135deg, var(--bg-body, #f8fafc) 0%, var(--border-light, #f1f5f9) 100%);
}

/* Subtle left accent per card position */
.pipeline-card:nth-child(4n+1) { border-left-color: rgba(59,130,246,1) !important; } /*o valor do opacity deve permanecer como 1*/
.pipeline-card:nth-child(4n+2) { border-left-color: rgba(139,92,246,1) !important; } /*o valor do opacity deve permanecer como 1*/
.pipeline-card:nth-child(4n+3) { border-left-color: rgba(16,185,129,1) !important; } /*o valor do opacity deve permanecer como 1*/
.pipeline-card:nth-child(4n+4) { border-left-color: rgba(245,158,11,1) !important; } /*o valor do opacity deve permanecer como 1*/

/* Priority overrides the alternating left border */
.pipeline-card[data-priority="urgente"] { border-left-color: var(--danger-color) !important; }
.pipeline-card[data-priority="alta"]    { border-left-color: var(--warning-color) !important; }

.pipeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08) !important;
    background: var(--bg-card, #fff) !important;
}

.pipeline-card .card-footer {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: transparent !important;
    border-top: 1px solid var(--border-light) !important;
}

.pipeline-card:nth-child(even) .card-footer {
    background: rgba(var(--primary-color-rgb, 241,245,249), 0.05) !important;
}

/* ── Card header row (order # + priority) ── */
.pipeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.pipeline-card-toggle {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.pipeline-card-toggle:hover {
    background: rgba(0,0,0,0.02);
}

/* Chevron icon for expand/collapse */
.pipeline-card-chevron {
    font-size: 0.55rem;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    margin-left: 4px;
    flex-shrink: 0;
}

.pipeline-card-expanded .pipeline-card-chevron {
    transform: rotate(180deg);
}

/* ── Collapsible details section ── */
.pipeline-card-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1),
                opacity 0.2s ease,
                margin 0.3s ease;
    margin-top: 0;
}

.pipeline-card-expanded .pipeline-card-details {
    max-height: 300px;
    opacity: 1;
    margin-top: 8px;
}

/* Compact card body when collapsed */
.pipeline-card .card-body {
    padding: 8px 12px !important;
}

.pipeline-card-expanded .card-body {
    padding: 10px 12px !important;
}

/* Visual separator line when card is expanded */
.pipeline-card-expanded .pipeline-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 1px;
    background: var(--border-light);
}

.pipeline-card-expanded .pipeline-card-header {
    position: relative;
    padding-bottom: 6px;
    margin-bottom: 0;
}

/* Compact card footer */
.pipeline-card .card-footer {
    padding: 4px 10px !important;
}

.pipeline-card-order-id {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* Priority badge pill */
.pipeline-card .badge-priority {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-priority-baixa   { background: rgba(148,163,184,0.15); color: #64748b; }
.badge-priority-normal  { background: rgba(59,128,246,0.12); color: var(--accent-color); }
.badge-priority-alta    { background: rgba(245,158,11,0.15); color: #d97706; }
.badge-priority-urgente { background: rgba(239,68,68,0.15); color: var(--danger-color); font-weight: 700; }

/* ── Customer name ── */
.pipeline-card-customer {
    font-size: 0.78rem;
    color: var(--text-main);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-card-customer i {
    color: var(--secondary-color);
    font-size: 0.68rem;
    flex-shrink: 0;
}

/* ── Time in stage ── */
.pipeline-card-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.pipeline-card-time i {
    font-size: 0.68rem;
    flex-shrink: 0;
}

.pipeline-card-time.is-delayed {
    color: var(--danger-color);
    font-weight: 600;
}

.pipeline-card-time .delay-badge {
    font-size: 0.58rem;
    font-weight: 700;
    background: rgba(239,68,68,0.12);
    color: var(--danger-color);
    padding: 1px 6px;
    border-radius: 10px;
}

/* ── Time progress bar (visual timer) ── */
.pipeline-card-timer {
    width: 100%;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.pipeline-card-timer-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease, background 0.3s ease;
}

.pipeline-card-timer-fill.timer-ok { background: var(--success-color); }
.pipeline-card-timer-fill.timer-warn { background: var(--warning-color); }
.pipeline-card-timer-fill.timer-danger { background: var(--danger-color); }

/* ── Card info chips ── */
.pipeline-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.pipeline-card-chip {
    font-size: 0.62rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.pipeline-card-chip i { font-size: 0.58rem; }

.chip-value     { background: rgba(39,174,96,0.1); color: #16a34a; }
.chip-approved  { background: rgba(34,197,94,0.15); color: #16a34a; }
.chip-assigned  { background: rgba(59,128,246,0.1); color: var(--accent-color); }
.chip-date      { background: rgba(148,163,184,0.12); color: #64748b; }
.chip-financial { background: rgba(245,158,11,0.12); color: #d97706; }

/* ── Card footer ── */
.pipeline-card .card-footer .btn {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    transition: all var(--transition-fast);
}

/* ── Delayed card ── */
.pipeline-card-delayed {
    border-left: 3px solid var(--danger-color) !important;
    background: rgba(239,68,68,0.03) !important;
}

.pipeline-card-delayed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--danger-color) 0%, transparent 100%);
}

/* ── Drag-and-Drop states ── */
.pipeline-card-ghost {
    opacity: 0.35;
    background: var(--border-light) !important;
    border: 2px dashed var(--accent-color) !important;
    border-radius: var(--radius-md);
    box-shadow: none !important;
}

.pipeline-card-chosen {
    box-shadow: 0 12px 32px rgba(0,0,0,0.15) !important;
    transform: rotate(1.5deg) scale(1.02);
    z-index: 9999;
    cursor: grabbing;
    border-color: var(--accent-color) !important;
}

.pipeline-card-dragging {
    opacity: 0.85;
}

body.pipeline-dragging .pipeline-column {
    transition: background var(--transition-fast);
}

body.pipeline-dragging .pipeline-dropzone {
    background: rgba(59,128,246,0.03) !important;
    border: 2px dashed rgba(59,128,246,0.2) !important;
    border-top: none !important;
    transition: background 0.2s, border-color 0.2s;
}

body.pipeline-dragging .pipeline-dropzone:hover {
    background: rgba(59, 130, 246, 0.07) !important;
    border-color: var(--accent-color) !important;
}

/* Drop zone active highlight */
body.pipeline-dragging .pipeline-column:hover {
    background: rgba(59,128,246,0.04);
}

/* Feedback visual após mover com sucesso */
.pipeline-card-moved {
    animation: card-moved-flash 1.5s ease;
}

@keyframes card-moved-flash {
    0%   { background: rgba(34, 197, 94, 0.12); box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
    100% { background: var(--bg-card, #fff); box-shadow: var(--shadow-sm); }
}

@keyframes pulse-border {
    0%, 100% { border-left-color: var(--danger-color); }
    50% { border-left-color: rgba(239,68,68,0.3); }
}

/* ── Delayed alert banner ── */
.pipeline-delayed-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(239,68,68,0.02));
    border: 1px solid rgba(239,68,68,0.15);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--danger-color);
    animation: delayed-banner-pulse 3s ease-in-out infinite;
}

.pipeline-delayed-banner i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

@keyframes delayed-banner-pulse {
    0%, 100% { border-color: rgba(239,68,68,0.15); }
    50% { border-color: rgba(239,68,68,0.35); }
}

/* ── Filter bar ── */
.pipeline-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pipeline-filter-bar .form-control,
.pipeline-filter-bar .form-select {
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    max-width: 200px;
}

.pipeline-filter-bar .form-control:focus,
.pipeline-filter-bar .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59,128,246,0.1);
}

/* Progress bar do detalhe */
/* =============================================
   PIPELINE STEPPER — Modern Progress Bar
   ============================================= */
.pipeline-progress {
    padding: 16px 0 8px;
    gap: 0;
}

.pipeline-step {
    position: relative;
    transition: transform 0.2s ease;
}

.pipeline-step:hover {
    transform: translateY(-2px);
}

/* Connector line between steps */
.pipeline-step::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 50%;
    width: 100%;
    height: 4px;
    background: var(--border-color, #e2e8f0);
    border-radius: 2px;
    z-index: -1;
    transition: background 0.4s ease;
}

.pipeline-step:last-child::after {
    display: none;
}

/* Completed connector */
.pipeline-step.step-completed::after {
    background: linear-gradient(90deg, var(--success-color, #22c55e), var(--success-color, #22c55e));
}

/* Current step connector (half-filled effect) */
.pipeline-step.step-current::after {
    background: var(--border-color, #e2e8f0);
}

/* Step icon circle */
.pipeline-step-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: relative;
}

/* Completed step icon */
.pipeline-step.step-completed .pipeline-step-icon {
    box-shadow: 0 3px 10px rgba(34,197,94,0.3);
}

/* Current step icon — pulse ring */
.pipeline-step.step-current .pipeline-step-icon {
    box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb, 59,128,246), 0.18),
                0 3px 12px rgba(var(--accent-color-rgb, 59,128,246), 0.25);
    animation: pipeline-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pipeline-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb, 59,128,246), 0.18), 0 3px 12px rgba(var(--accent-color-rgb, 59,128,246), 0.25); }
    50% { box-shadow: 0 0 0 8px rgba(var(--accent-color-rgb, 59,128,246), 0.08), 0 3px 16px rgba(var(--accent-color-rgb, 59,128,246), 0.15); }
}

/* Future step icon */
.pipeline-step.step-future .pipeline-step-icon {
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    opacity: 1;
}

.pipeline-step.step-future:hover .pipeline-step-icon {
    opacity: 1;
}

/* Step label */
.pipeline-step-label {
    transition: color 0.3s ease;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-top: 6px;
}

/* Progress track (the overall line beneath) */
.pipeline-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color, #e2e8f0);
}

.pipeline-track-fill {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--success-color, #22c55e), var(--accent-color, #3b82f6));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive: smaller on mobile */
@media (max-width: 576px) {
    .pipeline-step-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.7rem !important;
    }
    .pipeline-step::after {
        top: 16px;
        height: 3px;
    }
    .pipeline-step-label {
        font-size: 0.6rem !important;
    }
}

/* Timeline do histórico */
.timeline-item {
    position: relative;
    padding-left: 5px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 32px;
    width: 2px;
    height: calc(100% - 10px);
    background: var(--border-color, #e9ecef);
}

.timeline-item:last-child::before {
    display: none;
}

/* Pipeline card priority indicator — urgent corner ribbon */
.pipeline-card[data-priority="urgente"]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 18px solid var(--danger-color);
    border-left: 18px solid transparent;
    border-radius: 0 var(--radius-md) 0 0;
    opacity: 0.6;
}

/* Responsividade do pipeline — handled by new responsive rules above */

/* ========================================
   DASHBOARD MELHORADO
   ======================================== */
.border-4 {
    border-width: 4px !important;
}

/* Dashboard cards animação */
.card.border-start {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.border-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12) !important;
}

/* Pipeline mini cards no dashboard */
.pipeline-mini-card {
    border-radius: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pipeline-mini-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Alertas atrasados pulsam */
.btn-delayed-alert {
    animation: pulse-danger 2s infinite;
    position: relative;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Badge do pipeline nas tabelas */
.badge[style*="background"] {
    transition: transform 0.15s ease;
}

.badge[style*="background"]:hover {
    transform: scale(1.08);
}

/* Fieldset custom para formulários pipeline */
fieldset {
    border: 1px solid var(--border-color) !important;
    border-radius: 0.5rem;
    padding: 1rem;
}

fieldset legend {
    font-size: 1rem;
    font-weight: 600;
}

/* ========================================
   GRADES / VARIAÇÕES DE PRODUTOS
   ======================================== */

.grade-item {
    transition: box-shadow 0.2s ease;
}

.grade-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.grade-item .card-header {
    border-bottom: 2px solid rgba(23, 162, 184, 0.2);
}

.grade-value-item {
    transition: all 0.15s ease;
}

.grade-value-item .grade-value-input {
    border-color: #17a2b8;
    font-weight: 500;
}

.grade-value-item .grade-value-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

.grade-value-item .btn-remove-value {
    border-color: #dee2e6;
    color: #999;
}

.grade-value-item .btn-remove-value:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.05);
}

#combinations-table td {
    vertical-align: middle;
}

#combinations-table .form-control-sm {
    font-size: 0.8rem;
}

.pipeline-minimap-item {
    user-select: none;
}

/* Print styles */
@media print {
    .navbar, .btn-toolbar, .btn-group, .btn {
        display: none !important;
    }
    .pipeline-board-wrapper {
        overflow: visible;
    }
    .pipeline-column {
        break-inside: avoid;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Pipeline / Kanban (Fase 2)
   Resolve: Problema #3 (pipeline branco), #9 (animações), #10 (tabelas)
   ═══════════════════════════════════════════════════════════════ */

/* ── Pipeline columns ── */
[data-theme="dark"] .pipeline-column {
    background: var(--bg-secondary, #16213E);
    border-color: var(--border, #2C3E50);
}

/* ── Pipeline cards ── */
[data-theme="dark"] .pipeline-card,
[data-theme="dark"] .pipeline-card:nth-child(odd),
[data-theme="dark"] .pipeline-card:nth-child(even) {
    background: var(--bg-primary, #1A1A2E) !important;
    border-color: var(--border-light, #243447) !important;
}

[data-theme="dark"] .pipeline-card:hover {
    background: var(--bg-tertiary, #0F3460) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25) !important;
}

[data-theme="dark"] .pipeline-card:nth-child(even) .card-footer {
    background: rgba(22, 33, 62, 0.5) !important;
}

[data-theme="dark"] .pipeline-card .card-footer {
    border-top-color: var(--border-light, #243447) !important;
}

/* ── Pipeline delayed card ── */
[data-theme="dark"] .pipeline-card-delayed {
    background: rgba(255, 107, 107, 0.06) !important;
}

/* ── Pipeline stage meta ── */
[data-theme="dark"] .pipeline-stage-meta {
    background: rgba(0, 0, 0, 0.2);
    border-bottom-color: var(--border-light, #243447);
    color: var(--text-muted, #94a3b8);
}

/* ── Pipeline navigation buttons ── */
[data-theme="dark"] .pipeline-nav-btn {
    background: var(--bg-secondary, #16213E);
    border-color: var(--border, #2C3E50);
    color: var(--text-secondary, #ADB5BD);
}

[data-theme="dark"] .pipeline-nav-btn:hover {
    background: var(--accent-color, #60a5fa);
    color: #fff;
    border-color: var(--accent-color, #60a5fa);
}

/* ── Pipeline stepper / progress ── */
[data-theme="dark"] .pipeline-step::after {
    background: var(--border, #2C3E50);
}

[data-theme="dark"] .pipeline-step.step-current::after {
    background: var(--border, #2C3E50);
}

[data-theme="dark"] .pipeline-track {
    background: var(--border, #2C3E50);
}

/* ── Timeline ── */
[data-theme="dark"] .timeline-item::before {
    background: var(--border, #2C3E50);
}

/* ── Scroll fade ── */
[data-theme="dark"] .pipeline-board-wrapper::after {
    background: linear-gradient(to left, var(--bg-body, #1A1A2E), transparent);
}

/* ── Drag and drop ── */
[data-theme="dark"] .pipeline-card-ghost {
    background: var(--bg-tertiary, #0F3460) !important;
    border-color: var(--accent-color, #60a5fa) !important;
}

[data-theme="dark"] body.pipeline-dragging .pipeline-dropzone {
    background: rgba(96, 165, 250, 0.05) !important;
    border-color: rgba(96, 165, 250, 0.2) !important;
}

[data-theme="dark"] body.pipeline-dragging .pipeline-column:hover {
    background: rgba(96, 165, 250, 0.06);
}

/* ── Card moved animation (dark) — Resolve Problema #9 ── */
[data-theme="dark"] .pipeline-card-moved {
    animation: card-moved-flash-dark 1.5s ease;
}

@keyframes card-moved-flash-dark {
    0%   { background: rgba(81, 207, 102, 0.15); box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.2); }
    100% { background: var(--bg-primary, #1A1A2E); box-shadow: var(--shadow-sm); }
}

/* ── Pipeline metric cards ── */
[data-theme="dark"] .pipeline-metric-card {
    background: var(--bg-card, #16213E);
    border-color: var(--border-light, #243447);
}

/* ── Pipeline filter bar ── */
[data-theme="dark"] .pipeline-filter-bar .form-control,
[data-theme="dark"] .pipeline-filter-bar .form-select {
    background-color: var(--bg-tertiary, #0F3460);
    border-color: var(--border, #2C3E50);
    color: var(--text-primary, #E8E8E8);
}

/* ── Pipeline scrollbar ── */
[data-theme="dark"] .pipeline-board-wrapper::-webkit-scrollbar-thumb {
    background: var(--border, #2C3E50);
}

[data-theme="dark"] .pipeline-column-body::-webkit-scrollbar-thumb {
    background: var(--border, #2C3E50);
}

/* ── Pipeline delayed banner ── */
[data-theme="dark"] .pipeline-delayed-banner {
    background: linear-gradient(135deg, rgba(255,107,107,0.08), rgba(255,107,107,0.03));
    border-color: rgba(255,107,107,0.2);
}

/* ── Pipeline badges priority — dark contraste ── */
[data-theme="dark"] .badge-priority-baixa {
    background: rgba(148,163,184,0.2);
    color: #ADB5BD;
}

[data-theme="dark"] .badge-priority-normal {
    background: rgba(96,165,250,0.15);
    color: #93c5fd;
}

[data-theme="dark"] .badge-priority-alta {
    background: rgba(255,212,59,0.18);
    color: #FFD43B;
}

/* ── Pipeline chips — dark mode ── */
[data-theme="dark"] .chip-value {
    background: rgba(81,207,102,0.15);
    color: #51CF66;
}

[data-theme="dark"] .chip-approved {
    background: rgba(81,207,102,0.15);
    color: #51CF66;
}

[data-theme="dark"] .chip-assigned {
    background: rgba(96,165,250,0.15);
    color: #93c5fd;
}

[data-theme="dark"] .chip-date {
    background: rgba(148,163,184,0.15);
    color: #ADB5BD;
}

[data-theme="dark"] .chip-financial {
    background: rgba(255,212,59,0.15);
    color: #FFD43B;
}

/* ── Table headers dark — Resolve Problema #10 ── */
[data-theme="dark"] .table thead th {
    background-color: var(--bg-secondary, #16213E);
    color: var(--text-secondary, #ADB5BD);
    border-bottom-color: var(--border, #2C3E50);
}

/* ── Bell dropdown dark ── */
[data-theme="dark"] .navbar-akti #bellDropdownMenu,
[data-theme="dark"] .navbar-akti #notifDropdownMenu {
    background: var(--bg-secondary, #16213E) !important;
    border-color: var(--border, #2C3E50) !important;
}

[data-theme="dark"] .navbar-akti #bellDropdownMenu .dropdown-item,
[data-theme="dark"] .navbar-akti #notifDropdownMenu .dropdown-item {
    color: var(--text-primary, #E8E8E8) !important;
}

[data-theme="dark"] .navbar-akti #bellDropdownMenu .dropdown-item:hover,
[data-theme="dark"] .navbar-akti #notifDropdownMenu .dropdown-item:hover {
    background: var(--bg-tertiary, #0F3460) !important;
}

/* ── Cards and fieldsets dark ── */
[data-theme="dark"] fieldset {
    background: var(--bg-card, #16213E);
    border-color: var(--border, #2C3E50) !important;
}

[data-theme="dark"] fieldset legend {
    color: var(--text-primary, #E8E8E8);
}

/* ── Stock dark mode ── */
[data-theme="dark"] #stockTable tbody tr:hover {
    background-color: rgba(96, 165, 250, 0.06) !important;
}

[data-theme="dark"] #stockTable tbody tr.table-warning {
    animation: none;
    background-color: rgba(255, 212, 59, 0.1) !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Card-headers temáticos (Fase 4)
   Classes para substituir inline backgrounds pastéis
   ═══════════════════════════════════════════════════════════════ */

/* ── Card-header temáticos (light mode) ── */
.card-header-success  { background: #e0f7f1; color: #155724; }
.card-header-warning  { background: #fef5e7; color: #856404; }
.card-header-purple   { background: #f0e6f6; color: #5b2d8e; }
.card-header-danger   { background: #fdecea; color: #721c24; }
.card-header-info     { background: #e8f4fd; color: #0c5460; }
.card-header-orange   { background: #fef3e2; color: #8a4b08; }

[data-theme="dark"] .card-header-success  { background: rgba(81, 207, 102, 0.12);  color: #51CF66; }
[data-theme="dark"] .card-header-warning  { background: rgba(255, 212, 59, 0.12);  color: #FFD43B; }
[data-theme="dark"] .card-header-purple   { background: rgba(187, 143, 206, 0.12); color: #bb8fce; }
[data-theme="dark"] .card-header-danger   { background: rgba(255, 107, 107, 0.12); color: #FF6B6B; }
[data-theme="dark"] .card-header-info     { background: rgba(102, 217, 232, 0.12); color: #66D9E8; }
[data-theme="dark"] .card-header-orange   { background: rgba(240, 178, 122, 0.12); color: #f0b27a; }

/* ── Chips de status (light mode) ── */
.chip-status-approved  { background: #d4edda; color: #155724; }
.chip-status-pending   { background: #fff3cd; color: #856404; }
.chip-status-rejected  { background: #f8d7da; color: #721c24; }

[data-theme="dark"] .chip-status-approved  { background: rgba(81, 207, 102, 0.2);  color: #51CF66; }
[data-theme="dark"] .chip-status-pending   { background: rgba(255, 212, 59, 0.2);  color: #FFD43B; }
[data-theme="dark"] .chip-status-rejected  { background: rgba(255, 107, 107, 0.2); color: #FF6B6B; }

/* ── Seção informativa (walkthrough) ── */
.section-bg-success { background: #f0fdf4; }
.section-bg-info    { background: #eff6ff; }
.section-bg-warning { background: #fefce8; }

[data-theme="dark"] .section-bg-success { background: rgba(81, 207, 102, 0.06); }
[data-theme="dark"] .section-bg-info    { background: rgba(96, 165, 250, 0.06); }
[data-theme="dark"] .section-bg-warning { background: rgba(255, 212, 59, 0.06); }
