:root {
    --delav-primary: #2563eb;
    --delav-primary-dark: #0a2540;
    --delav-primary-light: #eff6ff;
    --delav-sidebar: #0a2540;
    --delav-height-lg: 40px;
    --delav-height-md: 32px;
    --delav-height-sm: 28px;
    --delav-sidebar-hover: #123555;
    --delav-sidebar-active: #2563eb;
    --delav-success: #10b981;
    --delav-warning: #f59e0b;
    --delav-danger: #ef4444;
    --delav-gray-50: #f8fafc;
    --delav-gray-100: #f1f5f9;
    --delav-gray-200: #e2e8f0;
    --delav-gray-300: #cbd5e1;
    --delav-gray-400: #94a3b8;
    --delav-gray-600: #64748b;
    --delav-gray-800: #1e293b;
    --delav-gray-900: #0f172a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--delav-gray-50);
    color: var(--delav-gray-900);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 220px;
    min-height: 100vh;
    background-color: var(--delav-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1100;
    transition: width 0.2s ease;
}

/* Content wrapper (sibling of .sidebar) gets the offset so header & content stay aligned */
.sidebar + .d-flex {
    margin-left: 220px;
    transition: margin-left 0.2s ease;
}

.sidebar-brand {
    padding: 1rem 1.15rem;
}

.sidebar-brand .brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--delav-primary) 0%, var(--delav-primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.sidebar-brand .brand-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.sidebar-brand .brand-subtitle {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-favicon {
    display: none;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.sidebar-menu {
    padding: 0.5rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu .nav-section {
    margin-bottom: 4px;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-menu .nav-link:hover {
    background-color: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.sidebar-menu .nav-link.active {
    background-color: var(--delav-sidebar-active);
    color: #fff;
}

.sidebar-menu .nav-link i {
    font-size: 17px;
    width: 18px;
    text-align: center;
}

.sidebar-menu .nav-link .nav-arrow {
    font-size: 12px;
    opacity: 0.4;
    margin-left: auto;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.875rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-footer .nav-link:hover {
    background-color: var(--delav-sidebar-hover);
    color: rgba(255,255,255,0.9);
}

.sidebar-footer .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-toggle {
    cursor: pointer;
}

@keyframes delavOrangePulse {
    0%, 100% { color: #f59e0b; filter: drop-shadow(0 0 0 rgba(245,158,11,0)); }
    50% { color: #f97316; filter: drop-shadow(0 0 6px rgba(249,115,22,.85)); }
}

.orcamento-menu-new {
    animation: delavOrangePulse 1.2s ease-in-out infinite;
}

.orcamento-new-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 6px;
    vertical-align: middle;
    border-radius: 50%;
    background: #f97316;
    animation: delavOrangePulse 1.2s ease-in-out infinite;
}

.orcamento-dashboard-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 50%;
    background: #f97316;
    animation: delavOrangePulse 1.2s ease-in-out infinite;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-brand {
    padding: 1.25rem 0.75rem;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .brand-logo,
.sidebar.collapsed .brand-title,
.sidebar.collapsed .brand-subtitle {
    display: none !important;
}

.sidebar.collapsed .sidebar-favicon {
    display: inline-block !important;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.sidebar.collapsed .sidebar-menu .nav-link {
    justify-content: center;
    padding: 0.7rem;
}

.sidebar.collapsed .sidebar-menu {
    overflow: visible;
}

.sidebar.collapsed .sidebar-menu .nav-link span,
.sidebar.collapsed .sidebar-menu .nav-link .nav-arrow,
.sidebar.collapsed .sidebar-footer .nav-link span {
    display: none;
}

.sidebar.collapsed .sidebar-footer .nav-link {
    justify-content: center;
    padding: 0.7rem;
}

.sidebar.collapsed + .d-flex {
    margin-left: 70px;
}

.sidebar.collapsed [data-tooltip] {
    position: relative;
}

.sidebar.collapsed [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    display: none;
    width: max-content;
    max-width: 180px;
    padding: 7px 10px;
    border-radius: 7px;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.2);
    pointer-events: none;
    z-index: 2000;
}

.sidebar.collapsed [data-tooltip]:hover::after {
    display: block;
}

/* Apply the saved state before the page body is painted. */
html.delav-sidebar-collapsed .sidebar {
    width: 70px;
}

html.delav-sidebar-collapsed .sidebar-logo,
html.delav-sidebar-collapsed .sidebar .brand-logo,
html.delav-sidebar-collapsed .sidebar .brand-title,
html.delav-sidebar-collapsed .sidebar .brand-subtitle {
    display: none !important;
}

html.delav-sidebar-collapsed .sidebar-favicon {
    display: inline-block !important;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

html.delav-sidebar-collapsed .sidebar-menu .nav-link {
    justify-content: center;
    padding: 0.7rem;
}

html.delav-sidebar-collapsed .sidebar-menu .nav-link span,
html.delav-sidebar-collapsed .sidebar-menu .nav-link .nav-arrow,
html.delav-sidebar-collapsed .sidebar-footer .nav-link span {
    display: none;
}

html.delav-sidebar-collapsed .sidebar-footer .nav-link {
    justify-content: center;
    padding: 0.7rem;
}

html.delav-sidebar-collapsed .sidebar-menu {
    overflow: visible;
}

html.delav-sidebar-collapsed .sidebar + .d-flex {
    margin-left: 70px;
}

/* ========== HEADER ========== */
.app-header {
    background: #fff;
    border-bottom: 1px solid var(--delav-gray-200);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: margin-left 0.2s ease;
}

.app-header h1,
.app-header .header-page-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--delav-gray-900);
}

.app-header .header-greeting {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--delav-gray-800);
}

.app-header .header-role {
    font-size: 0.75rem;
    color: var(--delav-gray-400);
}

.app-header .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--delav-primary) 0%, var(--delav-primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
    transition: margin-left 0.2s ease;
}

/* Shared wizard alignment across catalog and budget flows. */
.wizard-stepper {
    width: 100%;
    min-height: 36px;
}

.wizard-actions {
    position: fixed;
    left: 220px;
    right: 0;
    bottom: 0;
    z-index: 50;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #EEF2F7;
}

html.delav-sidebar-collapsed .wizard-actions,
.sidebar.collapsed + .d-flex .wizard-actions {
    left: 70px;
}

/* ========== CARDS ========== */
.card {
    border: 1px solid #EEF2F7;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15,23,42,0.04);
    background: #fff;
}

.card.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(15,23,42,0.08);
}

/* Stat card */
.card.stat-card {
    height: 140px;
    padding: 22px 28px;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

.stat-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
    justify-content: space-between;
}

.stat-card .stat-icon {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue {
    background: #F8FAFC;
    color: var(--delav-primary);
}

.stat-card .stat-icon.green {
    background: #F8FAFC;
    color: var(--delav-primary);
}

.stat-card .stat-icon.purple {
    background: #F8FAFC;
    color: var(--delav-primary);
}

.stat-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.stat-card .stat-label {
    font-size: 15px;
    color: #475569;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: #0F172A;
}

.stat-card .stat-link {
    font-size: 14px;
    color: var(--delav-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.stat-card .stat-link i {
    font-size: 14px;
}

/* List card */
.list-card .list-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #EEF2F7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-card .list-card-header h6 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #0F172A;
}

.list-card .list-card-body {
    padding: 0;
}

.list-card .list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    min-height: 84px;
    border-bottom: 1px solid #EEF2F7;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.list-card .list-item:last-child {
    border-bottom: none;
}

.list-card .list-item:hover {
    background: #F8FAFC;
}

.list-item .item-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    font-size: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}

.list-item .item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item .item-info {
    flex: 1;
    min-width: 0;
}

.list-item .item-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.list-item .item-title {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item .item-meta {
    font-size: 13px;
    color: #64748B;
}

.list-item .item-desc {
    font-size: 13px;
    color: #64748B;
}

.list-item .item-date {
    font-size: 12px;
    color: #94A3B8;
    white-space: nowrap;
    flex-shrink: 0;
}

.list-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 24px;
    border-top: 1px solid #EEF2F7;
    font-size: 14px;
    font-weight: 600;
    color: var(--delav-primary);
    text-decoration: none;
    transition: background 0.1s;
}

.list-card-footer:hover {
    background: #F8FAFC;
}

.list-card-footer i {
    font-size: 12px;
}

/* Badge */
.badge {
    height: 28px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.badge-blue {
    background: #DBEAFE;
    color: var(--delav-primary);
}

.badge-green {
    background: #DCFCE7;
    color: #15803D;
}

.badge-purple {
    background: #F6EEFF;
    color: #7C3AED;
}

.badge-amber {
    background: #FEF3C7;
    color: #B45309;
}

.badge-orange {
    background: #F97316;
    color: #fff;
}

.badge-teal {
    background: #14B8A6;
    color: #fff;
}

.badge-red {
    background: #FEE2E2;
    color: #DC2626;
}

.badge-neutral {
    background: #F1F5F9;
    color: #475569;
}

/* ========== TABLE ========== */
.table {
    margin-bottom: 0;
    border: 1px solid #EEF2F7;
    border-radius: 16px;
    overflow: hidden;
}

.table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
    border-top: none;
    border-bottom: 1px solid #EEF2F7;
    height: 56px;
    padding: 0 20px;
    background: #F8FAFC;
}

.table td {
    height: 72px;
    padding: 0 20px;
    vertical-align: middle;
    border-bottom: 1px solid #EEF2F7;
}

.table tbody tr:hover {
    background: #F8FAFC;
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    height: var(--delav-height-lg);
    padding: 0 18px;
    font-size: 14px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    height: var(--delav-height-md);
    padding: 0 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--delav-primary);
    border-color: var(--delav-primary);
    color: #FFFFFF;
}

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

.btn-outline-primary {
    color: var(--delav-primary);
    border-color: var(--delav-primary);
    background: #FFFFFF;
}

.btn-outline-primary:hover {
    background-color: var(--delav-primary-light);
    border-color: var(--delav-primary);
    color: var(--delav-primary);
}

.btn-outline-secondary {
    color: #475569;
    border-color: #DCE3EE;
    background: #FFFFFF;
}

.btn-outline-secondary:hover {
    background-color: #F8FAFC;
    border-color: #94A3B8;
    color: #0F172A;
}

/* ========== FORMS ========== */
.form-control, .form-select {
    height: var(--delav-height-lg);
    border-radius: 10px;
    border-color: #DCE3EE;
    padding: 0 16px;
    font-size: 14px;
    color: #0F172A;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
    color: #94A3B8;
}

.form-control:focus, .form-select:focus {
    border-color: var(--delav-primary);
    box-shadow: 0 0 0 3px rgba(var(--delav-primary-rgb, 37,99,235),0.1);
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    padding: 12px 16px;
    resize: vertical;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    padding: 2rem 1rem;
}

.empty-state i {
    font-size: 2rem;
    color: var(--delav-gray-300);
    opacity: 0.6;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1060;
}

/* ========== MODAL ========== */
.modal-content {
    border-radius: 12px;
    border: none;
}

/* ========== MACHINE GRID CARD ========== */
.machine-card .item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--delav-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--delav-gray-400);
    font-size: 1.3rem;
    flex-shrink: 0;
    overflow: hidden;
}

/* ========== MACHINE SELECT CARD ========== */
.machine-select-card {
    cursor: pointer;
    transition: all 0.15s ease;
}

.machine-select-card:hover {
    border-color: var(--delav-primary) !important;
}

.machine-select-card.selected {
    border-color: var(--delav-primary) !important;
    background: var(--delav-primary-light);
}

/* ========== GALLERY GRID ========== */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-grid .gallery-item {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--delav-gray-200);
    position: relative;
}

.gallery-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-grid .gallery-item .remove-check {
    position: absolute;
    top: 4px;
    right: 4px;
}

/* ========== DROPDOWN ========== */
.dropdown-item {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.dropdown-item i {
    width: 1.1rem;
}

/* ========== FORM PAGE ========== */
.form-page .card {
    max-width: 720px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    .sidebar .brand-title,
    .sidebar .brand-subtitle,
    .sidebar .nav-link span,
    .sidebar .nav-link .nav-arrow,
    .sidebar-footer .nav-link span {
        display: none;
    }
    .sidebar-brand {
        padding: 1.25rem 0.75rem;
        justify-content: center;
    }
    .sidebar-brand a {
        justify-content: center;
    }
    .sidebar-menu .nav-link {
        justify-content: center;
        padding: 0.7rem;
    }
    .sidebar-footer .nav-link {
        justify-content: center;
        padding: 0.7rem;
    }
    .sidebar + .d-flex {
        margin-left: 70px;
    }
    .main-content {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    .stat-card {
        padding: 1rem;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
}

/* ========== MAQUINAS PAGE ========== */
.maquinas-page {
    padding-bottom: 60px;
}

.maquinas-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.maquinas-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.maquinas-search {
    position: relative;
    width: 20%;
    height: var(--delav-height-lg);
}

.maquinas-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1rem;
    pointer-events: none;
}

.maquinas-search .form-control {
    padding-left: 40px;
    height: var(--delav-height-lg);
    border-radius: 10px;
    border-color: #E2E8F0;
    font-size: 14px;
}

.maquinas-toolbar-left .form-select {
    width: 8%;
    height: var(--delav-height-lg);
    border-radius: 10px;
    border-color: #E2E8F0;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    padding: 0 32px 0 12px;
    background-color: #fff;
    cursor: pointer;
}

.maquinas-toolbar-left .form-select:focus {
    border-color: var(--delav-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.maquinas-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Grid */
.maquinas-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 1.25rem;
}

@media (max-width: 1100px) {
    .maquinas-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 768px) {
    .maquinas-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .maquinas-toolbar { flex-direction: column; align-items: stretch; }
    .maquinas-toolbar-left { flex-wrap: wrap; }
    .maquinas-search { width: 100%; }
    .maquinas-toolbar-left .form-select { width: 100%; }
    .maquinas-actions { justify-content: space-between; }
    .maquinas-pagination { left: 0; padding: 1rem; }
}

/* Card */
.maquina-card {
    border: 1px solid #EEF2F7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.maquina-card:hover {
    box-shadow: 0 8px 24px rgba(15,23,42,0.07);
    transform: translateY(-2px);
}

.maquina-card-img {
    position: relative;
    width: 100%;
    height: 200px;
    background: #F8FAFC;
    overflow: hidden;
}

.maquina-card-status {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    height: 24px;
    padding: 0 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 2;
}

.maquina-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.maquina-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.maquina-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E1;
    font-size: 3rem;
}

.maquina-card-body {
    padding: 16px 18px 8px;
}

.maquina-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 4px;
    line-height: 1.3;
}

.maquina-card-desc {
    font-size: 13px;
    color: #64748B;
    margin: 0 0 8px;
}

.maquina-card-meta {
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94A3B8;
    margin-top: 8px;
    margin-bottom: 10px;
}

.maquina-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    margin-top: auto;
    border-top: 1px solid #F1F5F9;
}

.maquina-card-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--delav-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

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

.maquina-card-footer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon-sm {
    width: var(--delav-height-md);
    height: var(--delav-height-md);
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-icon-sm:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.btn-icon-sm.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-icon-sm.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #64748B;
    animation: delav-spin .7s linear infinite;
}

@keyframes delav-spin {
    to { transform: rotate(360deg); }
}

.btn-icon-danger:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* Pagination */
.maquinas-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-top: 1px solid #EEF2F7;
    background: #fff;
    position: fixed;
    bottom: 0;
    left: 220px;
    right: 0;
    z-index: 50;
    transition: left 0.2s ease;
}

