/* estilos_formularios.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-width: 260px;
    --sidebar-bg: rgba(10, 10, 20, 0.85);
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --topbar-height: 64px;
    --accent: #4f8ef7;
    --accent-glow: rgba(79, 142, 247, 0.35);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-muted: rgba(255, 255, 255, 0.45);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.10);
    --card-hover: rgba(255, 255, 255, 0.09);
    --radius: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background: url('../img/fondo.avif') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.82), rgba(5, 10, 30, 0.75));
    z-index: -1;
}

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    align-items: stretch;
    padding: 0;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar para Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 16px rgba(79, 142, 247, 0.4);
    border: 2px solid rgba(79,142,247,0.4);
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-logo-text .name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo-text .sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 10px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-item .nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: var(--text-primary);
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(79,142,247,0.2), rgba(79,142,247,0.1));
    color: #7fb3ff;
    border: 1px solid rgba(79,142,247,0.25);
    box-shadow: 0 0 20px rgba(79,142,247,0.1);
}

.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 10px 8px;
}

.nav-item.danger:hover {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--sidebar-border);
}

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.hamburger span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger:hover {
    background: rgba(255,255,255,0.13);
}

.topbar-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.stat-pill.machines {
    background: rgba(79,142,247,0.15);
    border: 1px solid rgba(79,142,247,0.3);
    color: #93c5fd;
}

.stat-pill.overdue {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
}

.stat-pill.warning {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    color: #fcd34d;
}

/* ---- DASHBOARD BODY ---- */
.dashboard-body {
    flex: 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.section-title-dash {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 8px 16px;
    transition: var(--transition);
    min-width: 240px;
}

.search-bar:focus-within {
    border-color: rgba(79,142,247,0.5);
    box-shadow: 0 0 0 3px rgba(79,142,247,0.1);
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    flex: 1;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .search-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- FILTER BAR ---- */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.25);
}

.filter-btn .filter-count {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

/* Active - Todos */
.filter-btn.active {
    background: rgba(79,142,247,0.18);
    border-color: rgba(79,142,247,0.45);
    color: #93c5fd;
    box-shadow: 0 0 16px rgba(79,142,247,0.15);
}
.filter-btn.active .filter-count {
    background: rgba(79,142,247,0.3);
}

/* Active - Vencidos */
.filter-btn.overdue.active {
    background: rgba(239,68,68,0.18);
    border-color: rgba(239,68,68,0.45);
    color: #fca5a5;
    box-shadow: 0 0 16px rgba(239,68,68,0.15);
}
.filter-btn.overdue.active .filter-count {
    background: rgba(239,68,68,0.3);
}

/* Active - Próximos */
.filter-btn.warning.active {
    background: rgba(245,158,11,0.18);
    border-color: rgba(245,158,11,0.45);
    color: #fcd34d;
    box-shadow: 0 0 16px rgba(245,158,11,0.15);
}
.filter-btn.warning.active .filter-count {
    background: rgba(245,158,11,0.3);
}

/* Active - Al día */
.filter-btn.ok.active {
    background: rgba(34,197,94,0.18);
    border-color: rgba(34,197,94,0.45);
    color: #86efac;
    box-shadow: 0 0 16px rgba(34,197,94,0.15);
}
.filter-btn.ok.active .filter-count {
    background: rgba(34,197,94,0.3);
}

/* ---- VIEW TOGGLE ---- */
.view-toggle {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 4px;
}

.view-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

.view-btn.active {
    background: rgba(79,142,247,0.2);
    color: #93c5fd;
    border: 1px solid rgba(79,142,247,0.3);
}

/* ---- MACHINE GRID ---- */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    transition: all 0.3s ease;
}

/* ---- LIST VIEW ---- */
.machines-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}

.machines-grid.list-view .machine-card-dash {
    flex-direction: row;
    align-items: center;
    border-radius: 12px;
}

