body {
    overflow-x: hidden;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #7f8c8d;
    --success-color: #00a65a;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-color-responsive: #e0e0e0;
    --header-border-color-responsive: #3498db;
}

body.dark-mode {
    --border-color-responsive: #4b545c;
    --header-border-color-responsive: #5dade2;
}

.opacity-50 {
    opacity: 0.5 !important;
}

/* ====== NAVBAR ====== */
.main-header.navbar.dashboard-header-custom {
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%) !important;
    border-bottom: 2px solid var(--header-border-color-responsive) !important;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.15) !important;
}

body.dark-mode .main-header.navbar.dashboard-header-custom {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%) !important;
    border-bottom: 2px solid var(--header-border-color-responsive) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

/* ====== LAYOUT ====== */
.col-custom-5 {
    position: relative;
    width: 100%;
    padding-right: 5px;
    padding-left: 5px;
    flex: 0 0 14.2857%;
    max-width: 14.2857%;
}

@media (max-width: 1400px) {
    .col-custom-5 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}
@media (max-width: 1100px) {
    .col-custom-5 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}
@media (max-width: 768px) {
    .col-custom-5 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        padding: 4px;
    }
}
@media (max-width: 480px) {
    .col-custom-5 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 3px;
    }
}

/* Fullscreen Mode Optimization - Aiming to show all 35 machines */
:fullscreen .col-custom-5,
:fullscreen .machine-grid.limited-view .col-custom-5,
:-webkit-full-screen .col-custom-5,
:-webkit-full-screen .machine-grid.limited-view .col-custom-5,
:-ms-fullscreen .col-custom-5,
:-ms-fullscreen .machine-grid.limited-view .col-custom-5 {
    flex: 0 0 8.333333% !important; /* 12 per row */
    max-width: 8.333333% !important;
    padding: 1px !important;
}

:fullscreen .machine-card-simple,
:-webkit-full-screen .machine-card-simple,
:-ms-fullscreen .machine-card-simple {
    min-height: 65px !important; /* Reduced from 75px */
    padding: 4px 2px !important;
    border-width: 1px !important;
}

:fullscreen .machine-name-simple,
:-webkit-full-screen .machine-name-simple,
:-ms-fullscreen .machine-name-simple {
    font-size: 0.75rem !important;
}

:fullscreen .info-box-modern,
:-webkit-full-screen .info-box-modern,
:-ms-fullscreen .info-box-modern {
    padding: 0.3rem !important;
    margin-bottom: 0 !important;
}

