﻿/* ==========================================================
   PRODUCTION MANAGEMENT SYSTEM - GLOBAL DESIGN SYSTEM
   Pixel-Accurate Enterprise Manufacturing Theme
   ========================================================== */


:root {
    /* Brand Colors */
    --primary: #1E60FF;
    --primary-hover: #0D4CD8;
    --primary-light: #EEF4FF;
    --navy: #0B132B;
    --sidebar-bg: #0B132B;
    --sidebar-hover: #172344;
    --sidebar-active: #1E60FF;
    --sidebar-text: #94A3B8;
    --sidebar-text-active: #FFFFFF;

    /* Neutrals */
    --bg-main: #F4F6F9;
    --bg-card: #FFFFFF;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    /* Status & Alerts */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --warning-border: #FDE68A;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;
    --info: #3B82F6;
    --info-bg: #EFF6FF;
    --info-border: #BFDBFE;
    --purple: #8B5CF6;
    --purple-bg: #F5F3FF;
    --purple-border: #DDD6FE;

    /* Layout metrics */
    --sidebar-width: 250px;
    --topbar-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* Reset & Base */
html {
    height: 100%;
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

/* ==========================================================
   SIDEBAR
   ========================================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
    overflow: hidden;
    scrollbar-color: rgba(148, 163, 184, 0.45) var(--sidebar-bg);
}

.sidebar-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
    flex: 0 0 auto;
}

.sidebar-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: #FFFFFF;
}

.sidebar-logo-text {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #FFFFFF;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 12px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) var(--sidebar-bg);
    scrollbar-gutter: stable;
    background-color: var(--sidebar-bg);
}

.sidebar-item {
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #E2E8F0;
    text-decoration: none;
}

.sidebar-item.active .sidebar-link {
    background-color: var(--sidebar-active);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(30,96,255,0.4);
}

.sidebar-icon {
    width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-item.active .sidebar-icon { opacity: 1; }

.sidebar-icon svg {
    width: 19px;
    height: 19px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 6px 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.38);
    border-radius: 999px;
    border: 1px solid var(--sidebar-bg);
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.58);
}

.sidebar-footer {
    padding: 4px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 auto;
    background-color: var(--sidebar-bg);
}

/* ==========================================================
   MAIN CONTENT & TOPBAR
   ========================================================== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: relative;
    flex: 0 0 var(--topbar-height);
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-search input:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 96, 255, 0.1);
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Global Search Results */
.global-search-page {
    padding: 24px;
}

.global-search-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.global-search-head h2 {
    margin: 8px 0 6px;
    font-size: 26px;
    font-weight: 800;
    color: #0F172A;
}

.global-search-head p {
    margin: 0;
    color: #516582;
    font-size: 14px;
}

.global-search-panel {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid #DCE5F2;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    margin-bottom: 16px;
}

.global-search-query label,
.global-search-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.global-search-query input,
.global-search-controls select {
    height: 42px;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 14px;
    color: #0F172A;
    background: #FFFFFF;
}

.global-search-query input:focus,
.global-search-controls select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.global-search-controls {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn-primary-search {
    height: 42px;
    min-width: 96px;
    border: 0;
    border-radius: 7px;
    background: #0F766E;
    color: #FFFFFF;
    font-weight: 800;
    cursor: pointer;
}

.global-search-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.global-search-results {
    background: #FFFFFF;
    border: 1px solid #DCE5F2;
    border-radius: 8px;
    overflow: hidden;
}

.global-search-section-title {
    margin: 12px 0 8px;
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
}

.global-search-section-title.related {
    margin-top: 20px;
}

.global-search-related-note {
    margin: -2px 0 8px;
    color: #64748B;
    font-size: 12px;
    font-weight: 700;
}

.related-results {
    border-style: dashed;
}

.global-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #E5EDF7;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.global-search-result:last-child {
    border-bottom: 0;
}

.global-search-result:hover {
    background: #F8FAFC;
}

.result-main {
    min-width: 0;
}

.result-topline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 5px;
}

.result-type,
.result-module,
.result-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
}

.result-type {
    background: #EFF6FF;
    color: #1D4ED8;
}

.result-module {
    background: #F1F5F9;
    color: #475569;
}

.result-title {
    color: #0F172A;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
}

.result-subtitle,
.result-meta {
    color: #64748B;
    font-size: 13px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.result-meta {
    color: #7B8EA8;
    font-size: 12px;
}

.result-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}

.result-badge {
    background: #ECFDF5;
    color: #047857;
}

.result-score {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 700;
}

.global-search-empty {
    padding: 28px;
    background: #FFFFFF;
    border: 1px solid #DCE5F2;
    border-radius: 8px;
    text-align: center;
    color: #64748B;
    font-weight: 700;
}

.global-search-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.pagination-actions {
    display: flex;
    gap: 8px;
}

.pagination-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    color: #1D4ED8;
    background: #FFFFFF;
    text-decoration: none;
    font-weight: 800;
}

.pagination-actions a.disabled {
    pointer-events: none;
    color: #94A3B8;
    background: #F8FAFC;
}

