:root {
    --dashboard-bg: #f0f4f8;
    --dashboard-surface: #ffffff;
    --dashboard-text: #2d3748;
    --dashboard-muted: #64748b;
    --dashboard-primary: #0066cc;
    --dashboard-primary-2: #004999;
    --dashboard-success: #20c997;
    --dashboard-warning: #ffc107;
    --dashboard-danger: #e74c3c;
    --dashboard-offline: #cbd5e0;
}

body.dashboard-page {
    background: var(--dashboard-bg);
}

.dashboard-shell {
    min-height: 100vh;
}

.status-card {
    border-radius: 20px;
    padding: 1.8rem 1.2rem;
    text-align: center;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}
.status-card.card-active {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px currentColor, 0 12px 28px rgba(0,0,0,0.2);
}

.status-card .number {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0.5rem 0;
    letter-spacing: -1px;
    color: #ffffff !important;
    text-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

.status-card .label {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.status-card.total {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 100%);
    color: #ffffff !important;
}

.status-card.ready {
    background: linear-gradient(135deg, #0d7a5a 0%, #0b5e44 100%);
    color: #ffffff !important;
}

.status-card.warning {
    background: linear-gradient(135deg, #b8860b 0%, #9a7209 100%);
    color: #ffffff !important;
}

.status-card.danger {
    background: linear-gradient(135deg, #c0392b 0%, #962d22 100%);
    color: #ffffff !important;
}

.status-card.pending {
    background: linear-gradient(135deg, #1a56db 0%, #0f3d9e 100%);
    color: #ffffff !important;
}

.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 1rem;
    transition: opacity 0.2s ease;
}

.machine-grid.grid-refreshing {
    opacity: 0.7;
}

.machine-card-button,
.alert-action,
.search-action,
.page-btn {
    appearance: none;
    border: 0;
    background: none;
    text-align: left;
}

.machine-card-button {
    display: block;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow-wrap: break-word;
    word-break: break-word;
}

.machine-card-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.machine-card.ready {
    border-color: #48bb78;
}

.machine-card.warning {
    border-color: #f6ad55;
}

.machine-card.danger {
    border-color: #fc8181;
}

.machine-card.secondary {
    border-color: #0d6efd;
}

.machine-code {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #2d3748;
}

.machine-speed {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 4px 0;
}

.machine-card.ready .machine-speed {
    color: #48bb78;
}

.machine-card.warning .machine-speed {
    color: #f6ad55;
}

.machine-card.danger .machine-speed {
    color: #fc8181;
}

.machine-card.secondary .machine-speed {
    color: #0d6efd;
}

.machine-time {
    font-size: 0.7rem;
    color: #a0aec0;
}

.alert-item {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.alert-item:hover {
    background: #f7fafc !important;
}

.alert-item.danger {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
}

.alert-item.warning {
    background: #fffaf0;
    border-left: 4px solid #f6ad55;
}

.alert-item.offline {
    background: #f7fafc;
    border-left: 4px solid #cbd5e0;
}

.production-item {
    margin-bottom: 12px;
}

.production-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.production-total {
    font-weight: 700;
    color: #667eea;
}

.production-bar {
    height: 24px;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: white;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 16px 16px 0 0 !important;
}

.search-box {
    position: relative;
}

.dashboard-search-box {
    max-width: 400px;
    width: 100%;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    width: 100%;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: #f7fafc;
}

.search-result-item:last-child {
    border-bottom: none;
}

.pagination-custom {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover,
.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-summary {
    cursor: default;
    background: #f7fafc;
}

.page-btn-static {
    cursor: default;
    background: #f7fafc;
}

.dashboard-empty-icon {
    font-size: 2rem;
    color: #48bb78;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}

.badge-status {
    padding: 0.3rem 0.7rem;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.75rem;
}

.dashboard-scroll-panel {
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .machine-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .status-card .number {
        font-size: 2rem;
    }
}