.machines-grid.list-view .card-status-bar {
    width: 4px;
    height: 100%;
    min-height: 64px;
    flex-shrink: 0;
    border-radius: 0;
}

.machines-grid.list-view .card-img-wrap {
    width: 80px;
    height: 64px;
    flex-shrink: 0;
    padding: 8px;
}

.machines-grid.list-view .card-body {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    flex: 1;
}

.machines-grid.list-view .card-name {
    font-size: 0.92rem;
    min-width: 160px;
}

.machines-grid.list-view .card-type {
    min-width: 100px;
}

.machines-grid.list-view .machine-status-badge {
    flex-shrink: 0;
}

.machines-grid.list-view .card-footer-btn {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
    flex-shrink: 0;
}

.machines-grid.list-view .btn-card-detail {
    width: auto;
    padding: 8px 16px;
    white-space: nowrap;
}

.machines-grid.list-view .machine-card-dash:hover {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .machines-grid.list-view .card-img-wrap { display: none; }
    .machines-grid.list-view .card-body { flex-wrap: wrap; gap: 8px; }
    .machines-grid.list-view .card-footer-btn { margin-left: 0; }
}

.machine-card-dash {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.machine-card-dash:hover {
    transform: translateY(-4px);
    background: var(--card-hover);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 20px 40px rgba(0,0,0,0.45);
}

.machine-card-dash .card-status-bar {
    height: 4px;
    width: 100%;
    background: var(--success);
    transition: var(--transition);
}

.machine-card-dash.status-overdue-card .card-status-bar { background: var(--danger); }
.machine-card-dash.status-warning-card .card-status-bar { background: var(--warning); }
.machine-card-dash.status-ok-card .card-status-bar { background: var(--success); }
.machine-card-dash.status-none-card .card-status-bar { background: rgba(255,255,255,0.15); }

.machine-card-dash .card-img-wrap {
    width: 100%;
    height: 170px;
    overflow: visible;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 0;
}

.machine-card-dash .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.4s ease, filter 0.3s ease;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
}

.machine-card-dash:hover .card-img-wrap img {
    transform: scale(1.08) translateY(-4px);
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.8)) brightness(1.08);
}

.machine-card-dash .card-body {
    padding: 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.machine-card-dash .card-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.machine-card-dash .card-type {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.machine-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: fit-content;
}

.machine-status-badge.ok {
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.3);
    color: #86efac;
}

.machine-status-badge.warn {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    color: #fcd34d;
}

.machine-status-badge.overdue {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
}

.machine-status-badge.none {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
}

.machine-card-dash .card-footer-btn {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-card-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(79,142,247,0.12);
    border: 1px solid rgba(79,142,247,0.25);
    border-radius: 10px;
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-card-detail:hover {
    background: rgba(79,142,247,0.25);
    border-color: rgba(79,142,247,0.5);
    color: #bfdbfe;
    box-shadow: 0 0 20px rgba(79,142,247,0.2);
}

/* empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* Overlay when sidebar open on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
    }

    .topbar-stats {
        gap: 6px;
    }

    .stat-pill {
        padding: 5px 10px;
        font-size: 0.74rem;
    }

    .dashboard-body {
        padding: 18px;
    }

    .machines-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .machines-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .topbar {
        padding: 0 14px;
    }

    .stat-pill .pill-label {
        display: none;
    }
}

@media (max-width: 360px) {
    .machines-grid {
        grid-template-columns: 1fr;
    }
}

h2 {
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    text-align: center;
}

h3 {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

h4 {
    color: white;
    text-align: center;
}

.volver-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #bbb;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.volver-link:hover {
    color: white;
}

/* ===== CARRUSEL DESLIZABLE ===== */
.cards-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    width: 100vw;
    /* Asegura que tome todo el ancho */
    max-width: 100%;
    padding: 20px 40px 40px;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Hacemos el scroll visible pero sutil para confirmar que existe */
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.cards-container::-webkit-scrollbar {
    height: 6px;
}

.cards-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.machine-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    min-width: 280px;
    max-width: 300px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.machine-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
}