@media (max-width: 900px) {
    .global-search-panel {
        grid-template-columns: 1fr;
    }

    .global-search-controls,
    .global-search-summary,
    .global-search-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .global-search-result {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-side {
        align-items: flex-start;
        flex-direction: row;
    }

    .pagination-actions {
        flex-wrap: wrap;
    }
}

.topbar-action-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-action-btn:hover {
    background-color: #F1F5F9;
    color: var(--text-primary);
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--danger);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
}

.user-profile-btn:hover {
    background-color: #F8FAFC;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #E2E8F0;
    border: 1px solid var(--border-color);
}

.user-info-text {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Page Content Area */
.content-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    padding: 24px 28px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
    scrollbar-gutter: stable;
}

.content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
    border: 2px solid var(--bg-main);
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ==========================================================
   CARDS & STATS
   ========================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.trend-up {
    color: var(--success);
    font-weight: 600;
}

.stat-trend.trend-down {
    color: var(--danger);
    font-weight: 600;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue { background-color: var(--info-bg); color: var(--primary); }
.stat-icon-green { background-color: var(--success-bg); color: var(--success); }
.stat-icon-orange { background-color: var(--warning-bg); color: var(--warning); }
.stat-icon-red { background-color: var(--danger-bg); color: var(--danger); }
.stat-icon-purple { background-color: var(--purple-bg); color: var(--purple); }

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================
   TABS
   ========================================================== */
.tabs-nav {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 2px;
}

.tab-link {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    position: relative;
    cursor: pointer;
    transition: color 0.15s ease;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF;
}

.btn-secondary {
    background-color: #FFFFFF;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
    color: var(--text-primary);
}

.btn-success {
    background-color: var(--success);
    color: #FFFFFF;
}

.btn-success:hover {
    background-color: #059669;
    color: #FFFFFF;
}

.btn-danger {
    background-color: var(--danger);
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: #DC2626;
    color: #FFFFFF;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-lg {
    padding: 11px 22px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

/* ==========================================================
   TABLES & BADGES
   ========================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #F8FAFC;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #F8FAFC;
}

/* ==========================================================
   STATUS BADGES & PILLS
   ========================================================== */
.status-badge,
.eng-status-badge,
.mat-status-badge,
.pdb-status-pill,
.cut-status-pill,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
    box-sizing: border-box;
}

/* In Progress (Soft Blue) */
.badge-inprogress,
.badge-in-progress,
.badge-inp,
.badge-pen,
.pill-inp,
.pill-inprogress,
.badge-info {
    background-color: #EFF6FF !important;
    color: #1E60FF !important;
    border: none !important;
}

/* Completed / Approved / Pass / OK (Soft Green) */
.badge-success,
.badge-completed,
.badge-app,
.badge-po,
.pill-completed {
    background-color: #ECFDF5 !important;
    color: #10B981 !important;
    border: none !important;
}

/* Pending / Draft / Default (Soft Grey) */
.badge-pending,
.badge-draft,
.badge-default,
.badge-new,
.pill-pending {
    background-color: #F1F5F9 !important;
    color: #64748B !important;
    border: none !important;
}

/* Warning / Review / Awaiting (Soft Orange/Amber) */
.badge-warning,
.badge-rev,
.badge-await,
.pill-warning {
    background-color: #FFF7ED !important;
    color: #F97316 !important;
    border: none !important;
}

/* Danger / Overdue / Rejected / Fail (Soft Red) */
.badge-danger,
.badge-rej,
.badge-req,
.badge-overdue,
.pill-delayed {
    background-color: #FEF2F2 !important;
    color: #EF4444 !important;
    border: none !important;
}

.priority-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.priority-high { background-color: #FEF2F2; color: #EF4444; border: 1px solid #FECACA; }
.priority-medium { background-color: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }
.priority-low { background-color: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    min-width: 80px;
    height: 6px;
    background-color: #E2E8F0;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ==========================================================
   FORMS & INPUTS
   ========================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-label .req {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background-color: #FFFFFF;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 96, 255, 0.1);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

/* Filter Bar */
.filter-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-item {
    flex: 1;
    min-width: 160px;
}

/* File Upload Box */
.file-upload-box {
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background-color: #F8FAFC;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.file-upload-box:hover {
    border-color: var(--primary);
    background-color: #EFF6FF;
}

/* ==========================================================
   DRAWERS (SLIDE-OVER PANELS)
   ========================================================== */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    max-width: 100vw;
    background-color: #FFFFFF;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
}

.drawer-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
}

.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background-color: #F8FAFC;
}

/* Decision Cards (OK / NOT OK) */
.decision-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.decision-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: #FFFFFF;
}

.decision-card.accept.active, .decision-card.accept:hover {
    border-color: var(--success);
    background-color: #F0FDF4;
}

.decision-card.reject.active, .decision-card.reject:hover {
    border-color: var(--danger);
    background-color: #FEF2F2;
}

