/* ========================================
   REDEINNOV COLOR SCHEME
   ======================================== */

:root {
    /* Primary Brand Colors */
    --primary-lime: #C6D92D;
    --primary-charcoal: #3A3732;
    
    /* Neutral & Background Palette */
    --bg-light: #F9F9F7;
    --mid-gray: #DAD8D3;
    --dark-bg: #2A2723;
    
    /* Accent & Support Colors */
    --accent-blue: #5BA4FF;
    --soft-olive: #A5B858;
    --warm-beige: #EFECE4;
    
    /* Functional Colors */
    --hover-lime: #AFC026;
    --text-primary: #3A3732;
    --text-secondary: #55524C;
    
    /* Status Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #5BA4FF;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Links */
a, .btn-link {
    color: var(--accent-blue);
    transition: color 0.3s ease;
}

a:hover, .btn-link:hover {
    color: var(--primary-lime);
}

/* Base Button Styling - Applied to ALL Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-width: 2px;
    padding: 0.625rem 1.25rem;
}

/* Primary Buttons - Lime Green */
.btn-primary {
    color: var(--primary-charcoal) !important;
    background-color: var(--primary-lime) !important;
    border-color: var(--primary-lime) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    background-color: var(--hover-lime) !important;
    border-color: var(--hover-lime) !important;
    color: var(--primary-charcoal) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(198, 217, 45, 0.4) !important;
}

.btn-primary:active,
.btn-primary:focus {
    background-color: var(--hover-lime) !important;
    border-color: var(--hover-lime) !important;
    color: var(--primary-charcoal) !important;
}

.btn-primary:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background-color: var(--mid-gray) !important;
    border-color: var(--mid-gray) !important;
}

/* Secondary Buttons */
.btn-secondary {
    color: var(--primary-lime) !important;
    background-color: transparent !important;
    border: 2px solid var(--primary-lime) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-secondary:hover {
    background-color: var(--primary-lime) !important;
    color: var(--primary-charcoal) !important;
    transform: translateY(-1px) !important;
}

/* Success Buttons - Use Lime Green Theme */
.btn-success {
    color: var(--primary-charcoal) !important;
    background-color: var(--primary-lime) !important;
    border-color: var(--primary-lime) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-success:hover {
    background-color: var(--hover-lime) !important;
    border-color: var(--hover-lime) !important;
    color: var(--primary-charcoal) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(198, 217, 45, 0.4) !important;
}

.btn-success:active,
.btn-success:focus {
    background-color: var(--hover-lime) !important;
    border-color: var(--hover-lime) !important;
    color: var(--primary-charcoal) !important;
}

/* Danger/Delete Buttons */
.btn-danger {
    color: white !important;
    background-color: var(--error) !important;
    border-color: var(--error) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

/* Warning Buttons */
.btn-warning {
    color: var(--primary-charcoal);
    background-color: var(--soft-olive);
    border-color: var(--soft-olive);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background-color: #8A9447;
    border-color: #8A9447;
    color: var(--primary-charcoal);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(165, 184, 88, 0.4);
}

/* Info Buttons */
.btn-info {
    color: white;
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-info:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 164, 255, 0.4);
}

/* Outline Buttons */
.btn-outline-primary {
    color: var(--primary-lime) !important;
    background-color: transparent !important;
    border: 2px solid var(--primary-lime) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-lime) !important;
    border-color: var(--primary-lime) !important;
    color: var(--primary-charcoal) !important;
    transform: translateY(-1px) !important;
}

.btn-outline-secondary {
    color: var(--text-secondary) !important;
    background-color: transparent !important;
    border: 2px solid var(--mid-gray) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-outline-secondary:hover {
    background-color: var(--mid-gray) !important;
    border-color: var(--mid-gray) !important;
    color: var(--primary-charcoal) !important;
    transform: translateY(-1px) !important;
}

/* Button Sizes - Consistent Styling */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    border-radius: 10px;
}

/* Button Groups */
.btn-group .btn {
    margin: 0;
}

/* Disabled State for All Buttons */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Focus States */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-lime);
}