:fullscreen .row.mb-3.mt-3,
:-webkit-full-screen .row.mb-3.mt-3 {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

:fullscreen .info-box-number-modern,
:-webkit-full-screen .info-box-number-modern,
:-ms-fullscreen .info-box-number-modern {
    font-size: 1.2rem !important;
}

:fullscreen .info-box-text-modern,
:-webkit-full-screen .info-box-text-modern,
:-ms-fullscreen .info-box-text-modern {
    font-size: 0.7rem !important;
}

:fullscreen .info-box-subtitle-modern,
:-webkit-full-screen .info-box-subtitle-modern {
    display: none !important;
}

:fullscreen .info-box-icon-modern,
:-webkit-full-screen .info-box-icon-modern,
:-ms-fullscreen .info-box-icon-modern {
    width: 30px !important; /* Reduced from 35px */
    height: 30px !important;
    font-size: 1rem !important;
    margin-right: 0.5rem !important;
}

/* ====== INFO BOXES ====== */
.info-box-modern {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #eee;
    position: relative;
    overflow: hidden;
}

.info-box-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.info-box-icon-modern {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-right: 1.2rem;
}

/* Status-specific Borders and Icon Colors */
.status-total {
    border-color: #00cfd5 !important;
}
.status-total .info-box-icon-modern i {
    color: #00cfd5;
}

.status-running {
    border-color: #28a745 !important;
}
.status-running .info-box-icon-modern i {
    color: #28a745;
}

.status-stop {
    border-color: #f1c40f !important;
}
.status-stop .info-box-icon-modern i {
    color: #f1c40f;
}

.status-maintenance {
    border-color: #e74c3c !important;
}
.status-maintenance .info-box-icon-modern i {
    color: #e74c3c;
}

.status-offline {
    border-color: #343a40 !important;
}
.status-offline .info-box-icon-modern i {
    color: #343a40;
}

.info-box-content-modern {
    display: flex;
    flex-direction: column;
}

.info-box-number-modern {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: #2c3e50;
    margin-bottom: 2px;
}

.info-box-text-modern {
    font-size: 0.8rem;
    font-weight: 800;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.info-box-subtitle-modern {
    font-size: 0.7rem;
    color: #888;
    font-weight: 600;
    margin-top: 2px;
}

/* Dark Mode Integration */
body.dark-mode .info-box-modern {
    background: #252d35 !important; /* Slightly lighter than before for better context */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
    border-width: 2px !important;
}

body.dark-mode .status-offline {
    border-color: #4b545c !important; /* Stand out more than pure dark */
}

body.dark-mode .status-offline .info-box-icon-modern i {
    color: #6c757d; /* Brighter grey icon */
}

body.dark-mode .info-box-number-modern {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

body.dark-mode .info-box-text-modern {
    color: #ffffff !important;
    font-weight: 900;
}

body.dark-mode .info-box-subtitle-modern {
    color: rgba(
        255,
        255,
        255,
        0.75
    ) !important; /* Slightly dimmer than number but very readable */
}

/* Improve hover in dark mode */
body.dark-mode .info-box-modern:hover {
    background: #2c3640 !important;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
}

/* Mobile responsive info boxes */
@media (max-width: 576px) {
    .info-box-modern {
        padding: 0.6rem 0.5rem;
        margin-bottom: 5px;
    }
    .info-box-icon-modern {
        width: 25px;
        height: 25px;
        font-size: 1.4rem;
        margin-right: 0.5rem;
    }
    .info-box-number-modern {
        font-size: 1.2rem;
    }
    .info-box-text-modern {
        font-size: 0.65rem;
    }
    .info-box-subtitle-modern {
        font-size: 0.55rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Generic white text for card titles in dark mode */
body.dark-mode .card-title,
body.dark-mode .card-header h3 {
    color: #ffffff !important;
}

/* ====== MACHINE CARDS ====== */
.machine-grid-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.machine-grid-wrapper::-webkit-scrollbar {
    height: 4px;
}
.machine-grid-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
.machine-grid-wrapper::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.2);
    border-radius: 10px;
}

.machine-grid {
    display: flex;
    flex-wrap: wrap;
}

.machine-grid.limited-view {
    display: flex;
    flex-wrap: wrap;
}

.machine-grid.limited-view .col-custom-5 {
    flex: 0 0 25%;
    max-width: 25%;
}

@media (max-width: 992px) {
    .machine-grid.limited-view .col-custom-5 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

@media (max-width: 576px) {
    .machine-grid.limited-view .col-custom-5 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

.machine-card-simple {
    min-height: 95px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 2px solid rgba(52, 152, 219, 0.2);
    background: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.machine-card-simple:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

body.dark-mode .machine-card-simple {
    background-color: #2c3e50 !important;
    border: 2px solid rgba(93, 173, 226, 0.3) !important;
}

/* Larger cards when limited view is active */
.machine-grid.limited-view .col-custom-5 {
    flex: 0 0 25%;
    max-width: 25%;
}

.machine-grid.limited-view .machine-card-simple {
    min-height: 120px !important;
}

.machine-grid.limited-view .machine-name-simple {
    font-size: 1.1rem;
}

.machine-name-simple {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--dark-color);
    display: block;
    margin-bottom: 2px;
}

body.dark-mode .machine-name-simple {
    color: #fff !important;
}

.machine-details-simple {
    font-size: 0.7rem;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
    font-weight: 400;
}

body.dark-mode .machine-details-simple {
    color: #bdc3c7;
}

.machine-status-display {
    font-size: 0.75rem !important;
    font-weight: 800;
    margin-top: 6px;
    color: #ffffff !important;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Status Colors */
.machine-card-simple.running,
.machine-card-simple.aktif {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

body.dark-mode .machine-card-simple.running,
body.dark-mode .machine-card-simple.aktif {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.machine-card-simple.maintenance {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.machine-card-simple.tidak-aktif,
.machine-card-simple.offline {
    background: linear-gradient(135deg, #343a40, #212529);
}
.machine-card-simple.setup,
.machine-card-simple.setdown,
.machine-card-simple.material-habis,
.machine-card-simple.sarana-packaging-habis,
.machine-card-simple.stop {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.machine-card-simple.running .machine-name-simple,
.machine-card-simple.aktif .machine-name-simple,
.machine-card-simple.maintenance .machine-name-simple,
.machine-card-simple.tidak-aktif .machine-name-simple,
.machine-card-simple.offline .machine-name-simple,
.machine-card-simple.setup .machine-name-simple,
.machine-card-simple.setdown .machine-name-simple,
.machine-card-simple.material-habis .machine-name-simple,
.machine-card-simple.sarana-packaging-habis .machine-name-simple,
.machine-card-simple.stop .machine-name-simple {
    color: white !important;
}

.machine-card-simple.running .machine-details-simple,
.machine-card-simple.aktif .machine-details-simple,
.machine-card-simple.maintenance .machine-details-simple,
.machine-card-simple.tidak-aktif .machine-details-simple,
.machine-card-simple.offline .machine-details-simple,
.machine-card-simple.setup .machine-details-simple,
.machine-card-simple.setdown .machine-details-simple,
.machine-card-simple.material-habis .machine-details-simple,
.machine-card-simple.sarana-packaging-habis .machine-details-simple,
.machine-card-simple.stop .machine-details-simple {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ====== PROGRESS BAR ====== */
.progress-bar-top {
    height: 20px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
    width: 92%;
    margin: 8px auto 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.progress-bar-fill {
    height: 100%;
    width: var(--progress-width, 0%);
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow:
        0 1px 8px rgba(0, 0, 0, 1),
        0 0 12px rgba(0, 0, 0, 0.8);
    z-index: 10;
    letter-spacing: 0.8px;
    pointer-events: none;
}

/* ====== CAMERA UI ====== */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border: 4px solid #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    background:
        linear-gradient(to right, #fff 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, #fff 2px, transparent 2px) 0 0,
        linear-gradient(to left, #fff 2px, transparent 2px) 100% 0,
        linear-gradient(to bottom, #fff 2px, transparent 2px) 100% 0,
        linear-gradient(to right, #fff 2px, transparent 2px) 0 100%,
        linear-gradient(to top, #fff 2px, transparent 2px) 0 100%,
        linear-gradient(to left, #fff 2px, transparent 2px) 100% 100%,
        linear-gradient(to top, #fff 2px, transparent 2px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    opacity: 0.5;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
    z-index: 10;
}

.capture-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: 5px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.capture-btn:disabled {
    background: #95a5a6;
    animation: none;
    opacity: 0.6;
}

.camera-btn,
.retake-btn {
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.camera-btn {
    background: #3498db;
    color: white;
}
.retake-btn {
    background: #f1c40f;
    color: white;
}

/* ====== MACHINE FILTER ====== */
.bg-dark-soft {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .bg-dark-soft {
    background: rgba(255, 255, 255, 0.05);
}

.machine-filter-container {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: var(--secondary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

body.dark-mode .filter-btn {
    color: #bdc3c7;
}

body.dark-mode .filter-btn.active {
    background: #5dade2;
    color: white;
}

/* Pagination Controls */
#paginationControls .btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#paginationControls .btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

#pageIndicator {
    color: var(--secondary-color);
    letter-spacing: 0.5px;
}

body.dark-mode #pageIndicator {
    color: #bdc3c7;
}
/* Machine Part Simple Style */
.machine-part-simple {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin: 2px 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

body.dark-mode .machine-part-simple {
    color: rgba(255, 255, 255, 0.85);
}

/* Machine Detail Modal Dark Mode Fix */
body.dark-mode #machineDetailModal .modal-content {
    background-color: #1e272e;
    color: #ffffff;
}

body.dark-mode #machineDetailModal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode #machineDetailModal .alert-info {
    background-color: #2c3e50;
    border-color: #34495e;
}

body.dark-mode #machineDetailModal .text-primary {
    color: #4facfe !important;
}

body.dark-mode #machineDetailModal .text-success {
    color: #2ecc71 !important;
}

body.dark-mode #machineDetailModal .text-warning {
    color: #f1c40f !important;
}

body.dark-mode #machineDetailModal .text-info {
    color: #00f2fe !important;
}

body.dark-mode #machineDetailModal .card {
    background-color: #2d3436;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #machineDetailModal .text-dark {
    color: #ffffff !important;
}

body.dark-mode #machineDetailModal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Machine Quantity Info Style */
.machine-qty-info {
    display: block;
    margin: 2px 0;
}

.machine-qty-info .badge-light {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #2c3e50 !important;
}

body.dark-mode .machine-qty-info .badge-light {
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Extra Fullscreen Optimization for 35 machines */
:fullscreen .machine-grid-wrapper,
:-webkit-full-screen .machine-grid-wrapper {
    padding: 5px !important;
}

:fullscreen .machine-grid,
:-webkit-full-screen .machine-grid {
    margin: 0 -2px !important;
}

:fullscreen .machine-part-simple,
:-webkit-full-screen .machine-part-simple {
    font-size: 0.6rem !important;
    margin: 1px 0 !important;
}

:fullscreen .machine-qty-info,
:-webkit-full-screen .machine-qty-info {
    margin: 0 !important;
}

:fullscreen .machine-qty-info .badge,
:-webkit-full-screen .machine-qty-info .badge {
    font-size: 0.55rem !important;
    padding: 1px 4px !important;
}

:fullscreen .machine-status-display,
:-webkit-full-screen .machine-status-display {
    font-size: 0.65rem !important;
    padding: 1px 6px !important;
    margin-top: 2px !important;
}

:fullscreen .machine-details-simple,
:-webkit-full-screen .machine-details-simple {
    font-size: 0.65rem !important;
    margin-bottom: 1px !important;
}

:fullscreen .progress-bar-top,
:-webkit-full-screen .progress-bar-top {
    height: 12px !important;
    margin-top: 4px !important;
}

:fullscreen .progress-text,
:-webkit-full-screen .progress-text {
    font-size: 0.65rem !important;
}

/* Extra Fullscreen Card/Header Optimization */
:fullscreen .card-header,
:-webkit-full-screen .card-header {
    padding: 0.25rem 0.75rem !important;
}

:fullscreen .card-title,
:-webkit-full-screen .card-title {
    font-size: 0.95rem !important;
}

:fullscreen .machine-filter-container,
:-webkit-full-screen .machine-filter-container {
    padding: 2px !important;
}

:fullscreen .filter-btn,
:-webkit-full-screen .filter-btn {
    padding: 2px 10px !important;
    font-size: 0.75rem !important;
}

:fullscreen #shareWhatsappBtn,
:-webkit-full-screen #shareWhatsappBtn {
    padding: 2px 10px !important;
    font-size: 0.75rem !important;
}

:fullscreen .card-body,
:-webkit-full-screen .card-body {
    padding: 0.25rem !important;
}

/* ====== ALERT STYLES FOR MACHINE STATUS ====== */
.alert {
    border-radius: 10px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.alert-warning {
    border-left-color: #f1c40f;
}

.alert-danger {
    border-left-color: #e74c3c;
}

.alert-info {
    border-left-color: #3498db;
}

.alert-success {
    border-left-color: #28a745;
}

.alert-primary {
    border-left-color: #3498db;
}

.alert-secondary {
    border-left-color: #6c757d;
}

.alert-purple {
    border-left-color: #6f42c1;
}

.alert-orange {
    border-left-color: #fd7e14;
}

/* Dark Mode Alert Styles */
body.dark-mode .alert {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .alert-warning {
    background-color: rgba(241, 196, 15, 0.15);
    border-color: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

body.dark-mode .alert-warning strong {
    color: #f39c12;
}

body.dark-mode .alert-danger {
    background-color: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

body.dark-mode .alert-danger strong {
    color: #c0392b;
}

body.dark-mode .alert-info {
    background-color: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.3);
    color: #3498db;
}

body.dark-mode .alert-info strong {
    color: #2980b9;
}

body.dark-mode .alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

body.dark-mode .alert-success strong {
    color: #1e7e34;
}

body.dark-mode .alert-primary {
    background-color: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.3);
    color: #3498db;
}

body.dark-mode .alert-primary strong {
    color: #2980b9;
}

body.dark-mode .alert-secondary {
    background-color: rgba(108, 117, 125, 0.15);
    border-color: rgba(108, 117, 125, 0.3);
    color: #95a5a6;
}

body.dark-mode .alert-secondary strong {
    color: #7f8c8d;
}

body.dark-mode .alert-purple {
    background-color: rgba(111, 66, 193, 0.15);
    border-color: rgba(111, 66, 193, 0.3);
    color: #6f42c1;
}

body.dark-mode .alert-purple strong {
    color: #5a32a3;
}

body.dark-mode .alert-orange {
    background-color: rgba(253, 126, 20, 0.15);
    border-color: rgba(253, 126, 20, 0.3);
    color: #fd7e14;
}

body.dark-mode .alert-orange strong {
    color: #d66408;
}

body.dark-mode .alert .close {
    color: inherit;
    opacity: 0.8;
}

body.dark-mode .alert .close:hover {
    opacity: 1;
}

/* ====== EDIT BUTTON ON MACHINE CARD ====== */
.btn-edit-machine {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(52, 152, 219, 0.3);
    z-index: 10;
    opacity: 0.9;
}

.btn-edit-machine:hover {
    background: #3498db;
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    opacity: 1;
    border-color: #3498db;
}

.btn-edit-machine i {
    transition: transform 0.3s ease;
}

.btn-edit-machine:hover i {
    transform: rotate(-5deg);
}

/* Dark Mode Edit Button */
body.dark-mode .btn-edit-machine {
    background: rgba(52, 152, 219, 0.2);
    color: #5dade2;
    border-color: rgba(93, 173, 226, 0.4);
    backdrop-filter: blur(4px);
}

body.dark-mode .btn-edit-machine:hover {
    background: #5dade2;
    color: white;
    border-color: #5dade2;
}

/* Responsive Edit Button for smaller screens */
@media (max-width: 768px) {
    .btn-edit-machine {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        top: 6px;
        right: 6px;
    }
}

@media (max-width: 576px) {
    .machine-card-simple {
        min-height: 80px !important;
        padding: 8px 4px;
        border-radius: 10px;
    }
    .machine-name-simple {
        font-size: 0.8rem;
    }
    .machine-details-simple {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }
    .machine-part-simple {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }
    .machine-qty-info {
        margin: 1px 0 !important;
    }
    .machine-qty-info .badge {
        font-size: 0.55rem !important;
        padding: 2px 6px !important;
    }
    .machine-status-display {
        font-size: 0.6rem !important;
        padding: 2px 6px;
        margin-top: 2px;
    }
    .progress-bar-top {
        height: 14px;
        margin-top: 5px;
    }
    .progress-text {
        font-size: 0.65rem;
    }
    .dashboard-card-header .card-title {
        font-size: 0.95rem !important;
    }
    .filter-btn {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
    #shareWhatsappBtn {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
}

/* Hide edit button in fullscreen mode to save space */
:fullscreen .btn-edit-machine,
:-webkit-full-screen .btn-edit-machine,
:-ms-fullscreen .btn-edit-machine {
    display: none !important;
}