.decision-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.decision-card.accept .decision-icon-circle {
    background-color: var(--success-bg);
    color: var(--success);
}

.decision-card.reject .decision-icon-circle {
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* Stepper Workflow Timeline */
.workflow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 10px 0;
    margin-bottom: 24px;
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.stepper-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #E2E8F0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.stepper-item.completed .stepper-circle {
    background-color: var(--success);
    color: #FFFFFF;
}

.stepper-item.active .stepper-circle {
    background-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(30, 96, 255, 0.2);
}

.stepper-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: #0F172A;
    color: #FFFFFF;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.25s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-danger { border-left: 4px solid var(--danger); }

@keyframes toastSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .menu-toggle-btn {
        display: inline-flex;
    }

    .topbar-search {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
    }

    .content-wrapper {
        padding: 16px;
    }

    .topbar-search {
        display: none;
    }

    .drawer-panel {
        width: 100vw;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .decision-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .btn-lg {
        padding: 9px 16px;
        font-size: 13px;
    }
}

/* Global Stat Cards (5-col Grid) */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.dash-stat-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    text-decoration: none;
    transition: box-shadow .18s ease, transform .18s ease;
    cursor: pointer;
}
.dash-stat-card:hover {
    box-shadow: 0 4px 14px rgba(30,96,255,.10);
    transform: translateY(-2px);
    text-decoration: none;
}
.dash-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-icon-blue   { background: #EEF4FF; color: #1E60FF; }
.dash-icon-green  { background: #ECFDF5; color: #10B981; }
.dash-icon-orange { background: #FFF7ED; color: #F97316; }
.dash-icon-red    { background: #FEF2F2; color: #EF4444; }

.dash-stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dash-stat-label {
    font-size: 11.5px;
    font-weight: 500;
    color: #64748B;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-stat-num {
    font-size: 26px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.1;
    margin-bottom: 3px;
}
.dash-stat-trend {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.trend-up   { color: #10B981; }
.trend-down { color: #EF4444; }

/* ==========================================================
   GLOBAL FORM CONTROLS & FILTER BOX INPUTS
   ========================================================== */
.wo-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.wo-ctrl-input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 14px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #0F172A;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.wo-ctrl-input::placeholder {
    color: #94A3B8;
    font-size: 12px;
}
.wo-ctrl-input:focus {
    border-color: #1E60FF;
    box-shadow: 0 0 0 3px rgba(30, 96, 255, 0.08);
}
.wo-search-ic {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    stroke: #94A3B8;
}

.wo-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.wo-ctrl-select {
    width: 100%;
    height: 38px;
    padding: 0 32px 0 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #0F172A;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}
.wo-ctrl-select:focus {
    border-color: #1E60FF;
    box-shadow: 0 0 0 3px rgba(30, 96, 255, 0.08);
}
.wo-chevron-ic {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    stroke: #64748B;
}

.wo-date-range-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}
.wo-date-range-box:focus-within {
    border-color: #1E60FF;
    box-shadow: 0 0 0 3px rgba(30, 96, 255, 0.08);
}
.wo-date-display {
    border: none;
    background: transparent;
    font-size: 12.5px;
    color: #0F172A;
    outline: none;
    cursor: pointer;
    width: 100%;
    padding: 0;
}
.wo-date-display::placeholder {
    color: #94A3B8;
}
.wo-date-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.wo-date-input-wrap .wo-ctrl-input {
    cursor: pointer;
    padding-right: 36px;
    background: #fff;
}
.wo-date-cal-ic {
    position: absolute;
    right: 12px;
    pointer-events: none;
}

.wo-reset-btn {
    height: 38px;
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 8px;
    color: #334155;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
}
.wo-reset-btn:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
    text-decoration: none;
}
.wo-reset-btn svg {
    stroke: #64748B;
}

/* ==========================================================
   GLOBAL TABLE ACTIONS & PANEL FORMS
   ========================================================== */
.eng-tbl-actions, .mat-tbl-actions, .tbl-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.eng-act-icon-btn, .mat-act-icon-btn, .tbl-act-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    transition: all 0.15s ease;
    outline: none;
}
.eng-act-icon-btn:hover, .mat-act-icon-btn:hover, .tbl-act-btn:hover {
    background: #F1F5F9;
    color: #1E60FF;
}

.eng-panel-hdr, .mat-panel-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 16px;
}
.eng-panel-title, .mat-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}
.eng-panel-chevron, .mat-panel-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s ease;
}
.eng-panel-chevron:hover, .mat-panel-close-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.eng-frm-row, .mat-frm-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.eng-frm-group, .mat-frm-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.eng-frm-lbl, .mat-frm-lbl {
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
}
.wo-req {
    color: #EF4444;
    margin-left: 2px;
}

/* ==========================================================
   GLOBAL PROCESS TIMELINE
   ========================================================== */
.cut-timeline-wrap, .mat-timeline-vertical {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 0;
}
.cut-timeline-wrap::before, .mat-timeline-vertical::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 19px;
    width: 2px;
    background: #CBD5E1;
    z-index: 1;
}
.cut-tl-item, .mat-tl-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    z-index: 2;
    padding-bottom: 24px;
}
.cut-tl-item:last-child, .mat-tl-item:last-child {
    padding-bottom: 0;
}
.cut-tl-ic, .mat-tl-ic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px #FFFFFF;
}
.cut-tl-ic-green, .ic-green { background: #10B981; }
.cut-tl-ic-blue,  .ic-blue  { background: #1E60FF; }
.cut-tl-ic-grey,  .ic-grey  { background: #94A3B8; }

.cut-tl-content, .mat-tl-cnt {
    flex: 1;
    padding-top: 2px;
}
.cut-tl-title, .mat-tl-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
    margin-bottom: 3px;
}
.cut-tl-time, .mat-tl-time {
    font-size: 11.5px;
    color: #64748B;
    line-height: 1.4;
}
.cut-tl-by, .mat-tl-by {
    font-size: 11.5px;
    color: #64748B;
    line-height: 1.4;
}

/* ==========================================================
   GLOBAL INSPECTION CHECKLIST RADIOS
   ========================================================== */
.fit-custom-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    margin: 0;
    padding: 3px;
}
.fit-custom-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}
.fit-radio-circle {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid #94A3B8;
    background: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-sizing: border-box;
    position: relative;
}
.fit-radio-circle::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.15s ease;
    transform: scale(0);
}