.sidebar.collapsed + .d-flex .maquinas-pagination,
html.delav-sidebar-collapsed .maquinas-pagination {
    left: 70px;
}

.maquinas-pagination-info {
    font-size: 13px;
    color: #64748B;
}

.maquinas-pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    will-change: contents;
}

.btn-page {
    min-width: var(--delav-height-lg);
    height: var(--delav-height-lg);
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #64748B;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled):not(.active) {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.btn-page.active {
    background: var(--delav-primary);
    border-color: var(--delav-primary);
    color: #fff;
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.maquinas-pagination-size .form-select {
    height: var(--delav-height-lg);
    font-size: 13px;
    border-radius: 10px;
    border-color: #E2E8F0;
    min-width: 120px;
}

/* ========== FORM PAGE ========== */
.form-section {
    border: 1px solid #EEF2F7;
    border-radius: 14px;
    background: #fff;
    position: relative;
}

.form-section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #EEF2F7;
}

.form-section-header h6 {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}

.form-section-body {
    padding: 20px;
}

.form-img-preview {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.form-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ficha Técnica no Formulário */
.ficha-tecnica-section {
    margin-top: 8px;
}

.ficha-tecnica-table {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}

.ficha-tecnica-table-header {
    display: flex;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 10px 16px;
}

.ficha-tecnica-table-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.ficha-tecnica-table-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #F1F5F9;
    padding: 10px 16px;
}

