/* LVMNG Style - Inspirado no ERPNext (Frappe) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1b202c; /* Cinza bem escuro do ERPNext */
    --accent-color: #3182ce; /* Azul para links e botões primários */
    --accent-color-hover: #2b6cb0;
    --bg-main: #f8fafc; /* Cor de fundo suave */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #2d3748;
    --text-muted: #718096;
    --text-white: #ffffff;
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --radius: 6px;
    
    /* Cores de status */
    --status-draft-bg: #edf2f7;
    --status-draft-text: #4a5568;
    --status-pending-bg: #feebc8;
    --status-pending-text: #c05621;
    --status-approved-bg: #c6f6d5;
    --status-approved-text: #22543d;
    --status-rejected-bg: #fed7d7;
    --status-rejected-text: #9b2c2c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    font-size: 14px;
    line-height: 1.5;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* Layout Principal */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Barra Lateral (Sidebar) */
.sidebar {
    width: var(--sidebar-width);
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 100;
    transition: width 0.2s ease, transform 0.25s ease-in-out;
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
}

/* Toggle button next to logo in sidebar header */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    padding: 0;
}

.sidebar-toggle-btn:hover {
    background-color: #edf2f7;
    color: var(--primary-color);
}

.sidebar-toggle-btn .icon-collapse {
    display: block;
}

.sidebar-toggle-btn .icon-expand {
    display: none;
}

/* Sidebar Minimizada/Collapsed */
.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0 16px;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    width: 100%;
}

.sidebar.collapsed .sidebar-logo {
    transition: opacity 0.15s ease;
}

.sidebar.collapsed .brand-text {
    display: none !important;
}