/* Checked Pass (Green ring + Green dot) */
.radio-pass input[type="radio"]:checked + .fit-radio-circle {
    border-color: #10B981;
    background: #FFFFFF;
}
.radio-pass input[type="radio"]:checked + .fit-radio-circle::after {
    background: #10B981;
    transform: scale(1);
}

/* Checked Fail (Red ring + Red dot) */
.radio-fail input[type="radio"]:checked + .fit-radio-circle {
    border-color: #EF4444;
    background: #FFFFFF;
}
.radio-fail input[type="radio"]:checked + .fit-radio-circle::after {
    background: #EF4444;
    transform: scale(1);
}

/* Hover effect */
.radio-pass:hover .fit-radio-circle {
    border-color: #10B981;
}
.radio-fail:hover .fit-radio-circle {
    border-color: #EF4444;
}

/* Raw Materials sub-navigation (Storage / Material Request) */
.mat-subnav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 18px;
    padding: 0;
}
.mat-tab-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.2;
}
.mat-tab-link:hover {
    color: #1E60FF;
}
.mat-tab-link.active {
    color: #1E60FF;
    font-weight: 700;
}
.mat-tab-link.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    background: #1E60FF;
    border-radius: 2px;
}
.mat-subnav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 20px;
}
.mat-subnav-row .mat-subnav-tabs {
    border-bottom: none;
    margin-bottom: 0;
}

/* Raw Material Storage - layout, filters, location panel */
.mat-storage-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.15fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}
.mat-loc-details-card {
    padding: 18px 20px;
    position: sticky;
    top: 12px;
}
.mat-card {
    padding: 18px 20px;
}
.mat-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0 0 14px 0;
    flex-wrap: wrap;
}
.mat-filter-row .eng-filter-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 130px;
    min-width: 120px;
}
.mat-filter-row .eng-filter-top-lbl {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    line-height: 1;
}
.mat-filter-search {
    flex: 1.6 1 200px;
    min-width: 180px;
}
.mat-filter-heat {
    flex: 0 1 130px;
    min-width: 120px;
}
.mat-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.mat-filter-apply,
.mat-filter-row .eng-reset-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    white-space: nowrap;
}
.mat-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-top: 2px;
}
.mat-action-bar-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.mat-action-btn {
    padding: 7px 14px;
    font-size: 12px;
    gap: 6px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}