/* Enhanced Card Styling */
.card {
    border-radius: 12px;
    background-color: white;
    border: 1px solid var(--mid-gray);
    box-shadow: 0 2px 8px rgba(58, 55, 50, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(58, 55, 50, 0.12);
    border-color: var(--primary-lime);
}

.card-header {
    background-color: var(--warm-beige);
    border-bottom: 2px solid var(--primary-lime);
    color: var(--text-primary);
    font-weight: 600;
}

/* Form Control Improvements */
.form-control, .form-select, input[type="text"], input[type="number"], textarea, select {
    border-radius: 8px;
    border: 2px solid var(--mid-gray);
    background-color: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus, input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
    border-color: var(--primary-lime);
    box-shadow: 0 0 0 0.2rem rgba(198, 217, 45, 0.15);
    background-color: white;
    outline: none;
}

.form-control::placeholder, input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-label, label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

/* Table Enhancements */
.table {
    border-radius: 8px;
    overflow: hidden;
    color: var(--text-primary);
}

.table thead th {
    background-color: var(--primary-charcoal);
    color: var(--primary-lime);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    border-bottom: 3px solid var(--primary-lime);
}

.table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--mid-gray);
}

.table tbody tr:hover {
    background-color: var(--warm-beige);
    cursor: pointer;
}

.table tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

/* Badge Improvements */
.badge {
    padding: 0.5em 1em;
    font-weight: 600;
    border-radius: 6px;
}

.badge.bg-success {
    background-color: var(--primary-lime) !important;
    color: var(--primary-charcoal);
}

.badge.bg-primary {
    background-color: var(--accent-blue) !important;
    color: white;
}

.badge.bg-warning {
    background-color: var(--soft-olive) !important;
    color: var(--primary-charcoal);
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 249, 247, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.spinner-border {
    color: var(--primary-lime);
    border-color: var(--primary-lime);
    border-right-color: transparent;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--warm-beige);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-lime);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-lime);
}

/* Sidebar Customization */
.sidebar-wrapper {
    background-color: var(--primary-charcoal) !important;
}

.sidebar-main-title h6 {
    color: var(--primary-lime);
    font-weight: 700;
}

.sidebar-list .sidebar-link {
    color: var(--mid-gray);
    transition: all 0.3s ease;
}

.sidebar-list .sidebar-link:hover {
    color: var(--primary-lime);
    background-color: rgba(198, 217, 45, 0.1);
}

.sidebar-list .active .sidebar-link,
.sidebar-list .sidebar-link.active {
    color: var(--primary-lime) !important;
    background-color: rgba(198, 217, 45, 0.15);
    border-left: 4px solid var(--primary-lime);
}

.sidebar-list .sidebar-link svg {
    stroke: currentColor;
}


.page-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

.page-wrapper.compact-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

.modern-layout.page-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

.modern-layout .page-body-wrapper {
    margin-left: 260px !important;
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
}

.modern-layout .page-body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    width: 100% !important;
}

.modern-layout .container-fluid {
    padding: 1.5rem !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
}


/* Page title - aligned with template (text-2xl font-semibold tracking-tight) */
.page-title-section {
    margin-bottom: 2rem;
    padding-bottom: 0;
    padding-top: 0;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title-section .page-title-content {
    flex: 1;
    min-width: 0;
}

.page-title-section h1,
.page-title-section h2 {
    color: var(--primary-charcoal);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.page-title-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--primary-lime);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-charcoal);
}

.page-title-icon svg {
    width: 18px;
    height: 18px;
}

/* Badge ID Provisório - template style */
.badge-id-provisorio {
    font-size: 0.875rem;
    font-family: ui-monospace, monospace;
    border: 1px solid var(--primary-lime);
    color: var(--primary-charcoal);
    background: transparent;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

/* Breadcrumb styling */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--primary-charcoal);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--primary-lime);
    content: "›";
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .modern-layout .page-body-wrapper {
        margin-left: 0 !important;
    }
    
    .redeinnov-sidebar {
        transform: translateX(-100%);
    }
    
    .redeinnov-sidebar.active {
        transform: translateX(0);
    }
    
    .modern-layout .container-fluid {
        padding: 1rem !important;
    }
    
    .page-title-section h1,
    .page-title-section h2 {
        font-size: 1.5rem;
    }
}


