/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --font-primary: 'Inter', sans-serif;

    /* Modern Color Palette */
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --info-color: #06b6d4;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;

    /* Sidebar Colors */
    --sidebar-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --sidebar-text: #cbd5e1;
    --sidebar-hover: rgba(59, 130, 246, 0.1);
    --sidebar-active: #3b82f6;
    --sidebar-border: rgba(148, 163, 184, 0.1);

    /* Background Colors */
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* Spacing & Layout */
    --border-radius: 0.75rem;
    --border-radius-sm: 0.5rem;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.3s;
    --transition-fast: 0.15s;

    /* Mobile Breakpoints */
    --mobile-max: 768px;
    --tablet-min: 769px;
    --desktop-min: 1024px;
}

body {
    font-family: var(--font-primary);
    background: var(--body-bg);
    color: var(--dark-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 0.875rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* Layout Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    background: var(--body-bg);
}

/* Layout enforcement: garantir que o conteúdo ocupe a coluna principal
   e que o footer seja empurrado para o final da página. Colocado aqui
   para sobrescrever regras conflitantes em media queries ou estilos
   inline nas views. */
.wrapper {
    align-items: stretch;
}

.sidebar {
    flex: 0 0 280px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

/* Se um footer acabar fora de .content-wrapper (views com marcação quebrada),
   garantir que, mesmo sendo filho direto de .wrapper, ele ocupe 100% da largura
   e fique abaixo do conteúdo (não ao lado da sidebar). */
.wrapper > footer {
    flex: 0 0 100%;
    width: 100%;
    order: 9999;
}

main.content {
    flex: 1 1 auto;
}

.content-wrapper > footer,
.content-wrapper > .footer {
    margin-top: auto;
}

footer.footer,
footer {
    position: relative;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #fff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    z-index: 1040;
    backdrop-filter: blur(10px);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar .brand-text {
    font-weight: 700;
    line-height: 1.1;
    white-space: normal;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-text);
    padding: 0.875rem 1.25rem;
    border-radius: var(--border-radius-sm);
    border-left: 3px solid transparent;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-bottom: 0.125rem;
    position: relative;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--sidebar-active), rgba(59, 130, 246, 0.3));
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    transition: width var(--transition-fast) ease;
    z-index: -1;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: var(--sidebar-hover);
    transform: translateX(4px);
}

.sidebar .nav-link:hover::before {
    width: 100%;
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sidebar .nav-link.active::before {
    width: 100%;
}

.sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.9;
}

.sidebar .nav-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    padding: 1.5rem 1.25rem 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 0.75rem;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .brand-text {
    display: none;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    text-align: center;
}

.sidebar.collapsed .nav-header {
    display: none;
}

.sidebar.collapsed .d-flex.justify-content-between {
    flex-direction: column !important;
    align-items: center !important;
}

.sidebar.collapsed .d-flex.justify-content-between>a {
    margin-bottom: 0.75rem;
}

.sidebar.collapsed .d-flex.justify-content-between i.me-2 {
    margin-right: 0 !important;
}

.sidebar.collapsed #desktopSidebarToggle {
    margin: 0 auto;
}

.sidebar.collapsed .nav-link {
    display: flex;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* Content Area */
.content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

main.content {
    flex: 1 1 auto;
    padding: 2rem;
}

.footer {
    background-color: #fff;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Ensure footer stays at bottom of viewport when content is short */
.content-wrapper > footer,
.content-wrapper > .footer {
    margin-top: auto;
}

/* Components Overrides */
.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    /* Subtle lift effect */
    /* transform: translateY(-2px); */
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    font-weight: 600;
}

.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.btn:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-control,
.form-select {
    border-radius: 0.375rem;
    border-color: #dee2e6;
    padding: 0.6rem 1rem;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    color: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease, transform 0.3s ease;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    z-index: 1040;
}

/* ... */
/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    background: var(--sidebar-bg);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-fast) ease;
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: var(--sidebar-hover);
    transform: scale(1.05);
}