.mat-action-btn-blue {
    color: #1E60FF;
    border-color: #BFDBFE;
}
.mat-sum-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mat-sum-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #F1F5F9;
}
.mat-sum-row:last-child {
    border-bottom: none;
}
.mat-sum-lbl {
    color: #64748B;
    font-size: 11.5px;
    flex: 0 0 auto;
}
.mat-sum-val {
    font-weight: 600;
    color: #0F172A;
    text-align: right;
    font-size: 12px;
    line-height: 1.35;
}
.mat-sec-title {
    font-weight: 700;
    color: #0F172A;
}
.mat-sel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.mat-ctrl-sel {
    width: 100%;
    height: 38px;
    padding: 0 28px 0 10px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #111827;
    background: #fff;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.mat-ctrl-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #0F172A;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mat-ctrl-sel:focus,
.mat-ctrl-input:focus {
    border-color: #1E60FF;
    box-shadow: 0 0 0 3px rgba(30, 96, 255, 0.08);
}
.mat-chev {
    position: absolute;
    right: 9px;
    pointer-events: none;
}
.mat-row-menu {
    position: relative;
    display: inline-flex;
}
.mat-row-menu-drop {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 190px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    z-index: 40;
    padding: 6px 0;
    text-align: left;
}
.mat-row-menu.is-open .mat-row-menu-drop {
    display: block;
}
.mat-row-menu-drop a,
.mat-row-menu-drop button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 12px;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
}
.mat-row-menu-drop a:hover,
.mat-row-menu-drop button:hover {
    background: #F8FAFC;
    color: #1E60FF;
}
.mat-hist-mini-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
    table-layout: fixed;
}
.mat-hist-mini-tbl th,
.mat-hist-mini-tbl td {
    padding: 6px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mat-hist-mini-tbl th:nth-child(1),
.mat-hist-mini-tbl td:nth-child(1) { width: 22%; }
.mat-hist-mini-tbl th:nth-child(2),
.mat-hist-mini-tbl td:nth-child(2) { width: 18%; }
.mat-hist-mini-tbl th:nth-child(3),
.mat-hist-mini-tbl td:nth-child(3) { width: 22%; }
.mat-hist-mini-tbl th:nth-child(4),
.mat-hist-mini-tbl td:nth-child(4) { width: 14%; text-align: right; }
.mat-hist-mini-tbl th:nth-child(5),
.mat-hist-mini-tbl td:nth-child(5) { width: 14%; text-align: right; }
.mat-hist-mini-tbl th:nth-child(6),
.mat-hist-mini-tbl td:nth-child(6) { width: 18%; }
.mat-hist-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mat-hist-modal {
    width: 100%;
    max-width: 820px;
    max-height: 86vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}
.mat-hist-hdr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #F8FAFC;
}
.mat-hist-crumb {
    margin: 0;
    font-size: 11px;
    color: #64748B;
}
.mat-hist-hdr h3 {
    margin: 2px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
}
.mat-hist-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #64748B;
    line-height: 1;
}
.mat-hist-body {
    padding: 12px 16px 18px;
}
#storageMasterTable.eng-drawings-tbl tr.row-selected td {
    background: #EFF6FF;
}
@media (max-width: 1200px) {
    .mat-storage-grid {
        grid-template-columns: 1fr;
    }
    .mat-loc-details-card {
        position: static;
    }
}
@media (max-width: 600px) {
    .mat-loc-details-card,
    .mat-card {
        padding: 14px 12px;
    }
}

/* ==========================================================
   MOBILE RESPONSIVE DESIGN SYSTEM
   Pixel-accurate desktop layout preserved (>1024px)
   Smooth, touch-optimized responsive layout (<=1024px, <=768px, <=480px)
   ========================================================== */

/* Universal anti-overflow safeguards */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

.app-container {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

.table-responsive,
.dash-table-wrap,
.wo-table-responsive,
.eng-table-wrap,
.eng-rev-table-wrap,
.ncr-table-wrap,
.mat-table-wrap,
.cut-table-wrap,
.fit-table-wrap,
.wld-table-wrap,
.ndt-table-wrap,
.dft-table-wrap,
.fin-table-wrap,
.pck-table-wrap,
.dsp-table-wrap,
.rep-table-wrap,
.gantt-chart-container,
.plan-table-scroll,
.cad-map-scroll-wrap,
.wod-stepper-card,
.dash-pipeline-wrap,
.wf-snapshot-wrapper,
.eng-stepper-wrap,
.fwi-tbl-scroll,
.photo-strip-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

/* Custom smooth horizontal scrollbar */
.table-responsive::-webkit-scrollbar,
.dash-table-wrap::-webkit-scrollbar,
.wo-table-responsive::-webkit-scrollbar,
.eng-table-wrap::-webkit-scrollbar,
.ncr-table-wrap::-webkit-scrollbar,
.mat-table-wrap::-webkit-scrollbar,
.cut-table-wrap::-webkit-scrollbar,
.fit-table-wrap::-webkit-scrollbar,
.wld-table-wrap::-webkit-scrollbar,
.ndt-table-wrap::-webkit-scrollbar,
.dft-table-wrap::-webkit-scrollbar,
.fin-table-wrap::-webkit-scrollbar,
.pck-table-wrap::-webkit-scrollbar,
.dsp-table-wrap::-webkit-scrollbar,
.rep-table-wrap::-webkit-scrollbar,
.gantt-chart-container::-webkit-scrollbar,
.plan-table-scroll::-webkit-scrollbar,
.cad-map-scroll-wrap::-webkit-scrollbar,
.wod-stepper-card::-webkit-scrollbar,
.dash-pipeline-wrap::-webkit-scrollbar,
.wf-snapshot-wrapper::-webkit-scrollbar,
.eng-stepper-wrap::-webkit-scrollbar,
.fwi-tbl-scroll::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-thumb,
.dash-table-wrap::-webkit-scrollbar-thumb,
.wo-table-responsive::-webkit-scrollbar-thumb,
.eng-table-wrap::-webkit-scrollbar-thumb,
.ncr-table-wrap::-webkit-scrollbar-thumb,
.mat-table-wrap::-webkit-scrollbar-thumb,
.cut-table-wrap::-webkit-scrollbar-thumb,
.fit-table-wrap::-webkit-scrollbar-thumb,
.wld-table-wrap::-webkit-scrollbar-thumb,
.ndt-table-wrap::-webkit-scrollbar-thumb,
.dft-table-wrap::-webkit-scrollbar-thumb,
.fin-table-wrap::-webkit-scrollbar-thumb,
.pck-table-wrap::-webkit-scrollbar-thumb,
.dsp-table-wrap::-webkit-scrollbar-thumb,
.rep-table-wrap::-webkit-scrollbar-thumb,
.gantt-chart-container::-webkit-scrollbar-thumb,
.plan-table-scroll::-webkit-scrollbar-thumb,
.cad-map-scroll-wrap::-webkit-scrollbar-thumb,
.wod-stepper-card::-webkit-scrollbar-thumb,
.dash-pipeline-wrap::-webkit-scrollbar-thumb,
.wf-snapshot-wrapper::-webkit-scrollbar-thumb,
.eng-stepper-wrap::-webkit-scrollbar-thumb,
.fwi-tbl-scroll::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 99px;
}