.list-group-item {
    border-radius: 8px !important;
    margin-bottom: 0.25rem !important;
    border: 2px solid var(--mid-gray) !important;
    transition: all 0.3s ease !important;
    background-color: white !important;
}

.list-group-item:hover {
    border-color: var(--primary-lime) !important;
    background-color: rgba(198, 217, 45, 0.05) !important;
    transform: translateX(4px) !important;
    box-shadow: 0 2px 8px rgba(198, 217, 45, 0.2) !important;
}

.list-group-item.active {
    background-color: var(--primary-lime) !important;
    border-color: var(--primary-lime) !important;
    color: var(--primary-charcoal) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(198, 217, 45, 0.3) !important;
}

.list-group-item.active strong {
    color: var(--primary-charcoal);
}

.list-group-item.active .text-muted,
.list-group-item.active small {
    color: var(--primary-charcoal) !important;
    opacity: 0.8;
}

.list-group-item strong {
    color: var(--primary-charcoal);
    font-weight: 600;
}

.list-group-item small,
.list-group-item .text-muted {
    color: var(--text-secondary);
}

/* Alert Improvements */
.alert-success {
    background-color: rgba(198, 217, 45, 0.1);
    border-color: var(--primary-lime);
    border-left: 4px solid var(--primary-lime);
    color: var(--primary-charcoal);
}

.alert-danger,
.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    border-left: 4px solid var(--error);
    color: #991b1b;
}

.alert-warning {
    background-color: rgba(165, 184, 88, 0.1);
    border-color: var(--soft-olive);
    border-left: 4px solid var(--soft-olive);
    color: var(--primary-charcoal);
}

.alert-info {
    background-color: rgba(91, 164, 255, 0.1);
    border-color: var(--accent-blue);
    border-left: 4px solid var(--accent-blue);
    color: #1e40af;
}

/* Section Titles (h3) - Component Headers */
h3 {
    color: var(--primary-charcoal);
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-lime);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h3::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--primary-lime);
    border-radius: 3px;
}

h4 {
    color: var(--primary-charcoal);
    font-weight: 600;
}

h5 {
    color: var(--primary-charcoal);
    font-weight: 600;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ========================================
   CRIAR ENCOMENDA WIZARD (order-form style)
   ======================================== */
.encomenda-wizard .step-indicator {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 2px solid var(--mid-gray);
    background: var(--bg-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}
.encomenda-wizard .step-indicator.active {
    border-color: var(--primary-lime);
    background: rgba(198, 217, 45, 0.15);
    color: var(--primary-charcoal);
}
.encomenda-wizard .step-indicator.completed {
    border-color: var(--primary-lime);
    background: var(--primary-lime);
    color: var(--primary-charcoal);
}
.encomenda-wizard .step-indicator.completed span {
    display: none;
}
.encomenda-wizard .step-indicator.completed::after {
    content: "\2713";
    display: inline;
    font-size: 1rem;
    font-weight: bold;
}
.encomenda-wizard .step-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.encomenda-wizard .step-label.fw-bold {
    color: var(--primary-charcoal);
    font-weight: 600;
}
.encomenda-wizard .step-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Order form card - template shadcn-style (rounded-xl, shadow-sm, border-border) */
.order-form-card {
    border-radius: 12px;
    border: 1px solid var(--mid-gray);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.order-form-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--mid-gray);
    background: rgba(239, 236, 228, 0.5);
}
.order-form-content {
    padding: 1.5rem;
}
.order-form-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--mid-gray);
    background: rgba(218, 216, 211, 0.2);
}
/* Badge - template: bg-primary text-primary-foreground border-0 */
.order-form-badge-muted {
    background: rgba(239, 236, 228, 0.8);
    color: var(--text-secondary);
    border: none;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.order-form-badge {
    background: var(--primary-lime);
    color: var(--primary-charcoal);
    border: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

/* Order form action buttons - template: flex flex-col gap-3, w-full */
.order-form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.order-form-actions .btn-primary {
    width: 100%;
    padding: 0.5rem 1rem;
    height: 36px;
    font-size: 0.875rem;
}
.order-form-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.order-form-actions .btn-outline-secondary {
    width: 100%;
    padding: 0.5rem 1rem;
    height: 36px;
    font-size: 0.875rem;
    border-color: var(--mid-gray);
    background: transparent;
}
.order-form-actions .btn-outline-secondary:hover {
    background: rgba(239, 236, 228, 0.5);
    border-color: var(--mid-gray);
    color: var(--primary-charcoal);
}

/* Resumo Total Estimado - template prominence */
.order-form-summary-total {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--mid-gray);
}
.order-form-summary-total .total-label {
    font-weight: 500;
    color: var(--primary-charcoal);
}
.order-form-summary-total .total-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-charcoal);
}