.machine-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.machine-card:hover .machine-img {
    transform: scale(1.08);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 2px;
}

.card-stats {
    flex: 1;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
}

.stat-label {
    color: #888;
}

.stat-value {
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-blue {
    background: #1976d2;
    color: white;
    box-shadow: 0 0 10px rgba(25, 118, 210, 0.4);
}

.btn-blue:hover {
    background: #2196f3;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.6);
}

.btn-red {
    background: #f44336;
    color: white;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.4);
}

.btn-red:hover {
    background: #ff5252;
    box-shadow: 0 0 20px rgba(255, 82, 82, 0.6);
}

.btn-purple {
    background: #9c27b0;
    color: white;
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.4);
}

.btn-purple:hover {
    background: #ba68c8;
    box-shadow: 0 0 20px rgba(186, 104, 200, 0.6);
}

.btn-warning {
    background: #ff9800;
    color: white;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
}

.btn-warning:hover {
    background: #ffb74d;
    box-shadow: 0 0 20px rgba(255, 183, 77, 0.6);
}

.btn-excel {
    background: #2e7d32;
    color: white;
    box-shadow: 0 0 10px rgba(46, 125, 50, 0.4);
}

.btn-excel:hover {
    background: #388e3c;
    box-shadow: 0 0 20px rgba(56, 142, 60, 0.6);
}

.search-form {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: center;
}

.search-form input,
.search-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    outline: none;
    font-size: 0.95rem;
}

.search-form input::placeholder {
    color: #666;
}

/* ===== STATUS COLORS (Traffic Light) ===== */
.status-overdue {
    background: rgba(244, 67, 54, 0.15) !important;
    border-left: 5px solid #f44336 !important;
}
.status-overdue td {
    color: #ffcdd2 !important;
    font-weight: bold;
}

.status-warning {
    background: rgba(255, 152, 0, 0.1) !important;
    border-left: 5px solid #ff9800 !important;
}
.status-warning td {
    color: #ffe0b2 !important;
    font-weight: bold;
}

.status-ok {
    background: rgba(76, 175, 80, 0.05) !important;
    border-left: 5px solid #4caf50 !important;
}
.status-ok td {
    color: #c8e6c9 !important;
}