.sidebar.collapsed .sidebar-toggle-btn {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.sidebar.collapsed .sidebar-toggle-btn .icon-collapse {
    display: none;
}

.sidebar.collapsed .sidebar-toggle-btn .icon-expand {
    display: block;
}

/* Hover effect: hide logo and show expand button */
.sidebar.collapsed .sidebar-header:hover .sidebar-logo {
    opacity: 0;
}

.sidebar.collapsed .sidebar-header:hover .sidebar-toggle-btn {
    display: flex;
}

.sidebar.collapsed .sidebar-menu-item span {
    display: none !important;
}

.sidebar.collapsed .sidebar-menu-item a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-menu-item i {
    margin-right: 0;
    font-size: 18px;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 16px 0;
}

.sidebar.collapsed .sidebar-footer .user-info {
    display: none !important;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
}

.sidebar-brand {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
}

.sidebar-brand span.subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.sidebar-search {
    padding: 12px 20px;
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #f7fafc;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.sidebar-search input:focus {
    border-color: var(--text-muted);
    background-color: #ffffff;
}

.sidebar-search-kbd {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
    background: #edf2f7;
    padding: 2px 4px;
    border-radius: 3px;
    pointer-events: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar-menu-item a:hover {
    background-color: #f7fafc;
    color: var(--primary-color);
}

.sidebar-menu-item.active a {
    background-color: #edf2f7;
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu-item i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #cbd5e0;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 10px;
    font-size: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Área de Conteúdo Principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Barra Superior (Topbar) */
.topbar {
    height: var(--topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 15px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    transition: background-color 0.15s ease;
}

.menu-toggle:hover {
    background-color: #edf2f7;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span.separator {
    margin: 0 8px;
    color: #cbd5e0;
}

.breadcrumbs span.active {
    color: var(--primary-color);
    font-weight: 600;
}

.status-badge {
    margin-left: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-rascunho { background-color: var(--status-draft-bg); color: var(--status-draft-text); }
.status-pendente { background-color: var(--status-pending-bg); color: var(--status-pending-text); }
.status-aprovado { background-color: var(--status-approved-bg); color: var(--status-approved-text); }
.status-rejeitado { background-color: var(--status-rejected-bg); color: var(--status-rejected-text); }
.status-solicitado { background-color: #ebf8ff; color: #2b6cb0; }
.status-aguardando-cotação, .status-aguardando-cotacao { background-color: #e2dcfc; color: #553c9a; }
.status-reprovado { background-color: var(--status-rejected-bg); color: var(--status-rejected-text); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

.btn:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-color-hover);
    border-color: var(--accent-color-hover);
}

.btn-danger {
    background-color: #e53e3e;
    border-color: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c53030;
    border-color: #c53030;
}

/* Ajustes de cor de texto para links (a) atuando como botões */
a.btn {
    color: var(--text-main);
}
a.btn:hover {
    color: var(--text-main);
    text-decoration: none;
}
a.btn-primary {
    color: white;
}
a.btn-primary:hover {
    color: white;
    text-decoration: none;
}
a.btn-danger {
    color: white;
}
a.btn-danger:hover {
    color: white;
    text-decoration: none;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Scrollable Content */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Mensagens de Alerta (Flash Messages) */
.alert-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success { background-color: #f0fff4; color: #22543d; border: 1px solid #c6f6d5; }
.alert-danger { background-color: #fff5f5; color: #9b2c2c; border: 1px solid #fed7d7; }
.alert-warning { background-color: #fffaf0; color: #dd6b20; border: 1px solid #feebc8; }
.alert-info { background-color: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }

.alert-close {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    color: inherit;
    font-weight: bold;
}

/* Grid e Cartões de Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card-stat {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.card-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.card-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.card-stat-total {
    color: var(--accent-color);
}

/* Tabela de Dados Geral */
.card-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.table-title {
    font-weight: 600;
    font-size: 15px;
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-search {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
}

.select-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    background-color: #ffffff;
    outline: none;
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #f7fafc;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    white-space: nowrap;
}

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

.data-table tbody tr:hover td {
    background-color: #fcfcfd;
    cursor: pointer;
}

/* Formulários */
.form-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.form-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.form-tab-item {
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.form-tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 30px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: span 2;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.form-label span.required {
    color: #e53e3e;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    background-color: #f7fafc;
    outline: none;
    transition: all 0.15s ease;
}

.form-input:focus {
    border-color: #cbd5e0;
    background-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(203, 213, 224, 0.2);
}

.form-input[readonly] {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

/* Tabela Dinâmica de Itens (Estilo ERPNext) */
.items-table-section {
    margin-top: 30px;
}

.items-table-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.items-table th {
    background-color: #f7fafc;
    padding: 10px;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.items-table td {
    padding: 6px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.items-table th:last-child, .items-table td:last-child {
    border-right: none;
}

.items-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 13px;
    outline: none;
}

.items-table input:focus {
    border-color: #cbd5e0;
    background-color: #ffffff;
}

.item-row-action {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-row {
    color: #e53e3e;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.items-table-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

/* Totais no Formulário */
.totals-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.total-card {
    background-color: #f7fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-card-label {
    font-weight: 600;
    color: var(--text-muted);
}

.total-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Seção de Aprovação e Comentários (Linha do tempo) */
.timeline-section {
    margin-top: 40px;
}

.timeline-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.timeline-list {
    position: relative;
    padding-left: 24px;
    list-style: none;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e0;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #cbd5e0;
}

.timeline-item.approved::before {
    background-color: #48bb78;
    box-shadow: 0 0 0 2px #48bb78;
}

.timeline-item.rejected::before {
    background-color: #f56565;
    box-shadow: 0 0 0 2px #f56565;
}

.timeline-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-meta strong {
    color: var(--text-main);
}

.timeline-bubble {
    background-color: #f7fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    display: inline-block;
    max-width: 100%;
}

.timeline-badge-change {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-badge-change span.status {
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* Painel de Ações de Aprovação */
.approval-panel {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 30px;
}

.approval-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
}

.approval-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
    margin-bottom: 16px;
    resize: vertical;
}

.approval-textarea:focus {
    border-color: #cbd5e0;
}

.approval-actions {
    display: flex;
    gap: 10px;
}

/* Tela de Login & Registro */
.auth-body {
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
}

.auth-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-title {
    font-weight: 700;
    font-size: 22px;
    color: var(--primary-color);
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-btn-container {
    margin-top: 24px;
}

.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsividade Geral */
@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: 99;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group-full {
        grid-column: span 1;
    }
    
    .totals-section {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        padding: 0 16px;
    }
    
    .content-body {
        padding: 16px;
    }
    
    .topbar-right span.user-role-label {
        display: none;
    }
}

/* Topbar Notification Bell & Settings Styling */
.notification-topbar-link, .settings-topbar-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.notification-topbar-link:hover, .settings-topbar-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ff3b30;
    color: white;
    border-radius: 50%;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    border: 2px solid #ffffff;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
/* ==========================================================================
   QUADRO KANBAN & NAVEGAÇÃO HORIZONTAL (ESTILO PIPEFY)
   ========================================================================== */

/* Esconde barra lateral e overlay */
.sidebar, .sidebar-overlay, .menu-toggle {
    display: none !important;
}

/* Ajusta o container principal para fluxo vertical */
.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Transições suaves para recolhimento da barra superior */
.topbar {
    width: 100%;
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease, border-bottom 0.3s ease, opacity 0.2s ease;
    overflow: hidden;
    height: var(--topbar-height);
}

.app-container.top-header-collapsed .topbar {
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Barra Secundária Horizontal (Sub-Header) */
.sub-header-nav {
    height: 48px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 98;
}

.sub-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-header-item {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.sub-header-item:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.sub-header-item.active {
    background-color: #edf2f7;
    color: var(--accent-color);
}

.sub-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Dropdown Menu para a aba "Lista" */
.sub-header-item-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu-list {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 6px 0;
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.dropdown-menu-list.show {
    display: block;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dropdown-menu-item:hover {
    background-color: #f1f5f9;
    color: var(--accent-color);
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Barra de pesquisa de cards no Sub-Header */
.search-input-wrapper-sub-header {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-sub {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}

.sub-header-search-input {
    width: 180px;
    padding: 6px 28px 6px 30px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: #f8fafc;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
}

.sub-header-search-input:focus {
    width: 240px;
    background-color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.btn-clear-search-sub {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #475569;
    font-size: 8px;
    transition: all 0.2s ease;
    z-index: 5;
}

.btn-clear-search-sub:hover {
    background-color: #cbd5e1;
    color: #0f172a;
}

/* Controles de Tela (Botões de Filtro e Ocultação) */
.sub-header-filter-btn, .sub-header-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sub-header-filter-btn:hover, .sub-header-toggle-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
    border-color: #cbd5e1;
}

.sub-header-filter-btn.active {
    background-color: #fee2e2;
    color: #DE3163;
    border-color: #fca5a5;
}

/* Painel de Filtros Rápidos */
.kanban-filters-pane {
    display: none;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    z-index: 97;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.kanban-filters-pane.show {
    display: block;
    animation: slideDownPane 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.filters-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.filters-pane-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
}

@keyframes slideDownPane {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Remove scroll vertical da pagina quando estiver no Kanban */
body:has(.dashboard-kanban-container) {
    overflow: hidden;
}

body:has(.dashboard-kanban-container) .content-body {
    padding: 0;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height) - 48px);
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.top-header-collapsed .content-body {
    height: calc(100vh - 48px) !important;
}

.dashboard-kanban-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    overflow: hidden;
    padding: 16px 20px 0 20px;
}

/* Header bar above Kanban columns */
.kanban-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.kanban-view-modes {
    display: flex;
    gap: 8px;
}

.kanban-view-modes .view-mode {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.kanban-view-modes .view-mode.active {
    background-color: #e2e8f0;
    color: #0f172a;
}

/* Horizontal scrollable board container */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    flex: 1;
    padding-bottom: 24px;
    align-items: stretch;
    height: calc(100% - 50px);
}

/* Kanban column card-lane */
.kanban-column {
    flex: 0 0 290px;
    width: 290px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-column-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background-color: #ffffff;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
}

.kanban-column-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Coluna header color borders style */
.kanban-column[data-lane="requisicoes"] .kanban-column-header::before { background-color: #DE930D; }
.kanban-column[data-lane="cotacoes"] .kanban-column-header::before { background-color: #E2583E; }
.kanban-column[data-lane="ordens_compra"] .kanban-column-header::before { background-color: #D7385E; }
.kanban-column[data-lane="pagamentos"] .kanban-column-header::before { background-color: #7A40F2; }
.kanban-column[data-lane="entregas"] .kanban-column-header::before { background-color: #3182CE; }
.kanban-column[data-lane="compras"] .kanban-column-header::before { background-color: #38A169; }

.kanban-column-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-title {
    color: #0f172a;
    font-weight: 700;
    font-size: 14px;
}

.kanban-column-count {
    font-size: 11px;
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 700;
}

.kanban-column-add-btn {
    color: var(--text-muted);
    font-size: 13px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.kanban-column-add-btn:hover {
    background-color: #f1f5f9;
    color: var(--accent-color);
}

.kanban-cards-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom empty card helper */
.kanban-empty-column {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.4);
}

.kanban-column-description {
    padding: 12px 14px;
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-top: 1px solid rgba(0,0,0,0.03);
}

/* Kanban Cards styling */
.kanban-card {
    background-color: #ffffff;
    border-radius: 6px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

.kanban-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.priority-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.priority-badge.priority-p1, .priority-badge.priority-crítica {
    background-color: #fee2e2;
    color: #991b1b;
}

.priority-badge.priority-p2, .priority-badge.priority-alta {
    background-color: #ffedd5;
    color: #9a3412;
}

.priority-badge.priority-p3, .priority-badge.priority-média {
    background-color: #fef9c3;
    color: #854d0e;
}

.priority-badge.priority-p4, .priority-badge.priority-baixa {
    background-color: #dcfce7;
    color: #166534;
}

.kanban-card-link {
    width: 20px;
    height: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 8px;
    transition: all 0.2s ease;
}

.kanban-card-link:hover {
    background-color: #f8fafc;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.kanban-card-title {
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
}

.kanban-card-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item {
    display: flex;
    align-items: baseline;
    font-size: 11px;
}

.detail-label {
    color: #64748b;
    font-weight: 700;
    width: 95px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-label i {
    font-size: 7px;
    color: #94a3b8;
}

.detail-value {
    color: #334155;
    word-break: break-word;
    font-weight: 500;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
    margin-top: 4px;
}

.due-date-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 4px;
}

.due-date-badge.overdue {
    background-color: #ef4444;
    color: #ffffff;
}

.time-left-text {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

/* Floating Bottom Left Button styling - Fica fixo a left: 24px */
.btn-create-card-floating {
    position: fixed;
    bottom: 24px;
    left: 24px !important;
    z-index: 99;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: #3182ce;
    border: 1px solid #3182ce;
    border-radius: 50px;
    box-shadow: 0 10px 15px -3px rgba(49, 130, 206, 0.3), 0 4px 6px -2px rgba(49, 130, 206, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.btn-create-card-floating:hover {
    background-color: #2b6cb0;
    border-color: #2b6cb0;
    transform: scale(1.05);
    color: #ffffff;
}

/* Adjust float button on mobile */
@media (max-width: 768px) {
    .btn-create-card-floating {
        left: 20px !important;
        bottom: 20px;
    }
}

/* ==========================================================================
   GLOBAL NOTIFICATIONS DRAWER
   ========================================================================== */

.notifications-drawer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 330px;
    max-height: 420px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.notifications-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.notifications-drawer-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8fafc;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.notifications-drawer-title {
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.notifications-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.notifications-drawer-close:hover {
    background-color: #edf2f7;
    color: var(--primary-color);
}

.notifications-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-card-item {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    position: relative;
    font-size: 12px;
    line-height: 1.4;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-card-item:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.notification-card-item.fade-out {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
    margin-top: -50px;
    pointer-events: none;
}

.notification-card-dismiss {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.notification-card-dismiss:hover {
    color: #ef4444;
    background-color: #fee2e2;
}

.notification-card-text {
    padding-right: 20px;
    color: var(--text-main);
    word-break: break-word;
}

.notification-card-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--accent-color);
    font-weight: 600;
}

.notification-card-link:hover {
    text-decoration: underline;
}

.notification-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   CONFIGURAÇÃO DE COLUNAS & ORDENAÇÃO INTERATIVA (LIST VIEW)
   ========================================================================== */

.sub-header-columns-dropdown {
    position: relative;
    display: inline-block;
}

.sub-header-columns-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sub-header-columns-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
    border-color: #cbd5e1;
}

/* Responsive adjustment: on larger screens, show text and icon */
@media (min-width: 992px) {
    .sub-header-columns-btn {
        border-radius: 4px;
        width: auto;
        height: auto;
        padding: 6px 12px;
        font-size: 13px;
        font-weight: 600;
        gap: 6px;
    }
}

.dropdown-menu-columns {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.dropdown-menu-columns.show {
    display: block;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-columns-header {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8fafc;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.dropdown-columns-body {
    padding: 8px 12px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.column-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
    user-select: none;
}

.column-checkbox-label:hover {
    background-color: #f1f5f9;
    color: var(--accent-color);
}

.column-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-color);
    cursor: pointer;
    width: 14px;
    height: 14px;
}

/* th sortable styles */
.data-table th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 28px !important;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.data-table th.sortable:hover {
    background-color: #edf2f7;
    color: var(--accent-color);
}

.sort-indicator {
    font-size: 10px;
    color: var(--accent-color);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* ==========================================================================
   MODAL DE REQUISIÇÃO (ESTILO PIPEFY POP-UP OVERLAY)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.requisition-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 92%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(24px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-in-out;
    opacity: 0;
    overflow: hidden;
}

.modal-overlay.show .requisition-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.requisition-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    flex-shrink: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.requisition-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.modal-title-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: #eff6ff;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.modal-title-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.form-group-modal {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.modal-label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.modal-label span.required {
    color: #e53e3e;
}

.modal-input, .modal-select, .modal-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13.5px;
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    color: var(--text-main);
}

.modal-input:focus, .modal-select:focus, .modal-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.modal-textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-input-file {
    padding: 10px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    background-color: #f8fafc;
    cursor: pointer;
}

/* Notion-style Tags inside Modal */
.modal-tag-input-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-tag-input-container:hover {
    border-color: #cbd5e0;
}

.modal-tag-input-container.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.modal-selected-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-tag-input-placeholder {
    color: var(--text-muted);
    font-size: 13.5px;
    pointer-events: none;
}

.modal-tag-dropdown-box {
    position: absolute;
    z-index: 1000;
    width: 100%;
    margin-top: 4px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 0;
}

.modal-tag-dropdown-title {
    padding: 4px 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.modal-tag-dropdown-options {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}

.modal-tag-dropdown-option-item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.1s ease;
}

.modal-tag-dropdown-option-item:hover {
    background-color: #f1f5f9;
}

.modal-tag-dropdown-option-item.selected {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: #f8fafc;
}

.modal-tag-option-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background-color: #e2e8f0;
    color: #4a5568;
}

.modal-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background-color: #e2e8f0;
    color: #4a5568;
}

.modal-tag-badge-remove {
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    color: #718096;
    margin-left: 2px;
    transition: all 0.1s ease;
}

.modal-tag-badge-remove:hover {
    background-color: #cbd5e0;
    color: #2d3748;
}

/* Dynamic Items List Section */
.items-section-modal {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    background-color: #f8fafc;
}

.modal-add-item-btn {
    background: none;
    border: 1px dashed var(--accent-color);
    color: var(--accent-color);
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.modal-add-item-btn:hover {
    background-color: #ebf8ff;
    border-style: solid;
}

.modal-section-help {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.modal-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.modal-remove-item-btn {
    background: none;
    border: 1px solid #fed7d7;
    color: #e53e3e;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.modal-remove-item-btn:hover {
    background-color: #fff5f5;
    border-color: #fc8181;
}

/* Tabs inside Modal */
.modal-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: 20px 0 16px 0;
    gap: 16px;
}

.modal-tab-btn {
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-tab-btn:hover {
    color: var(--primary-color);
}

.modal-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

/* Footer / Submit Buttons */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    flex-shrink: 0;
}

.btn-modal-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-modal-cancel:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.btn-modal-draft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--status-draft-bg);
    color: var(--status-draft-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-modal-draft:hover {
    background-color: #e2e8f0;
}

.btn-modal-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--accent-color);
    background-color: var(--accent-color);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-modal-submit:hover {
    background-color: var(--accent-color-hover);
    border-color: var(--accent-color-hover);
}

/* ==========================================================================
   CONFIGURAÇÃO DE COLUNAS & LIST VIEW SCROLLING
   ========================================================================== */

/* Garantir que somente a tabela role horizontalmente sem quebra de linhas */
body:has(.dashboard-kanban-container) .card-table-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: calc(100% - 20px);
    margin-bottom: 16px;
}

body:has(.dashboard-kanban-container) .table-responsive {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
}

.data-table th,
.data-table td {
    white-space: nowrap !important;
}

/* ==========================================================================
   ELEMENTOS DE CAMPOS ESTILO PIPEFY (SELEÇÃO E CARDS CUSTOMIZADOS)
   ========================================================================== */

.pipefy-custom-field-container {
    width: 100%;
    position: relative;
}

.pipefy-add-btn {
    border: 1px dashed #cbd5e1;
    color: #2563eb;
    background-color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    width: auto;
    outline: none;
}

.pipefy-add-btn:hover {
    background-color: #eff6ff;
    border-color: #3b82f6;
    border-style: solid;
}

.pipefy-selected-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    width: 100%;
}

.pipefy-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.pipefy-card-details {
    flex: 1;
    overflow: hidden;
}

.pipefy-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipefy-card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.pipefy-card-menu-trigger {
    cursor: pointer;
    color: #94a3b8;
    font-size: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    position: relative;
}

.pipefy-card-menu-trigger:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.pipefy-card-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    z-index: 100;
    display: none;
    min-width: 110px;
    padding: 4px 0;
    margin-top: 2px;
}

.pipefy-card-menu-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.pipefy-card-menu-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #ef4444;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-align: left;
}

.pipefy-card-menu-item:hover {
    background-color: #fee2e2;
}

/* Pipefy dropdown selector box */
.pipefy-dropdown-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 2600;
    margin-top: 4px;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pipefy-dropdown-search-wrapper {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    background-color: #ffffff;
}

.pipefy-dropdown-search-wrapper .search-icon {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: 8px;
}

.pipefy-dropdown-search-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 13.5px;
    color: var(--text-main);
    background: transparent;
}

.pipefy-dropdown-options-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.pipefy-dropdown-option {
    padding: 10px 16px;
    font-size: 13.5px;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-align: left;
}

.pipefy-dropdown-option:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}
.pipefy-dropdown-option.selected {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
    opacity: 0.7;
}

/* Custom styling for dynamic items in modal/forms */
.modal-item-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.15s ease;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.modal-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.modal-item-main-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.modal-item-main-row .item-name-input {
    flex: 1 !important;
}

.modal-item-main-row .item-qty-input {
    width: 80px !important;
    text-align: center;
}

.modal-item-main-row .item-uom-select {
    width: 110px !important;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0 10px;
    background-color: #ffffff;
    font-size: 13.5px;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

.modal-item-sub-row {
    display: flex;
    gap: 16px;
    width: 100%;
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
}

.modal-item-sub-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-item-sub-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.item-file-upload-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 6px 10px;
    background-color: #f8fafc;
    cursor: pointer;
    overflow: hidden;
    height: 38px;
    transition: background-color 0.15s ease;
}

.item-file-upload-wrapper:hover {
    background-color: #f1f5f9;
}

.item-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.item-file-upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0;
}

.item-file-preview-name {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 180px;
}

.item-file-preview-name a.existing-att-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
}

.item-file-preview-name a.existing-att-link:hover {
    color: var(--accent-color);
}
