/* Industrial Light Theme Implementation */
* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;

    /* Light Theme Palette */
    --bg-body: #F1F5F9;
    /* Slate 100 - Main Background */
    --bg-card: #FFFFFF;
    /* White - Cards */
    --bg-sidebar: #0F172A;
    /* Slate 900 - Sidebar (Dark for contrast) */

    --text-primary: #334155;
    /* Slate 700 - Body Text */
    --text-heading: #1E293B;
    /* Slate 800 - Headings */
    --text-muted: #64748B;
    /* Slate 500 - Secondary Text */
    --text-light: #F8FAFC;
    /* Slate 50 - Text on Dark Backgrounds */

    --border-color: #E2E8F0;
    /* Slate 200 */

    /* Industrial Safety Colors (Bold & Clear) */
    --accent-blue: #0284C7;
    /* Sky 600 - Primary/Action */
    --accent-green: #16A34A;
    /* Green 600 - Success/On */
    --accent-red: #DC2626;
    /* Red 600 - Error/Off */
    --accent-yellow: #CA8A04;
    /* Yellow 600 - Warning */
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* Sidebar - Remote Dark for Professional Look */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: none;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

.sidebar.active {
    transform: translateX(0);
    box-shadow: 4px 0 24px 0 rgba(0, 0, 0, 0.15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    /* Always white on dark sidebar */
    margin-bottom: 2rem;
    padding-left: 1rem;
    letter-spacing: 1px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 0.5rem;
    margin-bottom: 2rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--accent-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.menu-arrow {
    margin-left: auto;
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.menu-arrow.rotate {
    transform: rotate(180deg);
}

.nav-sub-menu {
    display: none;
    list-style: none;
    padding-left: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.2);
}

.nav-sub-menu.show {
    display: block;
}

.nav-sub-item {
    margin: 0;
}

.nav-sub-link {
    display: block;
    padding: 0.6rem 1rem 0.6rem 3.5rem;
    /* Indented text */
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-sub-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-blue);
}

.user-info .name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

.user-info .status {
    color: var(--text-muted);
    /* Muted slate on dark */
    font-size: 0.75rem;
    margin: 0;
}

/* Navigation */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: #94A3B8;
    /* Slate 400 for inactive links */
    text-decoration: none;
    border-radius: 0.5rem;
    /* More rounded */
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-icon {
    margin-right: 1rem;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Main Panel */
.main-panel {
    margin-left: 0;
    padding: 2rem;
    width: 100%;
    background-color: var(--bg-body);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 1rem;
    z-index: 99;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}

.navbar-toggle {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.navbar-toggle:hover {
    background-color: #f1f5f9;
}

.navbar-search input {
    background-color: var(--bg-body);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
    width: 300px;
}

.navbar-search input::placeholder {
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

/* Card Styling - Clean White */
.card {
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
}

.card-title {
    color: var(--text-heading);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Table Styling */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th {
    color: var(--text-heading);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.table tr:hover {
    background-color: #F8FAFC;
    /* Slate 50 hover */
}

/* Input Styling - Readable Forms */
input[type="date"],
input[type="number"],
input[type="text"],
textarea,
.time-input {
    background-color: #FFFFFF;
    /* White input */
    border: 1px solid var(--border-color);
    color: var(--text-heading) !important;
    /* Dark text */
    font-weight: 500;
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    /* Fix width overflow */
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
    border-color: var(--accent-blue);
    background-color: #FFFFFF;
    color: var(--text-heading) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
    /* Soft focus ring */
}

::placeholder {
    color: #94A3B8 !important;
    /* Slate 400 placeholder */
    opacity: 1;
}

/* Date Icon Reset */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    /* Reset invert */
    cursor: pointer;
    opacity: 0.6;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-heading);
    font-weight: 500;
}

/* Buttons */
.btn-submit,
.btn-create {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    display: inline-block;
    /* Ensure width is respected */
    box-sizing: border-box;
    /* Fix width overflow on mobile */
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

.btn-submit:hover,
.btn-create:hover {
    background-color: #0369A1;
    /* Darker blue hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -1px rgba(2, 132, 199, 0.4);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Status Button Styles */
.status-options {
    display: flex;
    gap: 1rem;
}

.status-label {
    padding: 0.6rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    background-color: #FFFFFF;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
    font-weight: 500;
}

.status-label:hover {
    border-color: var(--text-heading);
    color: var(--text-heading);
    background-color: #F8FAFC;
}

/* Active Status States */
.status-radio:checked+.status-mati {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.status-radio:checked+.status-hidup {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.3);
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    line-height: 1;
}

.badge-success {
    background-color: #DCFCE7;
    /* Green 100 */
    color: #166534;
    /* Green 800 */
    border: 1px solid #BBF7D0;
}

.badge-warning {
    background-color: #FEF9C3;
    /* Yellow 100 */
    color: #854D0E;
    /* Yellow 800 */
    border: 1px solid #FEF08A;
}

.badge-danger {
    background-color: #FEE2E2;
    /* Red 100 */
    color: #991B1B;
    /* Red 800 */
    border: 1px solid #FECACA;
}

/* Minimalist Form Containers */
.layout-wrapper {
    display: flex;
}

/* Time Inputs Layout */
.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.separator {
    font-weight: bold;
    color: var(--text-muted);
}

.card-container {
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-header {
    background-color: var(--bg-card);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.card-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-heading);
}

.card-header .icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.card-content {
    padding: 1.5rem;
}

.hidden {
    display: none;
}

.card-container.active .hidden {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Link Button */
.btn-dashboard-link {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-card);
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-dashboard-link:hover {
    background-color: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

/* Responsive Implementation */
@media (max-width: 768px) {

    .main-panel {
        padding: 1.5rem;
    }

    /* Auto Stack Grid for Dashboard */
    .dashboard-stats-grid,
    .machine-grid,
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr;
        /* Force single column on mobile */
        gap: 1.5rem;
    }

    /* Ensure cards in grid stack */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Page Header Stack */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        /* Align left */
        gap: 1rem;
    }

    .page-header .btn-create {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }

    /* Form Containers Full Width */
    .main-wrapper {
        min-width: auto !important;
        width: 100% !important;
        padding: 0;
    }

    .containers-grid {
        padding: 0;
    }
}

/* Desktop Grid Definitions */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {

    .machine-grid,
    .stats-grid {
        grid-template-columns: 1fr !important;
        /* Force stack */
    }
}

/* User Requested Top Navbar */
.app-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}

.navbar.navbar-hidden,
.app-navbar.navbar-hidden {
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
}

.app-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background-color: var(--accent-blue);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background-color: #eff6ff;
    color: var(--accent-blue);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
    border: 1px solid #ffffff;
}

/* User Requested Notification Panel & Grid Layout */
.layout-grid {
    display: block;
    width: 100%;
    margin: 0 auto;
}

/* Triggered by JS when notification icon clicked */
.layout-grid.layout-expanded {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    /* Wider container for 2 cols */
}

/* Form Container behavior in grid */
.layout-grid.layout-expanded .main-wrapper {
    width: 100%;
    max-width: 100%;
    /* Fill grid cell */
    margin: 0;
}

/* Notification Panel - Hidden by default */
.notification-panel {
    display: none;
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.5rem;
    height: fit-content;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease;
}

.layout-grid.layout-expanded .notification-panel {
    display: block;
}

.noti-header {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.noti-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.noti-item {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--accent-blue);
    font-size: 0.9rem;
}

.noti-item.warning {
    border-left-color: var(--accent-red);
    background-color: #FEF2F2;
}

.noti-item.success {
    border-left-color: var(--accent-green);
    background-color: #F0FDF4;
}

.noti-item.info {
    border-left-color: #3b82f6;
    background-color: #eff6ff;
}

.noti-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-heading);
}

.noti-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    float: right;
}

.noti-desc {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.85rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .layout-grid.layout-expanded {
        grid-template-columns: 1fr;
    }

    .notification-panel {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Custom Gradient for Dark Orange Status */
.bg-gradient-dark-orange {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: white !important;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.4);
}

.bg-gradient-dark-orange:hover {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.5);
}

/* Custom Gradient for Yellow Status */
.bg-gradient-yellow {
    background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
    color: white !important;
    /* Kept white for consistency, assuming adequate contrast from darker yellow end */
    border: none;
    box-shadow: 0 4px 6px -1px rgba(202, 138, 4, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for readability */
}

.bg-gradient-yellow:hover {
    background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(202, 138, 4, 0.5);
}

/* ==========================================
   SMART TV RESPONSIVE - Global Styles
   ========================================== */

/* Full HD TV (1920px+) */
@media (min-width: 1920px) {
    body {
        font-size: 1.1rem;
    }

    .sidebar {
        width: 300px;
        padding: 2.5rem 1.5rem;
    }

    .sidebar-brand {
        font-size: 1.8rem;
        margin-bottom: 2.5rem;
    }

    .nav-link {
        padding: 1rem 1.2rem;
        font-size: 1.05rem;
        margin-bottom: 0.6rem;
    }

    .nav-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .card {
        border-radius: 1rem;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .navbar-toggle {
        font-size: 1.8rem;
    }

    .table th {
        font-size: 1rem;
        padding: 1.2rem;
    }

    .table td {
        font-size: 1rem;
        padding: 1.2rem;
    }

    .badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.9rem;
    }
}

/* 4K UHD TV (2560px+) */
@media (min-width: 2560px) {
    body {
        font-size: 1.3rem;
    }

    .sidebar {
        width: 360px;
        padding: 3rem 2rem;
    }

    .sidebar-brand {
        font-size: 2.2rem;
        margin-bottom: 3rem;
    }

    .nav-link {
        padding: 1.2rem 1.5rem;
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .nav-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .card {
        border-radius: 1.25rem;
    }

    .card-title {
        font-size: 1.6rem;
    }

    .navbar-toggle {
        font-size: 2.2rem;
    }

    .table th {
        font-size: 1.15rem;
        padding: 1.5rem;
    }

    .table td {
        font-size: 1.15rem;
        padding: 1.5rem;
    }

    .badge {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* ==========================================
   MOBILE RESPONSIVE - Admin Views (HP)
   ========================================== */
@media (max-width: 768px) {
    /* 1. Main Layout & Paddings */
    body {
        overflow-y: auto !important;
        height: auto !important;
    }
    
    .tv-wrapper {
        height: auto !important;
        min-height: 100vh !important;
    }
    
    .main-panel {
        padding: 0.75rem !important;
    }
    .card, .area-panel {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* 2. Admin Dashboard Header (Override Inline Flex) */
    .dashboard-header, .tv-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 12px !important;
        margin: 0 !important;
        border-radius: 8px !important;
        height: auto !important;
        position: relative !important;
    }
    
    /* First row: toggle + logo + title */
    .dashboard-header > div:first-child, .tv-header > div:first-child {
        width: 100% !important;
        justify-content: flex-start !important;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 10px;
    }
    
    /* Second row: filters, clock, export */
    .dashboard-header > div:last-child, .tv-header > div:last-child {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    /* Inner filter groups (Period buttons & inputs) */
    .dashboard-header > div:last-child > div, .tv-header > div:last-child > div {
        width: 100% !important;
        justify-content: space-between !important;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    /* Period buttons */
    .dashboard-header .btn-period, .tv-header .btn-period {
        flex: 1;
        text-align: center;
        padding: 8px !important;
        font-size: 0.75rem !important;
    }
    
    /* Remove border from clock in header */
    .dashboard-header > div:last-child > div[style*="border-left"], 
    .tv-header > div:last-child > div[style*="border-left"] {
        border-left: none !important;
        padding-left: 0 !important;
        justify-content: center !important;
        margin-top: 5px;
    }
    
    /* 3. Tables Responsive (Horizontal Scroll Tanpa Merusak Layout) */
    table, .table, .prod-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    th, td {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
    }
    
    /* 4. Filter Inputs & Badges */
    .filter-input {
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 5px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .summary-strip {
        flex-direction: column !important;
        width: 100%;
        gap: 8px !important;
    }
    
    .summary-badge {
        width: 100%;
        justify-content: space-between !important;
        padding: 12px 15px !important;
    }
    
    /* Form Group Layout Mobile */
    .form-group {
        width: 100% !important;
    }
    
    /* Fix MTBF Table Scrolling (Smooth & Lancar) */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table.mini-table {
        display: table !important; /* Kembalikan ke sifat tabel asli */
        min-width: 450px !important; /* Paksa lebar agar bisa di-scroll */
    }
    
    /* SweetAlert Mobile Fix */
    .swal2-popup {
        width: 90% !important;
        font-size: 0.9rem !important;
    }
    
    /* Live Monitoring Responsive Overrides */
    .live-left-col {
        min-width: 0 !important;
        width: 100% !important;
    }
    
    .live-monitoring-wrapper {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* Timer & Graph layout stacking inside machine cards */
    .machine-card {
        height: auto !important;
        min-height: auto !important;
        width: 100% !important;
    }
    
    .machine-card > div:nth-child(2) {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .machine-card > div:nth-child(2) > div:first-child {
        flex: none !important;
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
    
    .machine-card > div:nth-child(2) > div:last-child {
        min-height: 150px !important;
        width: 100% !important;
    }
    
    /* Fix Kelola Kategori Form & Filter */
    form[action*="damage-categories"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    form[action*="damage-categories"] > div {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    form[action*="damage-categories"] > button {
        width: 100% !important;
    }
    .card-body > div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    /* Fix QR Code Generator Form */
    .card-body .d-flex.gap-2 {
        flex-direction: column !important;
    }
    .card-body .d-flex.gap-2 > * {
        width: 100% !important;
        flex: none !important;
    }
    
    /* Fix Rework Badges Stacking (data_produksi) */
    .area-panel > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .area-panel > div:first-child > div:last-child {
        width: 100% !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .area-panel > div:first-child > div:last-child > div {
        width: 100% !important;
        justify-content: space-between !important;
    }
}