/* Glow effects for text status */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    display: inline-block;
}
.badge-red { background: #f44336; box-shadow: 0 0 10px rgba(244, 67, 54, 0.5); color: white; }
.badge-yellow { background: #ff9800; box-shadow: 0 0 10px rgba(255, 152, 0, 0.5); color: black; }
.badge-green { background: #4caf50; box-shadow: 0 0 10px rgba(76, 175, 80, 0.5); color: white; }

/* Glass Table */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 15px;
}
.glass-table th {
    padding: 12px;
    text-align: left;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.glass-table tr {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}
.glass-table tr:hover {
    background: rgba(255, 255, 255, 0.08);
}
.glass-table td {
    padding: 15px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.glass-table td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.glass-table td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    margin: 20px 0;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

@media (max-width:600px) {
    .machine-card {
        min-width: 82vw;
    }
    .glass-table, .glass-table thead, .glass-table tbody, .glass-table tr, .glass-table td {
        display: block;
        width: 100%;
    }
    .glass-table thead { display: none; }
    .glass-table tr { 
        margin-bottom: 20px; 
        background: rgba(255, 255, 255, 0.06); 
        border-radius: 15px; 
        padding: 15px; 
        border-left: none !important;
    }
    .glass-table td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        border: none !important; 
        padding: 10px 0; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
    .glass-table td:last-child { border-bottom: none !important; }
    .glass-table td::before { 
        content: attr(data-label); 
        font-weight: bold; 
        color: rgba(255, 255, 255, 0.4); 
        font-size: 0.75rem; 
        text-transform: uppercase;
    }
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: rgba(15, 20, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 14px 18px;
    min-width: 280px;
    max-width: 380px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    pointer-events: all;
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.toast.toast-hide {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.92); }
    to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
    from { opacity: 1; transform: none; max-height: 100px; }
    to   { opacity: 0; transform: translateX(40px); max-height: 0; padding: 0; margin: 0; }
}
.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    border-radius: 0 0 0 14px;
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
}
@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}
.toast-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 0.85rem; font-weight: 700; color: white; margin-bottom: 2px; }
.toast-msg   { font-size: 0.78rem; color: rgba(255,255,255,0.55); line-height: 1.4; }
.toast-close { background: none; border: none; color: rgba(255,255,255,0.3); cursor: pointer; font-size: 1rem; padding: 0; flex-shrink: 0; transition: color 0.2s; align-self: center; }
.toast-close:hover { color: white; }

/* Toast types */
.toast.toast-ok     .toast-icon { background: rgba(16,185,129,0.18); color: #34d399; }
.toast.toast-ok     .toast-progress { background: #34d399; }
.toast.toast-err    .toast-icon { background: rgba(239,68,68,0.18);  color: #f87171; }
.toast.toast-err    .toast-progress { background: #f87171; }
.toast.toast-warn   .toast-icon { background: rgba(251,146,60,0.18); color: #fb923c; }
.toast.toast-warn   .toast-progress { background: #fb923c; }
.toast.toast-info   .toast-icon { background: rgba(99,102,241,0.18); color: #a5b4fc; }
.toast.toast-info   .toast-progress { background: #a5b4fc; }

/* =========================================
   SKELETON LOADERS
   ========================================= */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 8px;
}
.skeleton-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
}
.skeleton-card .sk-img  { height: 170px; width: 100%; }
.skeleton-card .sk-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-card .sk-line { height: 14px; }
.skeleton-card .sk-line.wide  { width: 80%; }
.skeleton-card .sk-line.short { width: 45%; }
.skeleton-card .sk-line.btn   { height: 38px; width: 100%; border-radius: 10px; margin-top: 4px; }

/* =========================================
   BREADCRUMBS
   ========================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 0.2s;
    display: flex; align-items: center; gap: 4px;
}
.breadcrumb a:hover { color: rgba(255,255,255,0.85); }
.breadcrumb .bc-sep { opacity: 0.3; }
.breadcrumb .bc-current { color: rgba(255,255,255,0.7); font-weight: 600; }

/* =========================================
   NOTIFICACIÓN BELL (Dashboard Topbar)
   ========================================= */
.notif-bell-wrap {
    position: relative;
}
.notif-bell-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}
.notif-bell-btn:hover {
    background: rgba(255,255,255,0.13);
    color: white;
}
.notif-badge-dot {
    position: absolute;
    top: -5px; right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(5,5,20,0.9);
    animation: badgePulse 2s ease-in-out infinite;
}
.notif-badge-dot.notif-hidden { display: none; }
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

/* Dropdown panel */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: rgba(12, 16, 32, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    z-index: 1000;
    overflow: hidden;
    animation: dropIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.notif-dropdown.open { display: block; }
@keyframes dropIn {
    from { opacity:0; transform: translateY(-8px) scale(0.96); }
    to   { opacity:1; transform: none; }
}
.notif-drop-header {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.82rem; font-weight: 700; color: rgba(255,255,255,0.7);
}
.notif-ver-todas {
    font-size: 0.75rem; font-weight: 600;
    color: #6366f1; text-decoration: none;
    padding: 3px 10px; border-radius: 7px;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.25);
    transition: background 0.2s;
}
.notif-ver-todas:hover { background: rgba(99,102,241,0.22); }
.notif-drop-list { max-height: 320px; overflow-y: auto; }
.notif-drop-loading { padding: 24px; text-align: center; color: rgba(255,255,255,0.35); font-size: 0.83rem; }
.notif-drop-item {
    display: flex; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.notif-drop-item:last-child { border-bottom: none; }
.notif-drop-item:hover { background: rgba(255,255,255,0.04); }
.notif-drop-item.unread { background: rgba(99,102,241,0.05); }

/* =========================================
   PRÓXIMOS 7 DÍAS (Dashboard)
   ========================================= */
.prox7-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.prox7-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 16px;
    transition: var(--transition);
}
.prox7-item:hover {
    background: rgba(255,255,255,0.07);
    transform: translateX(3px);
}
.prox7-item.prox7-red    { border-left: 3px solid #ef4444; }
.prox7-item.prox7-orange { border-left: 3px solid #fb923c; }
.prox7-item.prox7-yellow { border-left: 3px solid #fbbf24; }
.prox7-item.prox7-blue   { border-left: 3px solid #60a5fa; }

.prox7-icon {
    width: 36px; height: 36px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; flex-shrink: 0;
}
.prox7-red    .prox7-icon { background: rgba(239,68,68,0.15);  color: #f87171; }
.prox7-orange .prox7-icon { background: rgba(251,146,60,0.15); color: #fb923c; }
.prox7-yellow .prox7-icon { background: rgba(251,191,36,0.15); color: #fbbf24; }
.prox7-blue   .prox7-icon { background: rgba(96,165,250,0.15); color: #60a5fa; }

.prox7-body { flex: 1; min-width: 0; }
.prox7-machine { font-size: 0.88rem; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prox7-service { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 2px; }

.prox7-dias { flex-shrink: 0; }
.prox7-tag {
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    background: rgba(96,165,250,0.12); color: #60a5fa;
    border: 1px solid rgba(96,165,250,0.25);
    white-space: nowrap;
}
.prox7-tag.red    { background: rgba(239,68,68,0.12);  color: #f87171; border-color: rgba(239,68,68,0.25); }
.prox7-tag.orange { background: rgba(251,146,60,0.12); color: #fb923c; border-color: rgba(251,146,60,0.25); }

.prox7-link {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.45); text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: var(--transition);
}
.prox7-link:hover { background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.3); color: #a5b4fc; }

/* =========================================
   MODAL CONFIRM (UX upgrade)
   ========================================= */
.confirm-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(5px);
    z-index: 9998;
    align-items: center; justify-content: center;
}
.confirm-modal-overlay.open { display: flex; }
.confirm-modal-box {
    background: rgba(12,16,32,0.98);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
    text-align: center;
}
@keyframes popIn {
    from { opacity:0; transform: scale(0.88) translateY(12px); }
    to   { opacity:1; transform: none; }
}
.confirm-modal-icon { font-size: 2.5rem; margin-bottom: 14px; }
.confirm-modal-title { font-size: 1rem; font-weight: 800; color: white; margin-bottom: 6px; }
.confirm-modal-msg   { font-size: 0.83rem; color: rgba(255,255,255,0.45); margin-bottom: 22px; line-height: 1.5; }
.confirm-modal-btns  { display: flex; gap: 10px; }
.confirm-modal-btns .btn-cancel-cm {
    flex: 1; padding: 11px; border-radius: 11px;
    background: transparent; border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.5); font-weight: 600; font-size: 0.88rem;
    cursor: pointer; transition: all 0.2s;
}
.confirm-modal-btns .btn-cancel-cm:hover { background: rgba(255,255,255,0.06); color: white; }
.confirm-modal-btns .btn-confirm-cm {
    flex: 2; padding: 11px; border-radius: 11px;
    background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.4);
    color: #f87171; font-weight: 700; font-size: 0.88rem;
    cursor: pointer; transition: all 0.2s;
}
.confirm-modal-btns .btn-confirm-cm:hover { background: rgba(239,68,68,0.35); }