/* â”€â”€ TABLET & MOBILE BREAKPOINT (<= 1024px) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
    /* Mobile Sidebar & Layout */
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 270px;
        z-index: 9999;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(3px);
        z-index: 9998;
    }

    .sidebar-backdrop.active {
        display: block !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .menu-toggle-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        padding: 0 16px !important;
    }

    .content-area {
        padding: 16px !important;
    }

    /* Horizontal Scrollable Tables on Mobile (preserves column alignments & action buttons) */
    .table-responsive table,
    .dash-table-wrap table,
    .wo-table-responsive table,
    .eng-table-wrap table,
    .ncr-table-wrap table,
    .mat-table-wrap table,
    .cut-table-wrap table,
    .fit-table-wrap table,
    .wld-table-wrap table,
    .ndt-table-wrap table,
    .dft-table-wrap table,
    .fin-table-wrap table,
    .pck-table-wrap table,
    .dsp-table-wrap table,
    .rep-table-wrap table,
    table.data-table,
    table.eng-drawings-tbl,
    table.wo-data-tbl {
        min-width: 720px !important;
        width: 100% !important;
    }

    .table-responsive table th,
    .table-responsive table td,
    .dash-table-wrap table th,
    .dash-table-wrap table td,
    .wo-table-responsive table th,
    .wo-table-responsive table td,
    .eng-table-wrap table th,
    .eng-table-wrap table td,
    .ncr-table-wrap table th,
    .ncr-table-wrap table td,
    .mat-table-wrap table th,
    .mat-table-wrap table td,
    .cut-table-wrap table th,
    .cut-table-wrap table td,
    .fit-table-wrap table th,
    .fit-table-wrap table td,
    .wld-table-wrap table th,
    .wld-table-wrap table td,
    .ndt-table-wrap table th,
    .ndt-table-wrap table td,
    .dft-table-wrap table th,
    .dft-table-wrap table td,
    .fin-table-wrap table th,
    .fin-table-wrap table td,
    .pck-table-wrap table th,
    .pck-table-wrap table td,
    .dsp-table-wrap table th,
    .dsp-table-wrap table td,
    .rep-table-wrap table th,
    .rep-table-wrap table td,
    table.data-table th,
    table.data-table td,
    table.eng-drawings-tbl th,
    table.eng-drawings-tbl td,
    table.wo-data-tbl th,
    table.wo-data-tbl td {
        white-space: nowrap !important;
    }

    /* Production Workflow Snapshot & Snake Pipeline Diagram on Mobile */
    .dash-pipeline-wrap,
    .wf-snapshot-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
        padding-bottom: 8px !important;
    }
    .wf-tier-row {
        min-width: 660px !important;
    }

    /* 11-Stage Workflow Stepper Track */
    .wod-stepper-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
    }
    .wod-stepper-track {
        min-width: 840px !important;
    }

    /* Gantt Chart Timeline Schedule */
    .gantt-chart-container,
    .gantt-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
    }
    .gantt-chart-table {
        min-width: 720px !important;
    }

    /* CAD 3D Visual Weld Map & Inspection Diagram Map */
    .cad-map-scroll-wrap,
    .cad-map-container,
    .isometric-map-box {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
    }
    .cad-map-container img,
    .isometric-map-box img {
        min-width: 580px !important;
        max-width: none !important;
    }

    /* Top KPI Grids */
    .dash-stats-row,
    .dash-kpi-grid,
    .plan-kpi-grid,
    .eng-kpi-row,
    .mat-kpi-row,
    .cut-kpi-row,
    .fit-kpi-row,
    .wld-kpi-row,
    .ndt-kpi-row,
    .blast-kpi-row,
    .paint-kpi-row,
    .fin-kpi-row,
    .pck-kpi-row,
    .dsp-kpi-row,
    .ncr-kpi-row,
    .rep-kpi-row,
    .wo-kpi-row,
    .wod-kpi-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* 2-Column Main & Secondary Grids Across All Pages */
    .dash-main-grid,
    .dash-bottom-grid,
    .eng-page-grid,
    .mat-two-col,
    .mat-card-grid,
    .cut-main-grid,
    .cut-twin-grid,
    .fit-main-grid,
    .wld-main-grid,
    .ndt-main-grid,
    .blast-main-grid,
    .paint-main-grid,
    .fin-main-grid,
    .pck-main-grid,
    .dsp-main-grid,
    .ncr-layout-grid,
    .rep-charts-grid,
    .set-form-grid,
    .prof-grid,
    .wod-main-grid,
    .wod-twin-grid,
    .fwi-main-grid,
    .fwi-btm-panels-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Inner Column & Field Grids */
    .cut-job-details-grid,
    .cut-util-grid,
    .fit-job-details-grid,
    .fit-checklist-grid,
    .wld-params-grid,
    .wld-job-details-grid,
    .ndt-details-grid,
    .blast-details-grid,
    .paint-details-grid,
    .fwi-defects-grid,
    .dsp-details-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Process Action Buttons Row */
    .cut-action-btns-row,
    .fit-action-btns-row,
    .wld-action-btns-row,
    .wo-header-actions,
    .plan-toolbar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }
    .cut-action-btns-row .btn,
    .fit-action-btns-row .btn,
    .wld-action-btns-row .btn,
    .wo-header-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Drawers & Details Panels */
    .eng-details-col,
    .ncr-details-drawer,
    .wod-main-right,
    .fit-details-card,
    .cut-right-col,
    .cut-left-col,
    .fwi-left-col,
    .fwi-right-col {
        width: 100% !important;
        max-width: 100% !important;
    }

    .wo-create-drawer {
        width: 100% !important;
        max-width: 100vw !important;
    }
}