.mobile-menu-toggle i {
    font-size: 1.25rem;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1030;
    opacity: 0;
    transition: opacity var(--transition-fast) ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* Enhanced Mobile Responsiveness */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
        width: 250px;
    }

    .sidebar.collapsed {
        width: 70px;
    }

    .content-wrapper {
        /* A sidebar já ocupa espaço como item flex; sem margin-left extra */
        margin-left: 0;
    }

    /* Ao colapsar, o próprio flex trata o espaço; sem margin-left forçado */
    .sidebar.collapsed~.content-wrapper {
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 1040;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
        transition: left var(--transition-fast) ease;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    /* Cards responsivos */
    .card {
        margin-bottom: 1rem;
        border-radius: var(--border-radius-md);
    }

    .card-header {
        padding: 1rem;
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Tabelas responsivas */
    .table-responsive {
        border-radius: var(--border-radius-md);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 600px;
    }

    /* Botões responsivos */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        /* Touch target size */
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-height: 36px;
    }

    /* Formulários responsivos */
    .form-control {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
        min-height: 44px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    /* Modal responsivo */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: var(--border-radius-lg);
    }

    /* Alertas responsivos */
    .alert {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: var(--border-radius-md);
    }

    /* Navegação responsiva */
    .navbar-brand {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    /* Dashboard responsivo */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
        text-align: center;
    }

    .stat-card .stat-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .stat-card .stat-label {
        font-size: 0.875rem;
    }

    /* Touch-friendly interactions */
    .nav-link,
    .btn,
    .form-control {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Animações e Transições Suaves */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Page transitions */
.page-enter {
    animation: fadeInUp 0.5s ease-out;
}

.card-enter {
    animation: slideInRight 0.4s ease-out;
}

/* Hover effects */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Focus states para acessibilidade */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --card-bg: #2d2d2d;
        --text-color: #e0e0e0;
        --text-muted: #a0a0a0;
        --border-color: #404040;
        --sidebar-bg: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
        --sidebar-hover: rgba(255, 255, 255, 0.1);
        --sidebar-active: #60a5fa;
        --sidebar-text: #e2e8f0;
        --sidebar-border: rgba(255, 255, 255, 0.1);
    }
}

/* Print styles */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --sidebar-active: #0066cc;
        --text-color: #000;
        --bg-color: #fff;
    }

    .sidebar {
        background: #000;
        color: #fff;
    }

    .card {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === MELHORIAS PARA LISTAGEM DE MUDAS === */

/* Container da listagem */
.mudas-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

/* Header da listagem com gradiente */
.mudas-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--dark-color);
    padding: 1.5rem;
    margin: -1rem -1rem 1rem -1rem;
    border-bottom: 1px solid #cbd5e1;
}