/* Aviso valor mínimo fabricante não atingido */
.order-form-valor-minimo-aviso {
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: var(--primary-charcoal);
}

/* Resumo da Encomenda - item spacing */
.order-form-sidebar .order-form-content .d-flex.justify-content-between {
    min-height: 1.5rem;
}

/* Alert info na secção Add - estilo mais suave */
.order-form-add-section .alert-info {
    background: rgba(91, 164, 255, 0.08);
    border: 1px solid rgba(91, 164, 255, 0.3);
    color: var(--primary-charcoal);
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Switch toggle - align with template */
.order-form-content .form-check-input:checked {
    background-color: var(--primary-lime);
    border-color: var(--primary-lime);
}

/* Spacing - template space-y-6 (1.5rem) */
.order-form-main.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Toggle field - no extra gap, horizontal layout */
.field-toggle-row {
    display: flex;
    align-items: center;
}
.field-toggle-row .form-check-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-charcoal);
    margin-left: 0.5rem;
}
/* Add + Import row - flex flex-col lg:flex-row gap-4 */
.order-form-add-import-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 992px) {
    .order-form-add-import-row {
        flex-direction: row;
    }
}

/* Add section - flex-1, p-5, maior destaque */
.order-form-add-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-charcoal);
}
.order-form-add-section {
    flex: 1;
    padding: 1.25rem;
    border: 1px solid var(--mid-gray);
    border-radius: 8px;
    background: rgba(239, 236, 228, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.order-form-add-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 576px) {
    .order-form-add-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Import section - compacto, lg:w-48, vertical centered (template) */
.order-form-import-section {
    padding: 1rem;
    border: 2px dashed var(--mid-gray);
    border-radius: 8px;
    background: rgba(239, 236, 228, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
@media (min-width: 992px) {
    .order-form-import-section {
        width: 12rem;
        min-width: 12rem;
        flex-shrink: 0;
    }
}
.order-form-import-section .import-excel-icon {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.order-form-import-section .import-excel-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}
.order-form-import-section .btn-sm {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}
/* Inputs - template h-9 (36px), rounded-md, focus ring */
.order-form-content .form-control,
.order-form-content .form-select {
    height: 36px;
    border-radius: 6px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--mid-gray);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
}
.order-form-content .form-select {
    cursor: pointer;
}
.order-form-content .form-control:focus,
.order-form-content .form-select:focus {
    outline: none;
    border-color: var(--primary-lime);
    box-shadow: 0 0 0 3px rgba(198, 217, 45, 0.25);
}
.order-form-content .form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.order-form-content .form-control:disabled,
.order-form-content .form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.order-form-add-section .form-control,
.order-form-add-section .form-select {
    height: 36px;
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0 0.75rem;
    border: 1px solid var(--mid-gray);
}
.order-form-add-section .form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-charcoal);
    margin-bottom: 0.35rem;
}
.order-form-fields {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: 1fr;
}
@media (min-width: 576px) {
    .order-form-fields {
        grid-template-columns: 1fr 1fr;
    }
}
@media (min-width: 1200px) {
    .order-form-fields-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .order-form-fields-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Tabela de artigos - estilo TSX: cabeçalho escuro #3A3732, texto #F9F9F7 */
.order-form-table-header {
    background: rgba(218, 216, 211, 0.3);
}
.order-form-table-header th {
    font-weight: 600;
    color: var(--primary-charcoal);
}
.order-form-table-row:hover {
    background: rgba(239, 236, 228, 0.5);
}
.order-form-table td,
.order-form-table th {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    vertical-align: middle;
    color: #495057;
}
.order-form-table tbody tr {
    background: #fff;
}
.order-form-table tbody td {
    color: #495057;
    font-weight: 400;
}
.order-form-table-wrapper .table {
    margin-bottom: 0;
    overflow: visible;
}
.order-form-table-wrapper {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--mid-gray);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.order-form-table-wrapper::-webkit-scrollbar {
    height: 8px;
}
.order-form-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--mid-gray);
    border-radius: 4px;
}
.order-form-table-wrapper .order-form-table {
    width: 100%;
    table-layout: fixed;
}
.order-form-table .order-form-table-header-dark th:first-child { width: 40px; }
.order-form-table .order-form-table-header-dark th.order-form-table-col-estado { width: 110px; }
.order-form-table .order-form-table-header-dark th:last-child { width: 50px; }
.order-form-table td,
.order-form-table th {
    white-space: normal;
    overflow-wrap: break-word;
}
.order-form-table .form-select-sm,
.order-form-table .form-control-sm {
    height: 32px;
    font-size: 0.8125rem;
    padding: 0 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--mid-gray);
}
.order-form-table .form-control-sm:focus {
    border-color: var(--primary-lime);
    box-shadow: 0 0 0 2px rgba(198, 217, 45, 0.2);
}
/* Qtd input - borderless, blends with table cell */
.order-form-table .order-form-qtd-input {
    border: none;
    background: transparent;
    box-shadow: none;
}
.order-form-table .order-form-qtd-input:focus {
    border: none;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: none;
    outline: 1px solid rgba(198, 217, 45, 0.4);
    outline-offset: -1px;
}
/* Preço/Total cells - smaller font, no wrapping */
.order-form-table .order-form-cell-numeric {
    white-space: nowrap;
    font-size: 0.8125rem;
}
.order-form-table-header-dark {
    background: #3A3732;
}
.order-form-table thead.order-form-table-header-dark th {
    color: #fff !important;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    padding: 0.5rem 0.625rem;
    border-color: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.order-form-table-header-dark tr:hover {
    background: #3A3732 !important;
}
.order-form-table-row .btn-link:hover,
.order-form-remove-btn:hover {
    color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.1) !important;
    border-radius: 6px;
}
.order-form-remove-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4b5563 !important;
    background: transparent;
    border: none;
    border-radius: 6px;
}
.order-form-remove-btn svg {
    flex-shrink: 0;
}
.order-form-table-ref {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    font-size: 0.8125rem;
}
.order-form-table-col-actions {
    width: 50px;
    min-width: 50px;
}
/* Estado column - contém badge, evita overflow para fora da tabela */
.order-form-table .order-form-table-col-estado {
    width: 110px;
    max-width: 110px;
    overflow: hidden;
}
.order-form-table-col-estado .order-form-badge-warning-inline {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.order-form-table-col-estado .order-form-badge-artigo-nao-encontrado {
    font-size: 0.6875rem;
}
.order-form-table-row:hover {
    background: rgba(239, 236, 228, 0.5);
}
.order-form-table-row-warning {
    background: rgba(245, 158, 11, 0.05);
}
.order-form-table-row-muted {
    opacity: 0.85;
}
.order-form-table-row-multiplo {
    background: #FDF8ED;
}
.order-form-table-row-quantidademin {
    background: #FFF4E6;
}
.order-form-table-row-sempreco {
    background: #fff;
}
.order-form-table-row-inativo {
    background: #F8F8F8;
}
.order-form-table-row-filho {
    background: rgba(239, 236, 228, 0.3);
}
.order-form-table-row-filho td {
    font-size: 0.8125rem;
}
/* Problemas Detetados - caixa resumo (cores da referência) */
.order-form-problemas-box {
    background: #FDF8ED;
    border: 1px solid #FAEEDA;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}
.order-form-problemas-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
}
.order-form-badge-problema {
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}
.order-form-badge-problema:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.order-form-badge-problema.active {
    box-shadow: 0 0 0 2px var(--primary-lime);
}
.order-form-badge-quantidade-multipla {
    background: #F3E5AB;
    color: #5c4a00;
    border: 1px solid #e6d68a;
    font-size: 0.8125rem;
    border-radius: 6px;
}
.order-form-badge-quantidade-minima {
    background: #FFE4CC;
    color: #7c4a00;
    border: 1px solid #ffcc99;
    font-size: 0.8125rem;
    border-radius: 6px;
}
.order-form-badge-multiplos,
.order-form-badge-sempreco,
.order-form-badge-inativos,
.order-form-badge-multiplo-ref,
.order-form-badge-inativo {
    border-radius: 6px;
}
.order-form-badge-multiplos {
    background: #F9E4C2;
    color: #333;
    border: 1px solid #f0d4a8;
    font-size: 0.8125rem;
}
.order-form-badge-sempreco {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #f5c2c7;
    font-size: 0.75rem;
}
.order-form-badge-inativos {
    background: #E9ECEF;
    color: #495057;
    border: 1px solid #dee2e6;
    font-size: 0.8125rem;
}
.order-form-badge-multiplo-ref {
    background: #F9E4C2;
    color: #333;
    border: 1px solid #f0d4a8;
    font-size: 0.6875rem;
}
.order-form-badge-inativo {
    background: #E9ECEF;
    color: #495057;
    border: 1px solid #dee2e6;
    font-size: 0.75rem;
}
.order-form-text-sempreco {
    color: #721C24;
    font-size: 0.875rem;
}
.order-form-badge-ok {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #c3e6cb;
    font-size: 0.75rem;
    border-radius: 6px;
}
.order-form-badge-artigo-nao-encontrado {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEEBA;
    font-size: 0.75rem;
    border-radius: 6px;
}
/* Badges - estilo TSX */
.order-form-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.5);
}
.order-form-badge-warning-inline {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.5);
    font-size: 0.75rem;
}
.order-form-badge-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #c3e6cb;
    font-size: 0.75rem;
    border-radius: 6px;
}
.order-form-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.5);
    font-size: 0.75rem;
}
.order-form-badge-outline {
    border: 1px solid #dee2e6;
    color: #495057;
    background: #E9ECEF;
    font-size: 0.75rem;
    font-weight: 400;
}
.order-form-badge-provisional {
    border: 1px solid var(--primary-lime);
    color: var(--primary-charcoal);
    background: transparent;
    font-size: 0.875rem;
    font-family: ui-monospace, "Cascadia Code", monospace;
}
/* Modal Detalhes do Artigo */
.order-form-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    cursor: pointer;
}
.order-form-detalhes-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}
.order-form-modal-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
.order-form-modal-section-content {
    background: #f5f5f4;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* Consultar Artigo modal - tabs e conteúdo */
.consultar-artigo-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f0f0f0;
    border-radius: 10px;
}
.consultar-artigo-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.consultar-artigo-tab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.consultar-artigo-tab:hover {
    color: var(--primary-charcoal);
    background: rgba(255, 255, 255, 0.6);
}
.consultar-artigo-tab.active {
    background: #fff;
    color: var(--primary-charcoal);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.consultar-artigo-content {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    background: #fff;
}
.consultar-artigo-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.9375rem;
}
.consultar-artigo-field-row:last-child {
    border-bottom: none;
}
.consultar-artigo-info-box {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}
.consultar-artigo-info-box.info-dimensoes {
    background: rgba(91, 164, 255, 0.08);
    border: 1px solid rgba(91, 164, 255, 0.25);
    color: #1d4ed8;
}
.consultar-artigo-info-box.info-logistica {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #047857;
}
.consultar-artigo-info-box.info-associados {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #5b21b6;
}
.consultar-artigo-info-box.info-fiscal {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.25);
    color: #c2410c;
}
.consultar-artigo-simplificado .consultar-artigo-field-row {
    padding: 0.5rem 0;
}