.ficha-tecnica-table-row:last-child {
    border-bottom: none;
}

.ficha-tecnica-table-col-campo {
    width: 40%;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.ficha-tecnica-table-col-valor {
    width: 60%;
}

.ficha-tecnica-table-col-valor .form-control {
    height: 34px;
    border-radius: 6px;
    font-size: 13px;
    border-color: #E2E8F0;
}

.ficha-tecnica-table-col-valor .form-control:focus {
    border-color: var(--delav-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.ficha-tecnica-empty {
    padding: 20px;
    text-align: center;
    color: #94A3B8;
    font-size: 13px;
}

/* Máquinas Vinculadas */
.maquinas-vincular-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.maquina-vincular-item {
    cursor: pointer;
}

.maquina-vincular-item input[type="checkbox"] {
    display: none;
}

.maquina-vincular-card {
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: all 0.15s ease;
}

.maquina-vincular-item input[type="checkbox"]:checked + .maquina-vincular-card {
    border-color: var(--delav-primary);
    background: var(--delav-primary-light);
}

.maquina-vincular-card:hover {
    border-color: #93C5FD;
}

.maquina-vincular-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto 8px;
    background: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maquina-vincular-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.maquina-vincular-img i {
    font-size: 1.5rem;
    color: #94A3B8;
}

.maquina-vincular-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.maquina-vincular-nome {
    font-size: 12px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.3;
}

.maquina-vincular-modelo {
    font-size: 11px;
    color: #64748B;
}

/* ========== CONFIGURAÇÕES ========== */
.configuracoes-page {
    width: 100%;
}

.configuracoes-tabs {
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 1.5rem;
}

.configuracoes-tabs .nav-link {
    color: #64748B;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
}

.configuracoes-tabs .nav-link:hover {
    color: #334155;
    border-bottom-color: #CBD5E1;
}

.configuracoes-tabs .nav-link.active {
    color: var(--delav-primary);
    border-bottom-color: var(--delav-primary);
    background: none;
}

.configuracoes-content {
    background: #fff;
    border: 1px solid #EEF2F7;
    border-radius: 14px;
    padding: 24px 40px;
}

.configuracoes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #EEF2F7;
}

.configuracoes-title {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}

.configuracoes-desc {
    font-size: 13px;
    color: #64748B;
    margin: 4px 0 0;
}

/* Ficha Técnica */
.ficha-tecnica-columns {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #EEF2F7;
}

.ficha-tecnica-col-drag {
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E1;
}

.ficha-tecnica-col-title-col {
    flex: 1;
}

.ficha-tecnica-col-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.ficha-tecnica-col-title-check {
    flex: 0 0 100px;
}

.ficha-tecnica-col-title-actions {
    flex: 0 0 40px;
}

.ficha-tecnica-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s, box-shadow 0.15s;
}

.ficha-tecnica-row:last-child {
    border-bottom: none;
}

.ficha-tecnica-row .ficha-tecnica-col-drag {
    cursor: grab;
    color: #CBD5E1;
    transition: color 0.15s;
}

.ficha-tecnica-row:hover .ficha-tecnica-col-drag {
    color: #94A3B8;
}

.ficha-tecnica-row.dragging {
    opacity: 0.5;
    background: #F8FAFC;
}

.ficha-tecnica-row.drag-over {
    border-top: 2px solid var(--delav-primary);
    padding-top: 8px;
}

.ficha-tecnica-col-input {
    flex: 1;
}

.ficha-tecnica-col-input .form-control {
    height: 38px;
    border-radius: 8px;
    font-size: 14px;
}

.ficha-tecnica-col-check {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
}

.ficha-tecnica-col-actions {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
}

.ficha-tecnica-check {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.ficha-tecnica-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--delav-primary);
}

.ficha-tecnica-remove {
    color: #94A3B8;
    transition: color 0.15s;
}

.ficha-tecnica-remove:hover {
    color: #EF4444;
}

/* ========== FILE UPLOAD ========== */
.file-upload-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #DCE3EE;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s;
}

.file-upload-wrapper:hover {
    border-color: #94A3B8;
}

.file-upload-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: var(--delav-height-lg, 40px);
    background: #F8FAFC;
    border-right: 1px solid #DCE3EE;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.file-upload-label i {
    font-size: 16px;
    color: var(--delav-primary);
}

.file-upload-label:hover {
    background: #EFF6FF;
    color: var(--delav-primary);
}

.file-upload-name {
    padding: 0 16px;
    font-size: 14px;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-upload-name.has-file {
    color: #0F172A;
}