/* â”€â”€ MOBILE PHONES & SMALL TABLETS (<= 768px) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 768px) {
    .topbar {
        padding: 0 12px !important;
        height: 60px !important;
    }

    .topbar-search {
        display: none !important;
    }

    .page-title {
        font-size: 16px !important;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-info-text {
        display: none !important;
    }

    .user-profile-btn {
        padding: 2px !important;
    }

    .content-area {
        padding: 12px 10px !important;
    }

    /* Sub-navigation tabs */
    .mat-subnav-tabs,
    .set-tabs-nav,
    .wo-tabs-bar {
        overflow-x: auto !important;
        white-space: nowrap !important;
        display: flex !important;
        gap: 6px !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px !important;
    }

    .mat-tab-link,
    .set-tab-btn {
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 12.5px !important;
    }

    /* Filter Bars */
    .wo-filter-bar,
    .eng-filter-bar,
    .mat-filter-bar,
    .mat-filter-row,
    .mat-filter-row-1,
    .mat-filter-row-2,
    .ncr-filter-grid,
    .rep-filter-bar,
    .plan-toolbar,
    .cut-filter-bar,
    .fit-filter-bar,
    .wld-filter-bar,
    .pnt-filter-bar,
    .mat-filter-form {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .wo-filter-bar select,
    .wo-filter-bar input,
    .wo-filter-bar button,
    .eng-filter-bar select,
    .eng-filter-bar input,
    .eng-filter-bar button,
    .ncr-filter-grid input,
    .ncr-filter-grid select,
    .ncr-filter-grid button,
    .mat-filter-row input,
    .mat-filter-row select,
    .mat-filter-row button,
    .mat-search-wrap,
    .mat-filter-select-wrap,
    .wo-search-wrap,
    .eng-search-wrap {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* Photo galleries */
    .fit-photo-grid,
    .wld-photo-grid,
    .ndt-photo-grid,
    .blast-photo-gallery,
    .paint-photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Form Controls & Grids */
    .form-row,
    .form-grid,
    .eng-form-grid,
    .wld-params-grid,
    .wod-meta-grid,
    .dsp-form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Steppers */
    .wod-hero-top {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .wod-hero-right,
    .wod-hero-progress-wrap,
    .wod-hero-progress-bar {
        width: 100% !important;
    }

    /* Final Weld Visual Map & Isometric Diagram */
    .fwi-map-canvas {
        min-height: 320px !important;
    }
}

/* â”€â”€ SMALL MOBILE PHONES (<= 480px) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 480px) {
    .dash-stats-row,
    .dash-kpi-grid,
    .plan-kpi-grid,
    .eng-kpi-row,
    .mat-kpi-row,
    .cut-kpi-row,
    .fit-kpi-row,
    .wld-kpi-row,
    .ndt-kpi-row,
    .blast-kpi-row,
    .paint-kpi-row,
    .fin-kpi-row,
    .pck-kpi-row,
    .dsp-kpi-row,
    .ncr-kpi-row,
    .rep-kpi-row,
    .wo-kpi-row,
    .wod-kpi-row {
        grid-template-columns: 1fr !important;
    }

    .cut-job-details-grid,
    .cut-util-grid,
    .fit-job-details-grid,
    .fit-checklist-grid,
    .wld-params-grid,
    .wld-job-details-grid,
    .ndt-details-grid,
    .blast-details-grid,
    .paint-details-grid,
    .fwi-defects-grid,
    .dsp-details-grid {
        grid-template-columns: 1fr !important;
    }

    .fit-photo-grid,
    .wld-photo-grid,
    .ndt-photo-grid,
    .blast-photo-gallery,
    .paint-photo-grid {
        grid-template-columns: 1fr !important;
    }

    .notif-dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 8px !important;
        right: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    }

    .user-profile-menu {
        position: fixed !important;
        top: 60px !important;
        left: 8px !important;
        right: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }

    .card {
        padding: 14px 12px !important;
        border-radius: 8px !important;
    }

    .btn {
        padding: 8px 14px !important;
        font-size: 12.5px !important;
    }
}

/* ==========================================================
   INTERACTIVE CALENDAR & DATEPICKER SUITE
   ========================================================== */
/* Hide the browser's native date picker so only the custom calendar is used */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

.dp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
}
.dp-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.custom-datepicker-popup {
    position: absolute;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 10001;
    width: 320px;
    padding: 16px;
    font-family: inherit;
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    user-select: none;
}
.custom-datepicker-popup.open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.custom-datepicker-popup.is-range {
    width: 340px;
}

/* Date Range Presets Bar */
.dp-presets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #F1F5F9;
}
.dp-preset-btn {
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dp-preset-btn:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E60FF;
}
.dp-preset-btn.active {
    background: #1E60FF;
    border-color: #1E60FF;
    color: #FFFFFF;
    font-weight: 600;
}