.mudas-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Filtros melhorados */
.mudas-filters {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.mudas-filters .form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.mudas-filters .input-group-text {
    background: white;
    border-color: #dee2e6;
}

/* Toggle de visualização */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-toggle .btn {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.view-toggle .btn-outline-light {
    color: var(--secondary-color);
    border-color: #cbd5e1;
    background: white;
}

.view-toggle .btn-outline-light:hover {
    color: var(--dark-color);
    background: #f1f5f9;
}

.view-toggle .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Tabela melhorada */
.mudas-table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.mudas-table .table {
    margin: 0;
    border: none;
}

.mudas-table .table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
    padding: 1rem 0.75rem;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mudas-table .table tbody tr {
    transition: all var(--transition-fast) ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mudas-table .table tbody tr:hover {
    background: rgba(59, 130, 246, 0.02);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mudas-table .table tbody tr:last-child {
    border-bottom: none;
}

.mudas-table .table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border: none;
}

/* Foto da muda */
.muda-foto {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    border: 2px solid #e9ecef;
    transition: transform var(--transition-fast) ease;
}

.muda-foto:hover {
    transform: scale(1.1);
}

/* Nome da muda */
.muda-nome {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.muda-nome-cientifico {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* Campos editáveis */
.editable-input {
    border: 1px solid transparent;
    background: transparent;
    transition: all var(--transition-fast) ease;
    font-size: 0.875rem;
}

.editable-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

/* Grupo de preço editável (inline) */
.editable-price-group {
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: all var(--transition-fast) ease;
    background: transparent;
    flex-wrap: nowrap;
}

.editable-price-group:focus-within {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.editable-price-group .form-control {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0.25rem;
}

.editable-price-group .input-group-text {
    border: none !important;
    background: transparent !important;
    padding-right: 0.25rem;
}

/* Badge de total */
.badge-total {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

/* Indicadores de status */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-estoque-alto {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-estoque-medio {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-estoque-baixo {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-sem-estoque {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Botões de ação */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: all var(--transition-fast) ease;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Visualização em cards */
.mudas-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.muda-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all var(--transition-fast) ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.muda-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.muda-card-header {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.muda-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast) ease;
}

.muda-card:hover .muda-card-header img {
    transform: scale(1.05);
}

.muda-card-body {
    padding: 1.25rem;
}

.muda-card-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.muda-card-subtitle {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.muda-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.muda-card-info-item {
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius-sm);
}

.muda-card-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.muda-card-info-value {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.muda-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
    text-align: center;
    margin-bottom: 1rem;
}

.muda-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Responsividade */
@media (max-width: 768px) {
    .mudas-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mudas-table .table td {
        padding: 0.75rem 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .muda-card-info {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .mudas-cards {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.muda-card,
.mudas-table tbody tr {
    animation: fadeInUp 0.5s ease-out;
}

/* Loading states */
.mudas-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.mudas-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

/* Empty state */
.mudas-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.mudas-empty .bi {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mudas-empty h5 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.mudas-empty p {
    margin-bottom: 2rem;
}

/* ══════════════════════════════════════════════════════
   STAT BOXES — redesign moderno (substitui as boxes com
   bordas coloridas usadas em Mudas, Almoxarifado, etc.)
══════════════════════════════════════════════════════ */
.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-radius: 14px;
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    transition: transform .18s, box-shadow .18s;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .11);
}

.stat-box .stat-box-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-box .stat-box-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    opacity: .6;
    margin-bottom: .12rem;
}

.stat-box .stat-box-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-box .stat-box-sub {
    font-size: .72rem;
    opacity: .5;
    margin-top: .1rem;
}

/* colour variants */
.stat-box-cyan {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
}

.stat-box-cyan .stat-box-icon {
    background: #99f6e4;
    color: #0f766e;
}

.stat-box-cyan .stat-box-value {
    color: #0f766e;
}

.stat-box-green {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.stat-box-green .stat-box-icon {
    background: #bbf7d0;
    color: #166534;
}

.stat-box-green .stat-box-value {
    color: #166534;
}

.stat-box-gold {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.stat-box-gold .stat-box-icon {
    background: #fde68a;
    color: #92400e;
}

.stat-box-gold .stat-box-value {
    color: #92400e;
}

.stat-box-blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.stat-box-blue .stat-box-icon {
    background: #bfdbfe;
    color: #1e40af;
}

.stat-box-blue .stat-box-value {
    color: #1e40af;
}

.stat-box-violet {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.stat-box-violet .stat-box-icon {
    background: #ddd6fe;
    color: #5b21b6;
}

.stat-box-violet .stat-box-value {
    color: #5b21b6;
}

/* ══════════════════════════════════════════════════════
   LISTING TABLE — cabeçalho fixo, zebra, hover highlight
══════════════════════════════════════════════════════ */
.listing-table-wrap {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    background: #fff;
}

.listing-table-wrap .table {
    margin: 0;
}

.listing-table-wrap .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    padding: .9rem .75rem;
    vertical-align: middle;
    white-space: nowrap;
}

.listing-table-wrap .table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.listing-table-wrap .table tbody tr:hover {
    background: #f0fdf4 !important;
}

.listing-table-wrap .table tbody tr:last-child {
    border-bottom: none;
}

.listing-table-wrap .table tbody td {
    vertical-align: middle;
    padding: .7rem .75rem;
    font-size: .85rem;
}

/* action button group inside tables */
.table-actions .btn {
    padding: .25rem .55rem;
    font-size: .78rem;
    border-radius: 8px;
}

.stat-box-amber {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.stat-box-amber .stat-box-icon {
    background: #fde68a;
    color: #92400e;
}

.stat-box-amber .stat-box-value {
    color: #b45309;
}

.stat-box-red {
    background: linear-gradient(135deg, #fff5f5, #fee2e2);
}

.stat-box-red .stat-box-icon {
    background: #fecaca;
    color: #991b1b;
}

.stat-box-red .stat-box-value {
    color: #991b1b;
}

/* ══════════════════════════════════════════════════════
   FUNCIONÁRIOS TABLE — modern employee listing card
══════════════════════════════════════════════════════ */
.func-table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .07);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.func-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-bottom: 1px solid #bbf7d0;
}

.func-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #166534;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.func-count-badge {
    background: #166534;
    color: #fff;
    padding: .35rem .7rem;
    border-radius: 20px;
    font-size: .72rem;
    letter-spacing: .03em;
}

/* Table headers */
.func-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #64748b;
    padding: .8rem .9rem;
    white-space: nowrap;
    vertical-align: middle;
}

.func-table tbody tr.func-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}

.func-table tbody tr.func-row:hover {
    background: #f0fdf4;
}

.func-table tbody td {
    padding: .75rem .9rem;
    vertical-align: middle;
}

/* Sort links in headers */
.sort-link {
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.sort-link:hover {
    color: #0f766e;
}

.sort-link.active {
    color: #0f766e;
}

.sort-link i {
    opacity: .45;
    font-size: .65rem;
}

.sort-link.active i {
    opacity: 1;
}

/* Employee avatar circle */
.func-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -.02em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.func-name {
    font-size: .88rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.func-sub {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: .1rem;
}

.func-cargo {
    font-size: .83rem;
    color: #334155;
    font-weight: 600;
}

/* Sector pill with dynamic color */
.func-setor-pill {
    display: inline-block;
    margin-top: .25rem;
    padding: .18rem .55rem;
    border-radius: 20px;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(var(--sc-rgb, 15, 118, 110), .1);
    color: var(--sc, #0f766e);
    border: 1px solid rgba(var(--sc-rgb, 15, 118, 110), .2);
}

/* Fallback: just use color from the CSS variable inline style */
[style*="--sc:"] .func-setor-pill {
    color: var(--sc);
}

/* Modalidade badges */
.func-badge {
    display: inline-flex;
    align-items: center;
    padding: .28rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
}

.func-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.func-badge-amber {
    background: #fef3c7;
    color: #92400e;
}

/* Currency value */
.func-value {
    font-size: .9rem;
    font-weight: 800;
    color: #166534;
}

/* Fechamento status pills */
.func-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .65rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.func-status-ok {
    background: #dcfce7;
    color: #166534;
}

.func-status-pending {
    background: #f1f5f9;
    color: #94a3b8;
}

/* Sector group row */
.func-sector-row td {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: .55rem .9rem !important;
}

.func-sector-label {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #475569;
}

.func-sector-subtotal {
    font-size: .78rem;
    color: #64748b;
}

/* Action buttons */
.func-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: .82rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background .12s, transform .1s;
    background: none;
    text-decoration: none;
}

.func-action-btn:hover {
    transform: scale(1.1);
}

.func-btn-info {
    color: #0369a1;
    border-color: #bae6fd;
}

.func-btn-info:hover {
    background: #e0f2fe;
}

.func-btn-edit {
    color: #475569;
    border-color: #e2e8f0;
}

.func-btn-edit:hover {
    background: #f1f5f9;
}

.func-btn-check {
    color: #166534;
    border-color: #bbf7d0;
}

.func-btn-check:hover {
    background: #dcfce7;
}

.func-btn-delete {
    color: #dc2626;
    border-color: #fecaca;
}

.func-btn-delete:hover {
    background: #fee2e2;
}

/* Pagination strip */
.func-pagination {
    padding: .75rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* ══════════════════════════════════════════════════════
   UNIVERSAL LISTING CARD — applied to all .mudas-container
══════════════════════════════════════════════════════ */

/* Override base .mudas-table to card style */
.mudas-container {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.mudas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.mudas-header h4,
.mudas-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Count badge used in mudas-header */
.mudas-count-badge {
    display: inline-flex;
    align-items: center;
    padding: .28rem .65rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    background: #1e293b;
    color: #fff;
    letter-spacing: .03em;
}

/* Table headers inside mudas-table — override existing */
.mudas-table .table thead th {
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    padding: .8rem .9rem !important;
}

/* Row hover — green tint */
.mudas-table .table tbody tr:hover {
    background: #f0fdf4 !important;
    transform: none !important;
    box-shadow: none !important;
}

.mudas-table .table td {
    padding: .75rem .9rem !important;
}

/* sortable-header links */
.mudas-table .sortable-header {
    color: #64748b !important;
    text-decoration: none !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
}

.mudas-table .sortable-header:hover {
    color: #0f766e !important;
}

/* Compact action buttons inside tables */
.mudas-table .btn-group .btn,
.mudas-table .btn-group-sm .btn {
    width: 30px;
    height: 30px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: .82rem !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    transition: background .12s, transform .1s !important;
}

.mudas-table .btn-group .btn:hover,
.mudas-table .btn-group-sm .btn:hover {
    transform: scale(1.1);
}

/* Hide button text labels, show only icons */
.mudas-table .btn-group .btn>i+*,
.mudas-table .btn-group-sm .btn>i+* {
    display: none;
}

/* Pagination in mudas-table */
.mudas-table .card-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: .75rem 1.25rem;
}
/* Global Listing Components */
.qty-display { display: block; text-align: right; font-variant-numeric: tabular-nums; font-family: "Roboto Mono", "Courier New", monospace; }
.qty-unit { display: block; font-size: 0.85rem; color: #6c757d; margin-top: 0.125rem; }

.view-toggle .btn.active {
    background-color: #6c757d;
    color: white;
}

/* Item Name Formatting */
.item-nome, .muda-nome {
    font-weight: 600;
    font-size: .92rem;
    color: #1a1a2e;
}

.item-nome-secundario, .muda-nome-cientifico {
    font-style: italic;
    font-size: .75rem;
    color: #6c757d;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.item-nome-secundario:empty::before, .muda-nome-cientifico:empty::before {
    content: "";
    color: #ced4da;
    font-style: normal;
}

/* QR Code Grid Components */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    padding: 15px 0;
}
.qr-card {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    page-break-inside: avoid;
}
.qr-header {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    width: 100%;
    text-align: center;
    padding-bottom: 5px;
}
.qr-body {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 15px;
}
.qr-code-placeholder {
    width: 90px;
    height: 90px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-code-placeholder img {
    max-width: 100%;
    height: auto;
}
.qr-info {
    flex: 1;
}


.qr-subtitle-small {
    font-size: 0.75rem;
    color: #888;
}

/* Print Rules - QR Codes */
@media print {
    body * {
        visibility: hidden;
    }
    #qrcodes-view, #qrcodes-view * {
        visibility: visible;
    }
    #qrcodes-view {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white;
    }
    .almoxarifado-header, .mudas-header {
        display: none !important;
    }
    .qr-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0;
    }
    .qr-card {
        border: 1px solid #000;
    }
    .btn {
        display: none !important;
    }
    p.text-muted {
        display: none !important;
    }
}