/* Tab Resumo - secções agrupadas */
.resumo-section {
    background: #f5f5f4;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.resumo-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.resumo-total {
    color: var(--primary-lime) !important;
}

/* Total por Armazém - cards estilo TSX */
.order-form-warehouse-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-charcoal);
    display: flex;
    align-items: center;
}
.order-form-warehouse-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}
@media (min-width: 576px) {
    .order-form-warehouse-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .order-form-warehouse-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.order-form-warehouse-card {
    border-radius: 8px;
    padding: 1rem;
}
.order-form-warehouse-ok {
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}
.order-form-warehouse-warning {
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}
.order-form-warehouse-total {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-charcoal);
}
.order-form-warehouse-deficit {
    border-top: 1px solid rgba(245, 158, 11, 0.2);
}
.order-form-warehouse-progress-bar {
    height: 6px;
    background: rgba(218, 216, 211, 0.5);
    border-radius: 9999px;
    overflow: hidden;
}
.order-form-warehouse-progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}
.order-form-icon-success {
    color: #059669;
}
.order-form-icon-warning {
    color: #d97706;
}
.order-form-empty-title {
    font-weight: 600;
    color: var(--primary-charcoal);
}
.order-form-empty-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
/* Badges Origem - estilo TSX (variant outline) */
.badge-imported {
    font-size: 0.75rem;
    font-weight: 400;
    border: 1px solid var(--mid-gray);
    color: var(--text-primary);
    background: transparent;
}
.badge-manual {
    font-size: 0.75rem;
    font-weight: 400;
    border: 1px solid var(--mid-gray);
    color: var(--text-primary);
    background: transparent;
}
.w-60px {
    width: 60px;
}
/* Main grid - template: grid gap-6 xl:grid-cols-4, xl:col-span-3 / xl:col-span-1 */
/* Order form page - wider layout for table */
.order-form-page {
    max-width: 100rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
/* Order form - alerta de erro */
.order-form-page .order-form-alert {
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.08);
}
/* Order form - loading state */
.order-form-card .text-center.py-5 {
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.order-form-container {
    max-width: 100rem;
    width: 100%;
    padding: 2rem 1rem;
}
@media (min-width: 576px) {
    .order-form-container {
        padding: 2rem 1.5rem;
    }
}
@media (min-width: 1200px) {
    .order-form-container {
        padding: 2rem 2rem;
    }
}
.order-form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
@media (min-width: 1200px) {
    .order-form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        gap: 1.5rem;
    }
    .order-form-main {
        grid-column: span 3;
        min-width: 0;
    }
    .order-form-sidebar-col {
        grid-column: span 1;
    }
}
@media (min-width: 992px) {
    .order-form-sidebar {
        position: sticky;
        top: 2rem;
    }
}

/* Section divider - template FieldSeparator style */
.section-divider {
    display: flex;
    align-items: center;
    margin: 1.75rem 0;
    position: relative;
}
.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--mid-gray);
}
.section-divider span {
    padding: 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.field-with-icon {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.field-with-icon .field-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    color: var(--text-secondary);
    opacity: 0.9;
    object-fit: contain;
}
.field-with-icon .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-charcoal);
}

/* Empty state - template Empty: gap-6, border-dashed, flex flex-col items-center */
.encomenda-empty-state {
    text-align: center;
    padding: 2rem 1.5rem;
    background: transparent;
    border-radius: 8px;
    border: 2px dashed var(--mid-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .encomenda-empty-state {
        padding: 3rem;
    }
}
.encomenda-empty-state .empty-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--mid-gray);
}
.encomenda-empty-state h6 {
    font-weight: 500;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
    color: var(--primary-charcoal);
    margin: 0;
}
.encomenda-empty-state p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
    max-width: 24rem;
}

.encomenda-form-card {
    border-radius: 12px;
}