/* Header (Month / Year Navigation) */
.dp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.dp-nav-btn {
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #475569;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}
.dp-nav-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}
.dp-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dp-month-select, .dp-year-select {
    border: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
}
.dp-month-select:hover, .dp-year-select:hover {
    background: #F1F5F9;
    border-color: #E2E8F0;
}

/* Weekday Labels */
.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}
.dp-weekday {
    font-size: 11px;
    font-weight: 600;
    color: #94A3B8;
    padding: 4px 0;
}

/* Days Grid */
.dp-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 3px;
}
.dp-day-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: #1E293B;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.12s ease;
    position: relative;
}
.dp-day-cell:hover:not(.dp-empty):not(.dp-disabled) {
    background: #EFF6FF;
    color: #1E60FF;
}
.dp-day-cell.dp-empty {
    cursor: default;
    pointer-events: none;
}
.dp-day-cell.dp-disabled {
    color: #CBD5E1;
    cursor: not-allowed;
}
.dp-day-cell.dp-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #1E60FF;
}
.dp-day-cell.dp-selected {
    background: #1E60FF !important;
    color: #FFFFFF !important;
    font-weight: 700;
    border-radius: 8px !important;
}
.dp-day-cell.dp-range-start {
    background: #1E60FF !important;
    color: #FFFFFF !important;
    font-weight: 700;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.dp-day-cell.dp-range-end {
    background: #1E60FF !important;
    color: #FFFFFF !important;
    font-weight: 700;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.dp-day-cell.dp-in-range {
    background: #EFF6FF !important;
    color: #1E60FF !important;
    border-radius: 0 !important;
}

/* Footer / Actions */
.dp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
}
.dp-footer-info {
    font-size: 11px;
    color: #64748B;
    font-weight: 500;
}
.dp-footer-actions {
    display: flex;
    gap: 8px;
}
.dp-btn-cancel {
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.dp-btn-cancel:hover {
    background: #F8FAFC;
    color: #0F172A;
}
.dp-btn-apply {
    border: none;
    background: #1E60FF;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(30, 96, 255, 0.25);
}
.dp-btn-apply:hover {
    background: #1849C6;
}

/* Mobile Centered DatePicker Modal */
@media (max-width: 768px) {
    .custom-datepicker-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: min(340px, calc(100vw - 32px)) !important;
        max-width: calc(100vw - 32px) !important;
        z-index: 10002 !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
    }
}









/* Compact Assembly Part List process indicators */
.wo-process-cell,
.pdb-process-cell {
    min-width: 180px;
}
.wo-process-mini-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    max-width: 260px;
}
.wo-process-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    white-space: nowrap;
    line-height: 1;
}
.wo-process-mini b {
    font-size: 10.5px;
    font-weight: 700;
}
.wo-process-mini em {
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
}
.wo-process-mini.ok {
    color: #047857;
    background: #ECFDF5;
    border-color: #A7F3D0;
}
.wo-process-mini.na {
    color: #B91C1C;
    background: #FEF2F2;
    border-color: #FECACA;
}
.wo-process-mini.pending {
    color: #64748B;
    background: #F8FAFC;
    border-color: #CBD5E1;
}
.wo-process-more,
.wo-process-empty {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #F8FAFC;
    color: #64748B;
    border: 1px dashed #CBD5E1;
    font-size: 10.5px;
    font-weight: 700;
}
.pdb-plan-processes {
    min-width: 150px;
}
.pdb-plan-processes .wo-process-mini-grid {
    margin-top: 3px;
    max-width: 220px;
}

